double-hit-balls/assets/phong_vertex.txt

25 lines
516 B
Plaintext
Raw Permalink Normal View History

2018-01-21 21:05:15 +00:00
attribute vec3 vPosition;
attribute vec3 vNormal;
attribute vec2 vTexCoord;
varying vec3 position;
varying vec3 normal;
varying vec2 texCoord;
uniform mat4 ProjectionMatrix1;
uniform mat4 ModelViewMatrix;
void main()
{
mat4 mvp = ProjectionMatrix1 * ModelViewMatrix;
vec4 tnorm = ModelViewMatrix * vec4(vNormal,0.0);
normal = normalize(vec3(tnorm));
position = vec3( ModelViewMatrix * vec4(vPosition,1.0) );
gl_Position = mvp * vec4(vPosition,1.0);
texCoord = vTexCoord;
}