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

disableDepthTestDistance causes weird mouse interaction #6840

Open
hpinkos opened this issue Jul 24, 2018 · 9 comments
Open

disableDepthTestDistance causes weird mouse interaction #6840

hpinkos opened this issue Jul 24, 2018 · 9 comments

Comments

@hpinkos
Copy link
Contributor

hpinkos commented Jul 24, 2018

disableDepthTestDistance pushes the billboards to the near plane, which messes up the collision detection when you try to zoom in.

See discussion in #6802 (comment)

var viewer = new Cesium.Viewer('cesiumContainer', {
    terrainProvider: Cesium.createWorldTerrain()
});
viewer.scene.globe.depthTestAgainstTerrain = true;

var lon = -122.1958;
var lat = 46.1915;
for (var i = 0; i < 20; i++) {
    for (var j = 0; j < 20; j++) {
        viewer.entities.add({
            position : Cesium.Cartesian3.fromDegrees(lon + i * -0.001, lat + j * -0.001),
            billboard : {
                image : '../images/facility.gif',
                heightReference : Cesium.HeightReference.RELATIVE_TO_GROUND,
                verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                disableDepthTestDistance: Number.POSITIVE_INFINITY
            }
        });
        
        viewer.entities.add({
            position : Cesium.Cartesian3.fromDegrees(lon + i * 0.001, lat + j * 0.001),
            billboard : {
                image : '../images/facility.gif',
                heightReference : Cesium.HeightReference.RELATIVE_TO_GROUND,
                verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                disableDepthTestDistance: Number.POSITIVE_INFINITY
            }
        });
    }
}

viewer.camera.flyTo({
    destination: Cesium.Cartesian3.fromDegrees(lon, lat, 10000)
});
@OmarShehata
Copy link
Contributor

Just to tie in the conversation from #8009, @raycrummey you mentioned your workaround was to implement a custom zoom function. In case it helps others blocked on this, did you simply disable the collision detection or did you do something else?

I tried viewer.scene.screenSpaceCameraController.enableCollisionDetection = false; but I can still see the issue there.

@raycrummey
Copy link

Omar,
One workaround is to disable Cesium zoom, this.viewer.scene.screenSpaceCameraController.enableZoom = false;
Then you could implement a scaled down version of handleZoom()

@benjaminmur
Copy link

Hi @raycrummey !

I would be interested in how did you replace the handleZoom() function of cesium by yours ?
Did you modify the code and build the version with your fix ?
Or can you replace the function in your own code by setting your own function in some way ?

Btw, can you show me your own function ?

Thanks a lot for your response.

@OmarShehata
Copy link
Contributor

Came up again here #8476.

@lilleyse
Copy link
Contributor

Opened #8810 for rendering billboards in a separate pass, which would help fix this problem.

@YVin3D
Copy link
Contributor

YVin3D commented Apr 29, 2020

Looks like this commit fixes this. @kring do you happen to know if the bug you were working on for that commit is related to this issue?

@kring
Copy link
Member

kring commented Apr 30, 2020

Could be @YoussefV. That commit was for #8600, which fixed a bunch of depth-related problems.

@mramato
Copy link
Contributor

mramato commented Apr 30, 2020

If this is fixed, that means we can look into enabling the billboard unburying path by default, right @hpinkos?

@hpinkos
Copy link
Contributor Author

hpinkos commented Apr 30, 2020

@mramato #6838 needs to be fixed. And probably #7376 and #8588 too

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

8 participants