Skip to content

Fix full-screen blue tint when staring at a secret's highlight box - #39

Open
kovalancik06-max wants to merge 1 commit into
Quantizr:3.xfrom
kovalancik06-max:fix/secret-render-blue-screen
Open

Fix full-screen blue tint when staring at a secret's highlight box#39
kovalancik06-max wants to merge 1 commit into
Quantizr:3.xfrom
kovalancik06-max:fix/secret-render-blue-screen

Conversation

@kovalancik06-max

Copy link
Copy Markdown

Summary

  • Fixes the whole screen becomes tinted blue when staring at a secret #24 — the screen shines/tints (e.g. blue for chest secrets, whose highlight color is Color(2, 213, 250)) when looking directly at a nearby secret waypoint, but is fine looking away.
  • Root cause: Waypoints.onWorldRender disables both depth testing and face culling before calling WaypointUtils.drawFilledBoundingBox(...) for the secret's highlight box. With culling off, every face of the box is rasterized, including the ones facing into the box; with depth testing also off, nothing hides them. When the camera is inside or right up against the box (exactly what "staring at" a nearby secret means positionally), those inward-facing walls end up covering the whole viewport in the secret's translucent color.
  • The box's vertices are already wound so each face's outward normal is correct (verified the bottom face's winding by hand: (maxX-minX,0,0) × (0,0,maxZ-minZ) = (0, -dx*dz, 0), i.e. normal points outward/down as expected) — so standard backface culling was never the problem, it was just switched off for this draw call along with the (deliberately double-sided) beacon beam.

Fix

  • Move GlStateManager.disableCull() to after the filled-box draw call, so the box renders with the default (enabled) culling state. This hides the inward-facing walls when the camera is inside/near the box, exactly like a normal "outline" highlight, while the beacon beam right below keeps its own disableCull() since it's meant to be visible from both sides.

Test plan

  • Verified the box's face winding produces outward-facing normals, so enabling culling doesn't accidentally hide the box from legitimate outside viewing angles.
  • Change is scoped to moving one existing statement a few lines down — no new state, no behavior change for the beacon beam or any other code path.
  • Not able to run a full ForgeGradle 1.8.9 build or reproduce the exact camera angle in a live Hypixel dungeon in this environment, so please confirm visually before merging — happy to adjust if there's a specific secret type/orientation where this doesn't fully resolve it.

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 Quantizr#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

the whole screen becomes tinted blue when staring at a secret

1 participant