Skip to content

Commit

Permalink
don't force terrain update every frame in shadow pass
Browse files Browse the repository at this point in the history
  • Loading branch information
douira committed Nov 24, 2024
1 parent 267cca9 commit 6628324
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,7 @@ public void renderShadows(LevelRendererAccessor levelRenderer, Camera playerCame
boolean wasChunkCullingEnabled = client.smartCull;
client.smartCull = false;

// Always schedule a terrain update
// TODO: Only schedule a terrain update if the sun / moon is moving, or the shadow map camera moved.
// We have to ensure that we don't regenerate clouds every frame, since that's what needsUpdate ends up doing.
// This took up to 10% of the frame time before we applied this fix! That's really bad!

// TODO IMS 24w35a determine clouds
((LevelRenderer) levelRenderer).needsUpdate();
// forcing a terrain update it not necessary here, sodium figured it out on its own

// Execute the vanilla terrain setup / culling routines using our shadow frustum.
levelRenderer.invokeSetupRender(playerCamera, terrainFrustumHolder.getFrustum(), false, false);
Expand Down

0 comments on commit 6628324

Please sign in to comment.