Two things I'm quite confused about.
1) OpenGL ES 2.0 creates primitives before the vertex shader is invoked. Why, then, does it not automatically provide the vertex shader the position of the vertex?
2) OpenGL ES 2.0 supports glDrawElements()
, but it does not support glEnableClientState()
or GL_VERTEX_ARRAY
, so how can this call possibly be used to construct primitives?
NOTE: this is OpenGL ES 2.0, NOT normal OpenGL!
Thanks!
Resolution:
I think my confusion was stemming from the built in variable gl_Vertex that some versions of GLSL support (according to some sources, I couldn't find this in the official documentation at http://www.opengl.org/sdk/docs/manglsl/) which gives you the position of the vector provided to the draw command. This isn't present in GL ES. Further, my code was't working, and as GLSL can be difficult to debug, I had no idea what was going on :)
In this case, using vertex attributes and passing the model-space location of the vertices and my transformation matrix allows me to transform the vertices correctly.
glDrawElements
to work? I'm running into this problem right now trying to get it to work. \$\endgroup\$