Skip to content

Instantly share code, notes, and snippets.

@shallaa
Created October 4, 2014 13:31
Show Gist options
  • Save shallaa/e1516495cb2050651b9b to your computer and use it in GitHub Desktop.
Save shallaa/e1516495cb2050651b9b to your computer and use it in GitHub Desktop.
vertex shader
attribute vec3 aVertexPosition;
attribute vec3 aVertexNormal;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
uniform mat3 uNMatrix;
varying vec3 vNormal;
varying vec3 vEyeVec;
void main(void) {
vec4 vertex = uMVMatrix * vec4(aVertexPosition, 1.0);
vNormal = uNMatrix * aVertexNormal;
vEyeVec = -vec3(vertex.xyz);
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment