-
Notifications
You must be signed in to change notification settings - Fork 42
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
Lines with perspective disappear at certain camera angles #46
Comments
Yeah, this looks like culling of some kind. Have you tried adding |
|
Hm... I have a hunch that what's happening is the vertex that goes offscreen is turning into a NaN. I haven't seen this before because usually I don't have long two-vertex segments, instead they are subdivided into much more dense polylines so this issue is not visible. |
Seems like it might be something like that. It definitely seems to be happening when either of the two points goes outside the camera's frustum. Interestingly, when HDR is enabled, the lines don't disappear but take on a blueish translucent appearance. Maybe this is a clue: Untitled.video.-.Made.with.Clipchamp.mp4 |
Well this is spooky, thanks for providing more details. Could you try adding a bunch of subdivisions to your lines to see if that functions as a workaround? Oddly enough I was using the bevy 0.9 version of this today and had a similar case of a two-vertex line, but was unable to replicate this. |
@IceSentry any idea what could be causing this? You did the 0.10 migration, and you might have some insight into other bevy changes that may be causing this. |
Fixed in #47 |
# 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. Co-authored-by: François <[email protected]>
- 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 <[email protected]>
With
perspective: true
, moving the camera close to lines or in certain angles makes them disappear. I'm not exactly sure if they're being culled or if something else is going on:2023-05-04.21-32-09.mp4
(Don't mind the strangely uncropped window)
The text was updated successfully, but these errors were encountered: