Advertisement

Swap shader

Started by July 11, 2020 11:17 AM
0 comments, last by Tommato 4 years, 6 months ago

Hi All

My render order is

1) bind VAO and shader

2) Set attributes and uniforms

3) call glDrawElements

4) disable attributes and release shader & VAO

Unfortunately I need different shaders for different primitives in glDrawElements. It's guaranteed all attributes & uniforms are exactly same for all shaders. How can I avoid re-setup (point 2 above)? Uniforms is not a big prob, anyway I've a map for them. But will attributes work? Maybe need to specify same “location” in all shaders? And what to do with element buffer? Experimented, for now no errors but nor render ;-)

Thank you

This topic is closed to new replies.

Advertisement