Limit shadow map to the viewing range (#12158)

master
x2048 2022-03-31 22:40:59 +02:00 committed by GitHub
parent 31578303a4
commit 3dd7d7867b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -93,6 +93,8 @@ 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);
///////////////////////////////////
// update splits near and fars