Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gizmo line width issue when using perspective #9067

Merged
merged 2 commits into from
Jul 31, 2023

Conversation

IceSentry
Copy link
Contributor

Objective

  • In bevy_polyline, we discovered an issue that happens when line width is smaller than 1.0 and using perspective. It would sometimes end up negative or NaN. I'm not entirely sure why it happens.

Solution

  • Make sure the width doesn't go below 0 before multiplying it with the alpha

Notes

Here's a link to the bevy_polyline issue ForesightMiningSoftwareCorporation/bevy_polyline#46

I'm not sure if the solution is correct but it solved the issue in my testing.

@IceSentry IceSentry changed the title Fix line width issue when using perspective Fix gizmo line width issue when using perspective Jul 7, 2023
@IceSentry IceSentry added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen A-Gizmos Visual editor and debug gizmos labels Jul 7, 2023
@nicopap nicopap added this to the 0.11.1 milestone Jul 18, 2023
@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jul 31, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 31, 2023
Merged via the queue into bevyengine:main with commit 0d7e81e Jul 31, 2023
21 checks passed
cart pushed a commit that referenced this pull request Aug 10, 2023
- In bevy_polyline, we discovered an issue that happens when line width
is smaller than 1.0 and using perspective. It would sometimes end up
negative or NaN. I'm not entirely sure _why_ it happens.

- Make sure the width doesn't go below 0 before multiplying it with the
alpha

Here's a link to the bevy_polyline issue
ForesightMiningSoftwareCorporation/bevy_polyline#46

I'm not sure if the solution is correct but it solved the issue in my
testing.

Co-authored-by: François <mockersf@gmail.com>
@cart cart mentioned this pull request Oct 13, 2023
43 tasks
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-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants