Problem with Lines being culled

Hi,

I’m creating a little game where i’m having my camera follow around the player in a 3rd person view.
The player also leaves a trailing line behind everywhere that he went.

I’m rendering this line by keeping track of the positions that the player has turned at, saving those in an array and updating the geometry of my Line according to this array, this was all working smoothly, but i’ve stumbled upon some weird culling issues, where the line would get culled whenever one of the points of the line is outside of the near plane of the camera, but since the other point is clearly within the plane, shouldn’t the line be rendered (partly) anyway ?

I’ve made a fiddle to demonstrate : https://jsfiddle.net/v40z9yot/2/

the red line consists of two points :

const points = [
     0,0,0,
     0,0,20
 ]

and renders like i would expect, however, when i change one of the points to be far outside of the camera near plane (and the other still within it) the line doesn’t render anymore ?
Setting frustumCulled to false on the line also doesn’t have any effect, aswell as recalculating the boundingBoxes from the geometry.

Is this expected and should i change my approach as to rendering a trailing line behind the player ?

Any help would be appreciated!

That is strange since it works on my system. Meaning I can still see the line even if I place the second point far behind the camera. Can you please check if the following fiddle renders the line? It works on my system: https://jsfiddle.net/dL82yneo/

Thanks for your reply!

very strange indeed! your fiddle does not appear to render the line for me.

I’m using Chrome Version 87.0.4280.88 on Ubuntu 20.04.
But In Firefox the line also is not being rendered.

Any ideas as to what might cause an issue like this ?

Maybe a GPU driver issue. Can you try to update it to the latest version?

1 Like

Updating from nvidia-driver-460 to nvidia-driver-465 seems to have solved the issue!

Thanks a bunch!

2 Likes