Since GLES2.0 don't have geometry shaders, i want to simulate one using just vertex shaders. My idea goes like this: I have: x, y, z, size variables and send one each vertex, then save them somewhere. After the 6th vertex, i use the last 6 values (x, y, z, size and two more if i need) to build the next 6 vertices out of them. For instance:
- On the first call of the vertex shader, i save the x variable somewhere, and return gl_Position = (0,0,0), gl_Color = (0,0,0,0), etc...
- On the second call, i save the y variable somewhere, and then trash the vertex in the same way as above. I then repeat this until the 6th vertex.
- On the 6th vertex, i pull the x, y, z and size variables from somewhere and then build the upper left vertex of a square using them. (gl_Position = (x-size/2, y-size/2, 0)... etc..
The problem is, i don't know what is this 'somewhere'. I have no idea how to save a variable in a vertex shader call, to the use it in the next call.
TLDL: I want to make 10400 triangles out of 5200 * (x, y, z, square_size) on GLES2.0 in a single draw call, have an idea on how to do, but don't know how to implement it