mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
fix
This commit is contained in:
parent
3225393636
commit
3e98b2c158
1 changed files with 5 additions and 1 deletions
|
|
@ -358,7 +358,11 @@ void WorldRenderer::generateShadowsMap(
|
|||
float shadowMapSize = resolution * shadowMapScale;
|
||||
|
||||
glm::vec3 basePos = glm::floor(camera.position / 4.0f) * 4.0f;
|
||||
shadowCamera = Camera(basePos, shadowMapSize);
|
||||
glm::vec3 prevPos = shadowCamera.position;
|
||||
shadowCamera = Camera(
|
||||
glm::distance2(prevPos, basePos) > 25.0f ? basePos : prevPos,
|
||||
shadowMapSize
|
||||
);
|
||||
shadowCamera.near = 0.1f;
|
||||
shadowCamera.far = 1000.0f;
|
||||
shadowCamera.perspective = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue