Skip to content
Snippets Groups Projects
Commit 26d7b83f authored by Alexander Gauggel's avatar Alexander Gauggel
Browse files

[#82] Reduce shadow swimming on movement

parent 0a9a1156
No related branches found
No related tags found
1 merge request!70Resolve "Voxel cone tracing"
Pipeline #26012 passed
......@@ -115,6 +115,10 @@ glm::mat4 computeShadowViewProjectionMatrix(
getMinMaxView(voxelVolumeCorners);
glm::vec3 scale = glm::vec3(2) / (maxView - minView);
// rotationaly invariant to avoid swimming when moving camera
scale = glm::vec3(glm::max(glm::max(scale.x, scale.y), scale.z));
glm::vec3 offset = -0.5f * (maxView + minView) * scale;
glm::mat4 crop(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment