We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
true
There is an eg.
sandcastle 1.107
Code:
const viewer = new Cesium.Viewer("cesiumContainer"); viewer.scene.globe.depthTestAgainstTerrain = true; const redBox = viewer.entities.add({ name: "Red box with black outline", position: Cesium.Cartesian3.fromDegrees(-107.0, 40.0, -200000.0), box: { dimensions: new Cesium.Cartesian3(400000.0, 300000.0, 500000.0), material: Cesium.Color.RED.withAlpha(0.5), outline: true, outlineColor: Cesium.Color.BLACK, }, }); viewer.zoomTo(viewer.entities);
I have tried to use Primitive API, but still:
Windows 11 22H2 Intel i5 13600K with Intel UHD 770 GraphicCard Inside Browser:Mircosoft Edge 114.0.1823.58 & Chrome 114.0.5735.199
WebGL Report
Windows 11 22H2 AMD R7-7735HS with AMD Radeon RX 680M GraphicCard Inside Browser:Mircosoft Edge 114.0.1823.58 & Chrome 114.0.5735.199
The text was updated successfully, but these errors were encountered:
There is a Primitive's example:
Sorry, something went wrong.
CesiumJS 1.103 and below do not have this problem. PTAL @ggetz
Thanks for the report @onsummer! I believe this has to do with async behavior and #6991.
To test, log the value of depthTestAgainstTerrain after a promise has resolved, and you'll see that the value is false.
depthTestAgainstTerrain
false
await viewer.zoomTo(viewer.entities); console.log(viewer.scene.globe.depthTestAgainstTerrain);
Thanks to reply, I try to set globe.depthTestAgainstTerrain = true; in a resolved promise or directly setTimeout after adding entity or primitive:
globe.depthTestAgainstTerrain = true;
setTimeout
scene.primitives.add(/* ... */); setTimeout(() => { scene.globe.depthTestAgainstTerrain = true; }, 0) // or Promise.resolve(0).then(() => { scene.globe.depthTestAgainstTerrain = true; })
that will work, but is there a better solution?
Fix #11393
971e5b7
ggetz
Successfully merging a pull request may close this issue.
There is an eg.
sandcastle 1.107
box.webm
Code:
I have tried to use Primitive API, but still:
Platform Info.
Platform 1
Windows 11 22H2
Intel i5 13600K with Intel UHD 770 GraphicCard Inside
Browser:Mircosoft Edge 114.0.1823.58 & Chrome 114.0.5735.199
WebGL Report
Platform 2
Windows 11 22H2
AMD R7-7735HS with AMD Radeon RX 680M GraphicCard Inside
Browser:Mircosoft Edge 114.0.1823.58 & Chrome 114.0.5735.199
WebGL Report
The text was updated successfully, but these errors were encountered: