1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Adjust shadowmap distortion to use entire SM texture (#12166)

This commit is contained in:
x2048 2022-04-07 22:13:50 +02:00 committed by GitHub
parent 0b5b2b2633
commit 48f7c5603e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 159 additions and 115 deletions

View file

@ -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);
}