Broken shadow map.

This commit is contained in:
2014-04-05 02:56:42 +02:00
parent a774d0ca07
commit e2d8235169
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -15,9 +15,9 @@ Renderer::Renderer()
#endif
m_ShadowMapRes = 2048;
m_SunPosition = glm::vec3(0, 1.5f, 10);
m_SunPosition = glm::vec3(0, 3.5f, 10);
m_SunTarget = glm::vec3(0, 0, 0);
m_SunProjection = glm::ortho<float>(-200, 200, -100, 400, -800, 600);
m_SunProjection = glm::ortho<float>(-100, 100, -100, 100, -100, 100);
Lights = 0;
}
@@ -171,7 +171,7 @@ void Renderer::Draw(double dt)
}
}
//DrawDebugShadowMap();
DrawDebugShadowMap();
#endif
ClearStuff();
+1 -1
View File
@@ -51,7 +51,7 @@ 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.0005;
float bias = 0.00005;
vec4 shadowMapValue = texture(shadowMap, Input.ShadowCoord.xy);
if (shadowMapValue.z < clamp(Input.ShadowCoord.z - bias, 0, 1)) {
visibility = 0.3;