attribute vec4 vertexPosition; attribute vec2 vertexUV; uniform mat4 matWorldViewProjection; varying vec2 outTexCoord; void main() { outTexCoord = vertexUV; gl_Position = matWorldViewProjection * vertexPosition; }
struct Vertex { Vector4 Position; Vector2 TexCoords; };
attribute vec4 vertexPosition; attribute vec2 vertexUV;
GLint handleVertexPos = glGetAttribLocation( myShaderProgram, "vertexPosition" ); glVertexAttribPointer( handleVertexPos, 4, GL_FLOAT, GL_FALSE, 0, 0 ); GLint handleVertexUV = glGetAttribLocation( myShaderProgram, "vertexUV" ); glVertexAttribPointer( handleVertexUV, 2, GL_FLOAT, GL_FALSE, 0, 0 );
layout(location = 0) in vec4 vertexPosition; layout(location = 1) in vec2 vertexUV;
#version 300 es
#version 300 es layout(location = 0) in vec4 vertexPosition; layout(location = 1) in vec2 vertexUV; uniform mat4 matWorldViewProjection; out vec2 outTexCoord; void main() { outTexCoord = vertexUV; gl_Position = matWorldViewProjection * vertexPosition; }
const int ATTRIB_POS = 0; const int ATTRIB_UV = 1; glVertexAttribPointer( ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, 0, 0 ); glVertexAttribPointer( ATTRIB_UV, 2, GL_FLOAT, GL_FALSE, 0, 0 );