🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Swap shader

Started by
0 comments, last by Tommato 3 years, 12 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