PDA

View Full Version : Alternative for gl_ModelViewProjectionMatrix * gl_Vertex in GLES



hamdi.rakkez
10-19-2015, 06:59 AM
Hi,

I want to know an alternative for this in GLES


gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

Thank you.

GClements
10-19-2015, 08:41 AM
I want to know an alternative for this in GLES

gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

Replace gl_ModelViewProjectionMatrix with a user-defined uniform variable, and replace gl_Vertex with a user-defined attribute.

The matrix' value needs to be set using glUniformMatrix4fv(), while the attribute values are supplied using glVertexAttribPointer() rather than glVertexPointer() (if the client code is using glBegin/glEnd, you'll need to convert it to use vertex arrays).