OpenGL: Single vertex attribute for multiple vertices?
问题 I have a vertex shader that accepts the following attributes: a_posCoord : vertex position a_texCoord : texture coordinate (passed to the fragment shader) a_alpha : transparency factor (passed to the fragment shader) The objects I'm rendering are all "billboards" (a pair of right triangles to make a rectangle). I'm using a single call to glDrawArrays to render many billboards, each which may have a unique alpha value. A single billboard has 6 vertices. Here's some pseudocode to illustrate how