shadowOnly.vertex.fx 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. vec4 worldPos = finalWorld * vec4(position, 1.0);
  30. gl_Position = viewProjection * worldPos;
  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. }