12345678910111213141516171819202122232425 |
- attribute highp vec3 inVertex;
- attribute highp vec3 inNormal;
- attribute mediump vec2 inTexCoord;
- uniform highp mat4 TexProjectionMatrix;
- uniform highp mat4 ProjectionMatrix;
- uniform highp mat4 ModelViewMatrix;
- uniform highp vec3 LightDirection;
- varying highp vec4 projCoord;
- varying mediump vec2 texCoord;
- varying lowp vec3 LightIntensity;
- void main()
- {
- highp vec4 modelViewPos = ModelViewMatrix * vec4(inVertex, 1.0);
- gl_Position = ProjectionMatrix * modelViewPos;
- projCoord = TexProjectionMatrix * modelViewPos;
- texCoord = inTexCoord;
-
- // Simple diffuse lighting in model space
- LightIntensity = vec3(dot(inNormal, -LightDirection));
- }
|