ShadowVertShader.vsh 675 B

12345678910111213141516171819202122232425
  1. attribute highp vec3 inVertex;
  2. attribute highp vec3 inNormal;
  3. attribute mediump vec2 inTexCoord;
  4. uniform highp mat4 TexProjectionMatrix;
  5. uniform highp mat4 ProjectionMatrix;
  6. uniform highp mat4 ModelViewMatrix;
  7. uniform highp vec3 LightDirection;
  8. varying highp vec4 projCoord;
  9. varying mediump vec2 texCoord;
  10. varying lowp vec3 LightIntensity;
  11. void main()
  12. {
  13. highp vec4 modelViewPos = ModelViewMatrix * vec4(inVertex, 1.0);
  14. gl_Position = ProjectionMatrix * modelViewPos;
  15. projCoord = TexProjectionMatrix * modelViewPos;
  16. texCoord = inTexCoord;
  17. // Simple diffuse lighting in model space
  18. LightIntensity = vec3(dot(inNormal, -LightDirection));
  19. }