Fix shadowmap clamp

This commit is contained in:
Lubos Lenco 2017-08-21 12:16:12 +02:00
parent 6984325499
commit 58b1c65a95
2 changed files with 2 additions and 19 deletions

View file

@ -91,15 +91,8 @@ out vec4 fragColor;
#ifndef _NoShadows
float shadowTest(const vec3 lPos) {
#ifdef _Clampstc
// Filtering out of bounds, remove
// const vec2 border = vec2(1.0 / shadowmapSize[0], 1.0 / shadowmapSize[1]) * 2.0;
// lPos.xy = clamp(lPos.xy, border[0], 1.0 - border[1]);
if (lPos.x < 0.0) return 1.0;
if (lPos.y < 0.0) return 1.0;
if (lPos.x > 1.0) return 1.0;
if (lPos.y > 1.0) return 1.0;
#endif
// Out of bounds
if (lPos.x < 0.0 || lPos.y < 0.0 || lPos.x > 1.0 || lPos.y > 1.0) return 1.0;
#ifdef _PCSS
return PCSS(lPos.xy, lPos.z - shadowsBias);

View file

@ -56,16 +56,6 @@ out vec4 fragColor;
#ifndef _NoShadows
float shadowTest(const vec3 lPos) {
#ifdef _Clampstc
// Filtering out of bounds, remove
// const vec2 border = vec2(1.0 / shadowmapSize[0], 1.0 / shadowmapSize[1]) * 2.0;
// lPos.xy = clamp(lPos.xy, border[0], 1.0 - border[1]);
if (lPos.x < 0.0) return 1.0;
if (lPos.y < 0.0) return 1.0;
if (lPos.x > 1.0) return 1.0;
if (lPos.y > 1.0) return 1.0;
#endif
#ifdef _PCSS
return PCSS(lPos.xy, lPos.z - shadowsBias);