pass2_fragment.glsl 892 B

1234567891011121314151617181920212223
  1. uniform sampler2D ShadowMapClientMap;
  2. #ifdef COLORED_SHADOWS
  3. uniform sampler2D ShadowMapClientMapTraslucent;
  4. #endif
  5. uniform sampler2D ShadowMapSamplerdynamic;
  6. void main() {
  7. #ifdef COLORED_SHADOWS
  8. vec2 first_depth = texture2D(ShadowMapClientMap, gl_TexCoord[0].st).rg;
  9. vec2 depth_splitdynamics = vec2(texture2D(ShadowMapSamplerdynamic, gl_TexCoord[2].st).r, 0.0);
  10. if (first_depth.r > depth_splitdynamics.r)
  11. first_depth = depth_splitdynamics;
  12. vec2 depth_color = texture2D(ShadowMapClientMapTraslucent, gl_TexCoord[1].st).rg;
  13. gl_FragColor = vec4(first_depth.r, first_depth.g, depth_color.r, depth_color.g);
  14. #else
  15. float first_depth = texture2D(ShadowMapClientMap, gl_TexCoord[0].st).r;
  16. float depth_splitdynamics = texture2D(ShadowMapSamplerdynamic, gl_TexCoord[2].st).r;
  17. first_depth = min(first_depth, depth_splitdynamics);
  18. gl_FragColor = vec4(first_depth, 0.0, 0.0, 1.0);
  19. #endif
  20. }