Skip to content

Commit

Permalink
Don't break at shadow distance 0
Browse files Browse the repository at this point in the history
Co-Authored-By: IMS <[email protected]>
  • Loading branch information
Asek3 and IMS212 committed Nov 21, 2023
1 parent 15f3255 commit 0327654
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/net/coderbot/iris/pipeline/ShadowRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ private void renderBlockEntities(MultiBufferSource.BufferSource bufferSource, Po
}

public void renderShadows(LevelRendererAccessor levelRenderer, Camera playerCamera) {
if (IrisVideoSettings.getOverriddenShadowDistance(IrisVideoSettings.shadowDistance) == 0) {
return;
}

// We have to re-query this each frame since this changes based on whether the profiler is active
// If the profiler is inactive, it will return InactiveProfiler.INSTANCE
this.profiler = Minecraft.getInstance().getProfiler();
Expand Down Expand Up @@ -627,6 +631,11 @@ public void renderShadows(LevelRendererAccessor levelRenderer, Camera playerCame
}

public void addDebugText(List<String> messages) {
if (IrisVideoSettings.getOverriddenShadowDistance(IrisVideoSettings.shadowDistance) == 0) {
messages.add("[" + Iris.MODNAME + "] Shadow Maps: off, shadow distance 0");
return;
}

messages.add("[" + Iris.MODNAME + "] Shadow Maps: " + debugStringOverall);
messages.add("[" + Iris.MODNAME + "] Shadow Distance Terrain: " + terrainFrustumHolder.getDistanceInfo() + " Entity: " + entityFrustumHolder.getDistanceInfo());
messages.add("[" + Iris.MODNAME + "] Shadow Culling Terrain: " + terrainFrustumHolder.getCullingInfo() + " Entity: " + entityFrustumHolder.getCullingInfo());
Expand Down

0 comments on commit 0327654

Please sign in to comment.