When using the Billboard layer, consider the following scenario:
Two billboards are placed at the same geographic coordinates (longitude/latitude).
Conditions:
Desired Outcome:
I would like to achieve a layer ordering effect similar to Mapbox, where one billboard can consistently occlude (overlay) the other billboard at the same location. Additionally, neither billboard should be obscured by the terrain, even with CLAMP_TO_GROUND enabled.
Hi @herewaitting,
What I would typically suggest for this is:
- Set
eyeOffset.z to bring one billboard slightly closer to the camera, so that it occludes the other billboard.
- Set
disableDepthTestDistance on both billboards to some high number to prevent depth testing against the terrain.
However… I tested this out myself and it seems I’ve introduced some bugs with recent billboard + depth work, and this advice no longer works. I will try to address these bugs in this PR to ship with the next release.
I do have a follow-up question regarding the behavior you’re looking for with the terrain occlusion: in your desired outcome, do the billboards ever get obscured by terrain? That is, say you rotate the globe around so that the billboards are behind the globe - do you want them to be obscured? I’m trying to understand if the behavior you’re looking for is local or global.
Best,
Matt
Actually, I think there’s more to this issue than some depth testing fixes. See this long-standing issue here.
The problem with using eyeOffset to order entities is that a value of eyeOffset that works at a given zoom level will not work at another zoom level. Overall, I think we need to consider a more robust solution altogether.