cesium icon indicating copy to clipboard operation
cesium copied to clipboard

3D models rendering is wrong with vertical exaggeration above 1

Open Jean-Dum opened this issue 1 year ago • 9 comments

What happened?

When setting viewer.scene.verticalExaggeration to a value above 1, all 3D models rendering become wrong.

Reproduction steps

  1. Display a 3D model
  2. Set viewer.scene.verticalExaggeration to a value above 1

Sandcastle example

https://sandcastle.cesium.com/#c=tVbbbhs3EP0VVk9rQKUutpJUVYzactoErdE0UoICVRHQu7NawlxyQXJtuYH/PcPLSqtLHwRDehE5HJ5zZjhcTqqkseSBwyNo8pZIeCRTMLwu6RdvSxad1M+nSlrGJehFp0u+LSQhXObqWq3GJGfCQNeZDAhILVfyg8x4yqzSW6sFy9SjGROr68aiapFdSV4yC2v789nPC7mQQRQ1KUigD6AtIop3K7ZcgmaOBPUOvWdeS89KUg0IdKsyEEmtRZcUwJeFPQuCIyBIyy0HQzWU6gGuhEgCISGpz0alDI/4MRdTpi2OmDynuVblDSw1gEncFkJ+HAzPaf/1xcWrwU/dYLq4oP1R//x1/1U0BB1u7KgaogJYxuVyw3PLbEGt+oRmJk0yOB+13Stu0wKd+y2bVkLsmIpq5yTfB5qPbvsn9E8ibzcgdj1Im0hpjkli2zmYa5SUK10aWuwA/lVj1rVE95iSJoNN9JVuQt+Q+GN4QvzdY2FZlnwLGyUrsSzcSW7jjncZWorH7UlcLl1FjElEJYjI27DowLEG6/IjX4GY8f+QdDB8s1llK7c6w/rDlWEff3Ht2f8/h+TFQKxm6T1k75r4QqDo8ezCjxmunDqDq/+4nVGYhZUdk0XniutUs9ziVYvhyXCz8DY1pZ6cbcJpl31jI4hDaW/GykrADbOs55NgeuE4kSKOvuKQLsXdmsz9Rhgi7TfzEN462u4ByTdaSTihXo/fHu9JHoyOU/ybVrXMyBcoeCpOIz1QRIbt2Z78Y6S/V5bgqZFrJoRS8oRpjwzbs/3UH1stt1zck7mu0/sTancknmN3/qLcz+65lJCRacHwnlv/Hp4sAtZk/isOXyT7sxTcEnyuTyIXcT3BeoBabb5TI0d+T1iqyFSVlQZjMN9eyUnEe6oN04Fq2QnlmDh+n/89bIdx5JXlOUl+iA/wrxhTreEGbOixqKmrSmlrrpnhJmm3S2ctCEIeucS+i+LjpW0rHS4h84IbcqexK8P2L1NgiMRvSwQmHph8lhy7L8MEPtzrOFx8KMYsOhvAJh2Yipd/clzi9i0v//R8wOeXydQdxekuw5pka3LgUoz+X/m/vluaMZmlzFh8MbAvmisl7pi+BVknsYUITVWn25kY+yTgsgH8hZf+DLHLSVCmBZSJMZjeHdY0WJoa03BOeu2tk4w/EJ69PdD4k1QwY3Alr4Vvkxady0kP/fe2CuU7xD+xcAR7cm7F4PKPYKSUTno4PbzThhB3kL8D

Environment

Browser: opera for android and Chrome 114.0 CesiumJS Version: 1.116.0 Operating System: Windows 10

Jean-Dum avatar Apr 16 '24 13:04 Jean-Dum

@jjhembd Could you please take a look at what may be causing this?

ggetz avatar Apr 16 '24 13:04 ggetz

Hi @Jean-Dum, can you clarify what you mean by "wrong" rendering? The Sandcastle link works ok for me.

One thing to keep in mind: for a model that is far away from the reference height, exaggeration may move it out of view. In your Sandcastle, the airplane model is far above the viewport. But the Milk Truck model looks ok.

If your model is up in the air, one option is to set the reference height to the center of the model. Here is a modified Sandcastle showing this approach.

image

Let me know if this doesn't fix things on your end.

jjhembd avatar Apr 16 '24 18:04 jjhembd

Thank you for your answer @jjhembd !

On your sandcastle, when modifying vertical exaggeration and zooming out, here is what I see: image

Jean-Dum avatar Apr 17 '24 08:04 Jean-Dum

Furthermore, model entities are systematically vertically scaled by verticalExageration, which deform them. I would want the verticalExaggeration to only modify terrain (as it was done by terrainExaggeration), but it's not possible anymore (or at least only move up the entity model without distorting it).

Jean-Dum avatar Apr 17 '24 08:04 Jean-Dum

Thanks for that clarification @Jean-Dum! I think there are 2 things going on here:

  1. When zoomed out, vertical exaggeration is not accounting for the "minimumPixelSize" of the model, so the rendering is wrong (your screenshot makes it very obvious--thanks!). This is a bug.
  2. All models are scaled by verticalExaggeration. This was an intentional choice in https://github.com/CesiumGS/cesium/pull/11655. However, users may want to turn exaggeration off for some of the models in the Scene.

To keep the discussion cleaner, I think the second item could be its own issue. I opened one here: https://github.com/CesiumGS/cesium/issues/11940. @Jean-Dum can you add more details about your use case in that issue? More context will help us prioritize it.

We can continue to discuss the buggy behavior (when zoomed out) in this issue.

jjhembd avatar Apr 17 '24 15:04 jjhembd

Thank you very much @jjhembd !

Jean-Dum avatar Apr 18 '24 08:04 Jean-Dum

I tried to find the cause of this issue but couldn't find it, I unfortunately do not have the skills to fix it. Does this issue has been prioritized yet?

Jean-Dum avatar Jul 26 '24 16:07 Jean-Dum

@jjhembd If I just want to exaggerate the terrain, how should I use this feature?

mengqiuzl avatar Jul 31 '24 03:07 mengqiuzl

@jjhembd Hi Jeshurun +1 for me as well, I am in the 'However' case for item number 2 :)

timeichfeld-msa avatar Aug 07 '24 18:08 timeichfeld-msa