shadowMap.fragment.fx 729 B

1234567891011121314151617181920212223242526272829
  1. #include<shadowMapFragmentDeclaration>
  2. #ifdef ALPHATEST
  3. varying vec2 vUV;
  4. uniform sampler2D diffuseSampler;
  5. #endif
  6. #include<clipPlaneFragmentDeclaration>
  7. void main(void)
  8. {
  9. #include<clipPlaneFragment>
  10. #ifdef ALPHATEST
  11. float alphaFromAlphaTexture = texture2D(diffuseSampler, vUV).a;
  12. if (alphaFromAlphaTexture < 0.4)
  13. discard;
  14. #endif
  15. #if SM_SOFTTRANSPARENTSHADOW == 1
  16. #ifdef ALPHATEST
  17. if ((bayerDither8(floor(mod(gl_FragCoord.xy, 8.0)))) / 64.0 >= softTransparentShadowSM * alphaFromAlphaTexture) discard;
  18. #else
  19. if ((bayerDither8(floor(mod(gl_FragCoord.xy, 8.0)))) / 64.0 >= softTransparentShadowSM) discard;
  20. #endif
  21. #endif
  22. #include<shadowMapFragment>
  23. }