OpenGL: Single vertex attribute for multiple vertices?

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

    I achieve this effect with instanced rendering. glVertexAttribDivisor(1); makes openGL read vertex attribute once per instance. If your bullboards have different geometry you may consider passing you model matrix as an attribute the same way as alpha.

提交回复
热议问题