shadowOnly.vertex.fx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. precision highp float;
  2. // Attributes
  3. attribute vec3 position;
  4. #ifdef NORMAL
  5. attribute vec3 normal;
  6. #endif
  7. #include<bonesDeclaration>
  8. // Uniforms
  9. #include<instancesDeclaration>
  10. uniform mat4 view;
  11. uniform mat4 viewProjection;
  12. #ifdef POINTSIZE
  13. uniform float pointSize;
  14. #endif
  15. // Output
  16. varying vec3 vPositionW;
  17. #ifdef NORMAL
  18. varying vec3 vNormalW;
  19. #endif
  20. #ifdef VERTEXCOLOR
  21. varying vec4 vColor;
  22. #endif
  23. #include<clipPlaneVertexDeclaration>
  24. #include<fogVertexDeclaration>
  25. #include<__decl__lightFragment>[0..maxSimultaneousLights]
  26. void main(void) {
  27. #include<instancesVertex>
  28. #include<bonesVertex>
  29. gl_Position = viewProjection * finalWorld * vec4(position, 1.0);
  30. vec4 worldPos = finalWorld * vec4(position, 1.0);
  31. vPositionW = vec3(worldPos);
  32. #ifdef NORMAL
  33. vNormalW = normalize(vec3(finalWorld * vec4(normal, 0.0)));
  34. #endif
  35. // Clip plane
  36. #include<clipPlaneVertex>
  37. // Fog
  38. #include<fogVertex>
  39. #include<shadowsVertex>[0..maxSimultaneousLights]
  40. // Point size
  41. #ifdef POINTSIZE
  42. gl_PointSize = pointSize;
  43. #endif
  44. }