Here's what I want my vertex attribute buffer to look like, in the interest of reducing the size of the buffer: vertexAttributes = [įor what it's worth, my current solution works just fine, but makes me feel dirty. Is there a way I can specify an attribute for all 6 vertices without repeating it for each individual vertex? Notice how the same alpha value is repeated 6 times, once for each vertex. Here's some pseudocode to illustrate how I organize the vertex attribute buffer for a single billboard: vertexAttributes = [ I'm using a single call to glDrawArrays to render many billboards, each which may have a unique alpha value. The objects I'm rendering are all "billboards" (a pair of right triangles to make a rectangle). a_alpha: transparency factor (passed to the fragment shader).a_texCoord: texture coordinate (passed to the fragment shader).I have a vertex shader that accepts the following attributes:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |