diff options
author | x2048 <codeforsmile@gmail.com> | 2022-04-07 22:13:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 22:13:50 +0200 |
commit | 48f7c5603e5b2dfca941d228e76e452bc269a1fa (patch) | |
tree | 7983bb05e762792e38ba22a59e8718cac5381747 /src/client/shadows/shadowsshadercallbacks.cpp | |
parent | 0b5b2b2633609f646a534d353a2c587af4be46fa (diff) | |
download | minetest-48f7c5603e5b2dfca941d228e76e452bc269a1fa.tar.gz minetest-48f7c5603e5b2dfca941d228e76e452bc269a1fa.tar.bz2 minetest-48f7c5603e5b2dfca941d228e76e452bc269a1fa.zip |
Adjust shadowmap distortion to use entire SM texture (#12166)
Diffstat (limited to 'src/client/shadows/shadowsshadercallbacks.cpp')
-rw-r--r-- | src/client/shadows/shadowsshadercallbacks.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/shadows/shadowsshadercallbacks.cpp b/src/client/shadows/shadowsshadercallbacks.cpp index 51ea8aa93..b571ea939 100644 --- a/src/client/shadows/shadowsshadercallbacks.cpp +++ b/src/client/shadows/shadowsshadercallbacks.cpp @@ -26,6 +26,10 @@ void ShadowDepthShaderCB::OnSetConstants( core::matrix4 lightMVP = driver->getTransform(video::ETS_PROJECTION); lightMVP *= driver->getTransform(video::ETS_VIEW); + + f32 cam_pos[4]; + lightMVP.transformVect(cam_pos, CameraPos); + lightMVP *= driver->getTransform(video::ETS_WORLD); m_light_mvp_setting.set(lightMVP.pointer(), services); @@ -39,4 +43,6 @@ void ShadowDepthShaderCB::OnSetConstants( m_perspective_bias1.set(&bias1, services); f32 zbias = PerspectiveBiasZ; m_perspective_zbias.set(&zbias, services); + + m_cam_pos_setting.set(cam_pos, services); } |