mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 14:42:50 +02:00
Try rounding to nearest texel unit to reduce shimmer.
This commit is contained in:
parent
3f478b1939
commit
2b54d627c0
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue