Skip to content

Instantly share code, notes, and snippets.

@x2048
Created April 2, 2022 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x2048/0ec1912f03a2c13553d8513e357a0091 to your computer and use it in GitHub Desktop.
Save x2048/0ec1912f03a2c13553d8513e357a0091 to your computer and use it in GitHub Desktop.
Increase shadow range
diff --git a/src/client/shadows/dynamicshadows.cpp b/src/client/shadows/dynamicshadows.cpp
index 2995ec205..ddec3a5d5 100644
--- a/src/client/shadows/dynamicshadows.cpp
+++ b/src/client/shadows/dynamicshadows.cpp
@@ -94,7 +94,7 @@ void DirectionalLight::update_frustum(const Camera *cam, Client *client, bool fo
float zNear = cam->getCameraNode()->getNearValue();
float zFar = getMaxFarValue();
if (!client->getEnv().getClientMap().getControl().range_all)
- zFar = MYMIN(zFar, client->getEnv().getClientMap().getControl().wanted_range * BS);
+ zFar = MYMIN(zFar, client->getEnv().getClientMap().getControl().wanted_range * BS * 1.5);
///////////////////////////////////
// update splits near and fars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment