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

Tune shadow perspective distortion (#12146)

* Pass perspective distortion parameters as uniforms
* Set all perspective bias parameters via ShadowRenderer
* Recalibrate perspective distortion and shadow range to render less shadow geometry with the same quality and observed shadow distance
This commit is contained in:
x2048 2022-03-31 22:40:06 +02:00 committed by GitHub
parent 06d197cdd0
commit 31578303a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 117 additions and 59 deletions

View file

@ -33,4 +33,10 @@ void ShadowDepthShaderCB::OnSetConstants(
m_max_far_setting.set(&MaxFar, services);
s32 TextureId = 0;
m_color_map_sampler_setting.set(&TextureId, services);
f32 bias0 = PerspectiveBiasXY;
m_perspective_bias0.set(&bias0, services);
f32 bias1 = 1.0f - bias0 + 1e-5f;
m_perspective_bias1.set(&bias1, services);
f32 zbias = PerspectiveBiasZ;
m_perspective_zbias.set(&zbias, services);
}