OpenGL ES 2.0 Multiple Programs or Multiple Shaders or what? How does it work?

后端 未结 1 403
执笔经年
执笔经年 2021-01-30 08:13

The Problem (TL;DR)

My problem, fundamentally, is that I do not know how OpenGL ES 2.0 expects me to write and use multiple shaders; or if it is even advisable/expecte

相关标签:
1条回答
  • 2021-01-30 09:11

    You can use multiple shaders, but to switch between them can be quite costly so the recommended practise is to draw every object of a shader, then switch to the next shader and draw all the objects using that one and so on.
    To switch between shaders, you call glUseProgram().

    0 讨论(0)
提交回复
热议问题