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.82k stars 3.46k forks source link

Shaking occurs when the camera is near an object. #11657

Open syzdev opened 10 months ago

syzdev commented 10 months ago

When the camera approaches the lines, it is evident that the lines are shaking.

  1. CZML Path: Zoom the camera to the nearest position. GIF2

  2. Clamp to 3D Tiles: Move the camera in a very close position. GIF3

  3. CZML Point: Zoom the camera to the nearest position. GIF1

Sandcastle example: CZML PathClamp to 3D TilesCZML Point

Browser: The latest version of Chrome

Operating System: Windows 11

syzdev commented 10 months ago

CC #4049

syzdev commented 10 months ago

Hi @ggetz , I'm not sure if this is the same issue as #9417 .The difference is that I'm not using an Apple device. Has this been discussed in the past?

ggetz commented 10 months ago

Hi @syzdev, thanks for the report! This is similar to #9417 as the shaking is likely coming from precision issues. But since you are replicating on Windows, the source of the issue is likely different.

I'm able to reproduce a slight jitter when zoomed in very close.

Would you be able to let us know your use case for zooming in very close?

syzdev commented 10 months ago

@ggetz

My use case is very similar to Multi-part CZML, where I need to use viewer.trackedEntity to track objects along a path. In the official example, the model is often enlarged, but in reality, the model is very small, such as for a person or a car. Therefore, many times it is necessary to zoom the camera to the nearest position, which leads to shaking problems.

Here is also a simple example to describe my use case: Path roaming. s

Regarding the precision issues, I have checked the code: translateRelativeToEye.glsl#L8EncodedCartesian3.js#L9AutomaticUniforms.js#L1225AutomaticUniforms.js#L1246, According to the techniques described in the code comments, it should be possible to represent centimeter level accuracy, but I did not conduct further research.