CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.86k stars 3.47k forks source link

`scene.pick` does not respect `backFaceCulling` for `Cesium3DTilesets` #11764

Open junnys6018 opened 9 months ago

junnys6018 commented 9 months ago

What happened?

If you set backFaceCulling: false when creating a Cesium3DTileset, then scene.pick will correctly pick the backfaces of the tileset, however if you later enable backFaceCulling, then scene.pick will continue to pick the backfaces of the tileset, even though it is no longer visible in the scene.

The opposite problem also exists, creating a Cesium3DTileset with backFaceCulling: true will never pick the backfaces of the tileset even if backFaceCulling is later set to false.

Reproduction steps

  1. Open the sandcastle
  2. Click on the quad and observe the tileset is getting picked in the console
  3. Enable backFaceCulling by checking the box on the top left corner of the viewport
  4. Click on area where the quad used to be
  5. Observe that the tileset is still getting picked despite not being rendered ...

Sandcastle example

https://sandcastle.cesium.com/#c=bVR/b9pIEP0qK/4yEjEJXHuXlqDjV3KgYK6JkzaRpcpeD2Tx2uvsriGm4rt3FtsEaCRL3pl58+bN7NjNJgmzOM6JFhEkXjIAxbLYHovEDmHuZ1z3KAWlXBMmV8SrQT55CW4om7HJ+GEzvnDYWI2Tu090MP48jtIfj4PJpY2g1/AmMiA++z799LSM1s7g/G3qPrNb9447wwf9tLyOn+8vls83znLacrgTj1qzYcRuB5P0GcmmLn2bLnttYz/9+MZmy1F7OnzYzNxRPt30L23n7JWynvs4/zm6/Gfyt3o9d26iM65fZ4+S9QM68Z3W4vM0ajlrr/bVw+6oSJQmKwZrkNhMAmtSNvy481leje7sgUi0zxKQXq1BfnkJIRqkRM//UqxYCPIL8dc+01V68XKPMfZcihgn2VMK9Di0DA0hF+ZVb3jJto6aCi22opCAveAiAJx7ql9cULq3QDKlS1bUq2UGuz60zAtVRUOBT6Nrn8Ig45wlC0TOfa4MtEJIUOg9kozC7kCJTFLYCa1Utv5qtc/b7fpBtmYcMHjKULzaQ7cI71geJLewWDk0ciqtYbzbgvuo9VSymGm2AmX7YWiVFQtgUbSEb4SIXXEIeNdpIFMRAkelRf0Py+9Iyx6iRNBIZNrWEqHWnuGofSF44JuFCQXNYki0vQA94mCO/dzcbK3EeLX6h+x+mvK8z5IQRaj3Ko2K++MsrDILFMiVH3A4zPJqJ41hXVtlgaKSBWBZdXLVrW6gnJT955LsCU9jXw9u6eimJEBynyJwtMLW//OTkBs/7k2SZvin0EwklvUrFYqZ4/ZQRzHLlNFogHks9DWUGt6XAINWldwgbXwKEUW24GBzsbCOOKoN2Daq8d2fyHTzFOzb0bX7czj77hj8llBf0xdi4ZclZP39U6oqFH6D9JJao9ZROufQNah/WZwKqUmGe27bTQ1xylGFagYZjXDKVCmT12lWKZ2QrQgLrz74sxDKfaUwMsex37MNeLVup4n4ozQufLM1sxVI7ucIMTI6Lxfd2yJg23aniaYpepq738oiSZs96hYD7ehAhHlpGFPuz8YKu/3jneg00XeM6DBz60TjfE17L0CjQLxhX3gv/lmA2165IfxC/tjY7hElGpUCPO614bkUXXX3Gw

Environment

Browser: Chrome Version 120.0.6099.217 (64-bit) CesiumJS Version: 1.113 Operating System: Windows 11 Pro Build 22631.3007

ggetz commented 9 months ago

Thanks for the report @junnys6018. My guess is that the command used for picking are not being properly updated.