-
Notifications
You must be signed in to change notification settings - Fork 35
Description
TL;DR - I want to make things on my custom layer that are below map in altitude always visible, haven't figured out the right way to do it.
I'm working on drawing a r3f scene on a maplibre map. I'm drawing things below the map (at negative altitude - though my canvas is a 0), but I'm having trouble understanding how to control their display. For the use case I'm working on, they should not be occluded (even though they are below). They seem to be or not be depending on the zoom / pitch or with minor rotations in the camera angle.
This doesn't seem to depend on any gl depth testing, depth writing, or render order settings on my r3f components that I've tried, and it's happening with overlay mode on or not. I think I can see the same behavior in the sun example. Eg, if I understand correctly the near part of the loop in the video is always under the map, but wiggling the camera just a bit changes if it's visible or not.
Screen.Recording.2025-09-17.144322.mp4
If anyone an provide any help with understanding what is happening there it would be greatly appreciated. I tried dumping camera settings each frame and I don't see anything obviously different between the occluded / clipped / culled positions and not.
If I move the whole thing up so the that the lowest thing in my canvas is at an altitude >= 0, it never does this, but I don't think I can make that set up work.
I know there's probably something trivially simple I just don't understand yet, I would welcome any suggestions.