Single light textureless phong shading complete.

This commit is contained in:
2014-05-08 16:22:11 -04:30
parent 51183a2cf1
commit caa0631004
2 changed files with 58 additions and 2 deletions

View File

@@ -1,16 +1,31 @@
// Model-view matrix.
uniform mat4 u_projTrans;
// Normal matrix.
uniform mat4 u_normalMat;
// Vertex position in world coordinates.
attribute vec4 a_position;
// Vertex normal.
attribute vec4 a_normal;
// Vertex color.
attribute vec4 a_color;
// Vertex position to pass to the fragment shader.
varying vec4 v_position;
// Vertex normal to pass to the fragment shader.
varying vec3 v_normal;
// Vertex color to pass to the fragment shader.
varying vec4 v_color;
void main(){
v_position = u_projTrans * a_position;
v_color = a_color;
gl_Position = u_projTrans * a_position;
v_normal = vec3(u_normalMat * a_normal);
gl_Position = v_position;
}