Fix full-screen blue tint when staring at a secret's highlight box - #39
Open
kovalancik06-max wants to merge 1 commit into
Open
Fix full-screen blue tint when staring at a secret's highlight box#39kovalancik06-max wants to merge 1 commit into
kovalancik06-max wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Color(2, 213, 250)) when looking directly at a nearby secret waypoint, but is fine looking away.Waypoints.onWorldRenderdisables both depth testing and face culling before callingWaypointUtils.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.(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
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 owndisableCull()since it's meant to be visible from both sides.Test plan