Is it possible for a vertex attribute to be an array in GLSL-ES 2.0?

后端 未结 1 1407
陌清茗
陌清茗 2021-01-05 00:28

In GLSL-ES it\'s possible to have arrays. For example, the GLSL ES Specification gives the following example of a uniform variable that\'s an array:

uniform          


        
相关标签:
1条回答
  • 2021-01-05 01:07

    The GLSL ES 2.0 specification states that attributes cannot be declared as arrays.

    In desktop GL, you can have attribute arrays. When the attribute is assigned an attribute index (either with glBindAttribLocation or automatically by the shader being linked), it will get consecutive attributes, starting with the one you requested if you used glBindAttribLocation. So if foo was given the location 5, foo[0] would be 5, foo[1] would be 6, and foo[2] would be 7.

    If there is some ES 2.0 extension to allow attribute arrays, it would likely work like this.

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