More awesome shadows

This commit is contained in:
2014-03-13 18:23:56 +01:00
parent 235e9648ad
commit 47f7759566
2 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -51,9 +51,9 @@ void main() {
//bias = clamp(bias, 0.0, 0.01);
float visibility = 1.0;
if (Input.ShadowCoord.x >= 0.0 && Input.ShadowCoord.x <= 1.0 && Input.ShadowCoord.y >= 0.0 && Input.ShadowCoord.y <= 1.0) {
float bias = 0.003;
float bias = 0.0005;
vec4 shadowMapValue = texture(shadowMap, Input.ShadowCoord.xy);
if (shadowMapValue.z < Input.ShadowCoord.z - bias) {
if (shadowMapValue.z < clamp(Input.ShadowCoord.z - bias, 0, 1)) {
visibility = 0.5;
}
}