Cesium: billboard being incorrectly culled

Created on 21 Oct 2016  路  9Comments  路  Source: CesiumGS/cesium

  1. Run the below code.
  2. Gecoder to Matagorda Island and double click on the only placemark in the upper right (also Matagorda Island)
  3. Rotate the camera up and down and the billboard will blink on and off.
var viewer = new Cesium.Viewer('cesiumContainer', {
    baseLayerPicker: false,
    terrainProvider: new Cesium.CesiumTerrainProvider({
        url : 'https://assets.agi.com/stk-terrain/world',
        requestWaterMask : true,
        requestVertexNormals : true
    })
});
var options = {
    camera : viewer.scene.camera,
    canvas : viewer.scene.canvas,
    clampToGround: true
};
viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/kml/facilities/facilities.kml', options));

bug

category - billboards priority - high type - bug

All 9 comments

Looks like a multifrustum issue. I think there is a duplicate issue, but I couldn't find it now.

I can reproduce this in the latest release 1.26

From #2139 via @shunter

First noticed this with NORAD Tracks Santa, but saw it again today.

Billboards appear to be clipped against the edge of the frustum.

image

Sandcastle example:

https://gist.github.com/shunter/ac663bf2b527bac7242b

In the above screenshot, I suspect _all_ of those yellow points are actually sticking into the globe. Cesium does a good job keeping things like billboards from "sticking into the globe", but the globe-depth tricks break down across frustum boundaries. So for the clipped yellow dots above, the yellow fragments are being rendered into a rear frustum, and the globe imagery is being rendered into a closer frustum, and there's a depth buffer clear in between. There's no easy way to allow the points to show through the globe at the boundary, because they are legitimately occluded.

Also reported in #6152

In #6152 I set disableDepthTestDistance: Infinity, so in theory the Billboard should in that case not be depth tested against the terrain. But I guess the Billboard then ends up in front of all the Primitives (including the Globe) in a background Frustum, while the Frustum in front of it is just drawn over it, as it should always be in front of the previous Frustum. But this conflicts with the depth testing that is disabled on the Billboard.

So perhaps every Primitive with depth testing disabled should end up in the front most Frustum.

So perhaps every Primitive with depth testing disabled should end up in the front most Frustum.

My current thinking on this topic is that all 2D primitives end up in their own render pass, with some kind of single-3D-point depth test to determine visibility status of the primitive. The primitive would exist outside of any 3D frustums and would not have per-fragment depth testing. See thread: https://github.com/AnalyticalGraphicsInc/cesium/issues/2694#issuecomment-338168783

@emackey @laurensdijkstra yes, has potential - may still z fight in the distance - will need to evaluate - might not be bad with #5851.

Reported on the forum: https://groups.google.com/forum/#!topic/cesium-dev/odobrazRIWU

Was this page helpful?
0 / 5 - 0 ratings