diff options
author | lhofhansl <larsh@apache.org> | 2021-10-05 12:54:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 21:54:01 +0200 |
commit | b4b9bee5f2a903f1677f12d71ebb644052877381 (patch) | |
tree | 163b7f09daceb6d24ae7ebb415ac87f972796939 /src/client/shadows/dynamicshadows.cpp | |
parent | bc71622d2121347ad6dbbe3c174ad485fe1a8f8c (diff) | |
download | minetest-b4b9bee5f2a903f1677f12d71ebb644052877381.tar.gz minetest-b4b9bee5f2a903f1677f12d71ebb644052877381.tar.bz2 minetest-b4b9bee5f2a903f1677f12d71ebb644052877381.zip |
Reduce shadow jitter (#11668)
Diffstat (limited to 'src/client/shadows/dynamicshadows.cpp')
-rw-r--r-- | src/client/shadows/dynamicshadows.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/client/shadows/dynamicshadows.cpp b/src/client/shadows/dynamicshadows.cpp index 0c7eea0e7..6ef5a4f1d 100644 --- a/src/client/shadows/dynamicshadows.cpp +++ b/src/client/shadows/dynamicshadows.cpp @@ -65,24 +65,7 @@ void DirectionalLight::createSplitMatrices(const Camera *cam) // boundVec.getLength(); float vvolume = radius * 2.0f; - float texelsPerUnit = getMapResolution() / vvolume; - m4f mTexelScaling; - mTexelScaling.setScale(texelsPerUnit); - - m4f mLookAt, mLookAtInv; - - mLookAt.buildCameraLookAtMatrixLH(v3f(0.0f, 0.0f, 0.0f), -direction, v3f(0.0f, 1.0f, 0.0f)); - - mLookAt *= mTexelScaling; - mLookAtInv = mLookAt; - mLookAtInv.makeInverse(); - v3f frustumCenter = newCenter; - mLookAt.transformVect(frustumCenter); - frustumCenter.X = floorf(frustumCenter.X); // clamp to texel increment - frustumCenter.Y = floorf(frustumCenter.Y); // clamp to texel increment - frustumCenter.Z = floorf(frustumCenter.Z); - mLookAtInv.transformVect(frustumCenter); // probar radius multipliacdor en funcion del I, a menor I mas multiplicador v3f eye_displacement = direction * vvolume; |