shadowOnly.fragment.fx 1003 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. precision highp float;
  2. // Constants
  3. uniform vec3 vEyePosition;
  4. uniform float alpha;
  5. // Input
  6. varying vec3 vPositionW;
  7. #ifdef NORMAL
  8. varying vec3 vNormalW;
  9. #endif
  10. // Helper functions
  11. #include<helperFunctions>
  12. // Lights
  13. #include<__decl__lightFragment>[0..maxSimultaneousLights]
  14. #include<lightsFragmentFunctions>
  15. #include<shadowsFragmentFunctions>
  16. #include<clipPlaneFragmentDeclaration>
  17. // Fog
  18. #include<fogFragmentDeclaration>
  19. void main(void) {
  20. #include<clipPlaneFragment>
  21. vec3 viewDirectionW = normalize(vEyePosition - vPositionW);
  22. // Normal
  23. #ifdef NORMAL
  24. vec3 normalW = normalize(vNormalW);
  25. #else
  26. vec3 normalW = vec3(1.0, 1.0, 1.0);
  27. #endif
  28. // Lighting
  29. vec3 diffuseBase = vec3(0., 0., 0.);
  30. lightingInfo info;
  31. float shadow = 1.;
  32. float glossiness = 0.;
  33. #include<lightFragment>[0..1]
  34. // Composition
  35. vec4 color = vec4(0., 0., 0., (1.0 - clamp(shadow, 0., 1.)) * alpha);
  36. #include<fogFragment>
  37. gl_FragColor = color;
  38. }