OpenGL: Single vertex attribute for multiple vertices?

前端 未结 5 2261
生来不讨喜
生来不讨喜 2021-02-13 12:42

I have a vertex shader that accepts the following attributes:

  • a_posCoord: vertex position
  • a_texCoord: texture coordinate (passed
5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-13 13:27

    I haven't looked into this in detail but I think you could possibly also use glDrawElementsInstanced. With this you would put your alpha values into a big uniform array and the instance index would somehow be passed to the shader. Check this out:

    http://sol.gfxile.net/instancing.html

提交回复
热议问题