Created
October 4, 2014 13:31
-
-
Save shallaa/e1516495cb2050651b9b to your computer and use it in GitHub Desktop.
vertex shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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