ForesightMiningSoftwareCorporation / bevy_polyline

Polyline Rendering for Bevy

Home Page:https://crates.io/crates/bevy_polyline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lines with perspective disappear at certain camera angles

NEO97online opened this issue · comments

commented

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)

Yeah, this looks like culling of some kind. Have you tried adding NoFrustumCulling to those entities? I use polylines with perspective all the time, so I'm surprised I haven't seen this until now.

commented

NoFrustumCulling on the entity with the PolylineBundle didn't have any effect, unfortunately

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.

commented

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.

commented

I believe this started with bevy 0.10.

Adding more line segments doesn't resolve the issue, but rather than the entire line turning translucent blue, it's split at the subdivisions like this (sorry for the pause menu overlay, but you can still see the issue):

image

@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