OpenGL: Single vertex attribute for multiple vertices?

前端 未结 5 2269
生来不讨喜
生来不讨喜 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:10

    A couple ideas:

    1.) Bite the bullet and update the vertex buffer but only when alphas change.

    2.) Break the list of quads into batches and only rebuild batches that change..

    3.) Control the number of billboards and bind an array of alpha values to a uniform... In the alpha of the vertex data, or in some unused channel/additional channel, store the index of the alpha for that billboard, in your uniform array. at least that way you're potentially only uploading n alpha values.

    4.) combine 2 and 3...

    I am only taking a wild guess... I'd like to see if anyone else has good solutions!

提交回复
热议问题