Try rounding to nearest texel unit to reduce shimmer.

This commit is contained in:
Andrzej Kapolka 2014-05-27 14:25:27 -07:00
parent 3f478b1939
commit 2b54d627c0

View file

@ -2291,6 +2291,11 @@ void Application::updateShadowMap() {
radius = qMax(radius, glm::distance(points[i], center));
}
center = inverseRotation * center;
// to reduce texture "shimmer," move in texel increments
float texelSize = (2.0f * radius) / fbo->width();
center = glm::round(center / texelSize) * texelSize;
glm::vec3 minima(center.x - radius, center.y - radius, center.z - radius);
glm::vec3 maxima(center.x + radius, center.y + radius, center.z + radius);