From 2b54d627c0662ce0a1a0ba91386e95c8f02f54e5 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 27 May 2014 14:25:27 -0700 Subject: [PATCH] Try rounding to nearest texel unit to reduce shimmer. --- interface/src/Application.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5b43159122..32fa50e710 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -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);