Skip to content

Conversation

LeandroVandari
Copy link
Contributor

Objective

Fixes #21489 #21479;
Undoes #20890

Solution

PR #20890 causes the issues in #21489 and #21479, where grid gizmos display incorrectly. Undoing it removes those issues.

Testing

Ran the examples from #21489 and #21479.

NOTE:

Tried to run CI tests but my computer didn't have space 😅 would appreciate checks that I didn't break anything

Also, I'm not very familiar with the Bevy codebase, so i don't really understand why these problems existed, or why #20890 caused them, but I would appreciate an explanation :)

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen A-Gizmos Visual editor and debug gizmos labels Oct 11, 2025
@alice-i-cecile alice-i-cecile added this to the 0.17.3 milestone Oct 11, 2025
@alice-i-cecile alice-i-cecile added the S-Needs-Design This issue requires design work to think about how it would best be accomplished label Oct 11, 2025
@atlv24
Copy link
Contributor

atlv24 commented Oct 11, 2025

Reverting this will reintroduce the bug it was fixing

@alice-i-cecile
Copy link
Member

Yeah, ideally we can fix the original bug and not regress this.

@atlv24
Copy link
Contributor

atlv24 commented Oct 11, 2025

I think i know how this has to be fixed.

@atlv24
Copy link
Contributor

atlv24 commented Oct 11, 2025

#21503

github-merge-queue bot pushed a commit that referenced this pull request Oct 13, 2025
# Objective

- alternative to #21502
- also undoes #20890
- does not regress #19205
- fixes #21489 and #21479

## Solution

the fix i originally made was wrong. the reason it worked was because it
failed the conditional and did not clip the lines in some cases where
the original bug was exhibited. the condition was correct before, it
turns out, but the clipping logic is wrong: an epsilon is added, with a
comment saying it is to avoid falsely culling the vertex due to floating
point imprecision leaving it just barely in front of the near plane.
However, i do not see why an epsilon should be needed here, or why this
should be avoided: triangle primitives are regularly intersecting the
clipping plane, that is standard order of business. The entire primitive
is not discarded if only part of it is clipped, instead only the visible
pixels are rasterized.

## Testing

- original bug test case by Antony looks right
- both grid test cases look right
- gizmos examples look right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Gizmos Visual editor and debug gizmos A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Needs-Design This issue requires design work to think about how it would best be accomplished

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Gizmo lines culled incorrectly in 3D with depth_bias -1

3 participants