OpenGL: Single vertex attribute for multiple vertices?

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

    If some vertex attribute is constant for each vertex, why don't you use an uniform variable? If it is constant, it is uniform! By this way you set the uniform value only once and your data set is reduced.

提交回复
热议问题