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

3D models rendering is wrong with vertical exaggeration above 1 #11936

Open
Jean-Dum opened this issue Apr 16, 2024 · 6 comments
Open

3D models rendering is wrong with vertical exaggeration above 1 #11936

Jean-Dum opened this issue Apr 16, 2024 · 6 comments

Comments

@Jean-Dum
Copy link

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

@ggetz
Copy link
Contributor

ggetz commented Apr 16, 2024

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

@jjhembd
Copy link
Contributor

jjhembd commented Apr 16, 2024

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.

@Jean-Dum
Copy link
Author

Jean-Dum commented Apr 17, 2024

Thank you for your answer @jjhembd !

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

@Jean-Dum
Copy link
Author

Jean-Dum commented Apr 17, 2024

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).

@jjhembd
Copy link
Contributor

jjhembd commented Apr 17, 2024

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 Vertical exaggeration for 3D Tiles #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: #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.

@Jean-Dum
Copy link
Author

Thank you very much @jjhembd !

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

3 participants