From 43ccc5e3c2eab8dbf237831ec5262f8db592b1fb Mon Sep 17 00:00:00 2001 From: Jaroslav Date: Thu, 20 Aug 2026 12:50:58 +0200 Subject: [PATCH] Fix full-screen blue tint when staring at a secret's highlight box The filled bounding box around each secret is drawn with face culling disabled, alongside the (deliberately double-sided) beacon beam. With culling off and depth testing also off, every inward- facing wall of the translucent box gets rasterized with nothing to occlude it. When the camera is inside or right up against the box (i.e. staring at a nearby secret, as in #24), those inward faces fill the whole viewport with the secret's color. Move the disableCull() call to after the box is drawn so it keeps the default (enabled) culling state - the box's vertex winding already faces outward correctly, so this only hides the faces on the side facing away from the viewer, exactly as intended for an outline-style highlight. The beacon beam right below still gets its own disableCull(), since it needs to render from both sides. --- .../dungeonrooms/dungeons/catacombs/Waypoints.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/quantizr/dungeonrooms/dungeons/catacombs/Waypoints.java b/src/main/java/io/github/quantizr/dungeonrooms/dungeons/catacombs/Waypoints.java index 63f7053..0a5a157 100644 --- a/src/main/java/io/github/quantizr/dungeonrooms/dungeons/catacombs/Waypoints.java +++ b/src/main/java/io/github/quantizr/dungeonrooms/dungeons/catacombs/Waypoints.java @@ -164,10 +164,15 @@ public void onWorldRender(RenderWorldLastEvent event) { double distSq = x*x + y*y + z*z; GlStateManager.disableDepth(); - GlStateManager.disableCull(); + // Keep face culling enabled for the filled box: with it disabled, staring at (or + // standing inside) a secret's box renders every inward-facing wall with no depth + // test to hide them, tinting the whole screen with the secret's color (#24). + // Culling is still disabled below for the beacon beam, which needs to be visible + // from both sides. if (showBoundingBox && frustum.isBoxInFrustum(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1)) { WaypointUtils.drawFilledBoundingBox(new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1), color, 0.4f); } + GlStateManager.disableCull(); GlStateManager.disableTexture2D(); if (showBeacon && distSq > 5*5) WaypointUtils.renderBeaconBeam(x, y + 1, z, color.getRGB(), 0.25f, event.partialTicks); if (showWaypointText) WaypointUtils.renderWaypointText(secretsObject.get("secretName").getAsString(), pos.up(2), event.partialTicks);