1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

Improve shadow rendering with non-default camera FOV (#11385)

* Adjust minimum filter radius for perspective

* Expand shadow frustum when camera FOV changes, reuse FOV distance adjustment from numeric.cpp

* Read shadow_soft_radius setting as float

* Use adaptive filter radius to accomodate for PSM distortion

* Adjust filter radius for texture resolution
This commit is contained in:
x2048
2021-07-11 17:15:19 +02:00
committed by GitHub
parent 1d25d1f7ad
commit f5706d444b
4 changed files with 37 additions and 23 deletions

View File

@@ -740,7 +740,7 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
s32 shadow_filter = g_settings->getS32("shadow_filters");
shaders_header << "#define SHADOW_FILTER " << shadow_filter << "\n";
float shadow_soft_radius = g_settings->getS32("shadow_soft_radius");
float shadow_soft_radius = g_settings->getFloat("shadow_soft_radius");
if (shadow_soft_radius < 1.0f)
shadow_soft_radius = 1.0f;
shaders_header << "#define SOFTSHADOWRADIUS " << shadow_soft_radius << "\n";