Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

billboard being incorrectly culled #4510

Open
mramato opened this issue Oct 21, 2016 · 9 comments
Open

billboard being incorrectly culled #4510

mramato opened this issue Oct 21, 2016 · 9 comments

Comments

@mramato
Copy link
Contributor

mramato commented Oct 21, 2016

  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

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 25, 2016

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

@mmccartn
Copy link

I can reproduce this in the latest release 1.26

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 4, 2016

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

@emackey
Copy link
Contributor

emackey commented Nov 4, 2016

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.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 25, 2018

Also reported in #6152

@laurensdijkstra
Copy link

laurensdijkstra commented Jan 26, 2018

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.

@emackey
Copy link
Contributor

emackey commented Jan 26, 2018

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: #2694 (comment)

@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 26, 2018

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

@ggetz
Copy link
Contributor

ggetz commented May 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants