Possible issue regarding custom shaders and rotation of i3dm/b3dm tilesets
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
Hi, thanks for your work on Cesium. I'm not entirely sure whether this is a bug or if I'm simply missing something here.
After support for loading i3dm tileset with model experimental was added just recently, I've been trying to use it in
order to apply a custom vertex shader to an i3dm tileset. The idea is to scale the height of the individual instances
of the tileset based on their attributes which, as far as I can tell, is only really possible with the new model
experimental through using a custom vertex shader.
However, I quickly ran into a problem. It looks to me like the tileset's model coordinates are based on a coordinate system
that is rotated differently than the world's coordinate system. Because of that, scaling the `y` factor of the vertices'
coordinates causes a shearing effect. Instead, what I expected was that this would simply scale the height of the
individual instances of each tile.
As I was curious whether this is caused by some mistake in the tileset I generated myself or whether this is a general thing, I looked into different tilesets from the sandcastle. It seems like most tilesets are affected by this, however, I managed to find one where this works just as I was hoping it would. Here are two examples, one that [doesn't work](https://sandcastle.cesium.com/#c=7Vrtb9pIE/9X9vhSeC4xEEhD0hA9KeEu6IGkKrSnqkQ9Yy94r4vX8q4huVP+92f2xW/EDtBWla7qhwS8OzszOy+/mbHoYU6ipdW/D3BIltgXNv0N2yIKMbewb88oHjEX0+w+6iIRRvjV1J/69Tq6RJwsA4qRi5cMsTlqXaEJoZijuWaEAuJ8Jv4CrYnwkMdWOES27yKOKXYEmmHPXhEWKmavI0JdSevawkYOi0KB+YPkevOhh24D7F/JjYCFoMgZ8oQIzur19XrdtPwHx1qwVZ0TgesuI0LUiU8EsQVZYV5vuYczw9wK7AWe+g7zuUArgtegUBf5eI162hrv1Vp1WnHUc4/BtYmPw2nlAP0z9RESOAxh5U3IVsTF4Vl80AnhyvgPFlJ3okmqtYOp/1hTxtKiLO5gH1sLymbYcnEgvAnm4nIBxFyYUxsmHmOBhIeRvg9Fjr3Eoa1UR4IhythnZAs0sn3PFsL247sZ+jcMbEKY5Gr07NnSrsT2W9Y8ZMsrvAgx5lV5tcOTttVodjrNVu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/6b2W8LwRoHLnEvanAwKF2wn81l2L2fQV8+chnOJM7K90Q/U9v9s+nPHKd6p5c/XwyJvSYpNJ21hStyU5eOO08R3nyWKsyTHIom13DsRh0IgVtPX/3lLqDQ9SHdL0zUmSbvXAkab72M+9IfD2z++wXSziaw/3GBTALpPgiHb927sJeZPNoqxdvPc9wHa7zlDffUE9cRCe4xNJSYuytIvmK22zkcFsPEsFJQmewYQigPqKRrsWMUzbWGJekX4VKJF7YnbdxvwdkCu5E3yz9nu52z3w8x2RuKQ+QsiIhfvLZHGJ/eVCAPblwk0B/eUp5vXvaV56tiesuIfEpmGudqnlAScEbe2t3zD6novNb7RwC57rcpB5Vw17xcx//+SpRzS5S9gqpZVF3gJQwZM8fVZBNcQlsN5jGDn9exRBT3E7Rb8sitBgnlE6Zj8jRMM2jxqMMp04pLMa14YcLMs67wOj8UnBWN0ZocbnP8P) and one that [works](https://sandcastle.cesium.com/#c=hVLva9swEP1XDn+ytyBntJTROmEj2yCw0NGG7othc6RLIybrjH64SUr+98lWEty1sE+6u/fuPUl3M7TS1+zrtkEja9SuUt+wct6gZairlcIFCVRDHCbgjMebUpeak7YOWolPaEJd4xPMouJDX0vLhPf5jEKr1GjKZATPpQZwaEyo/DDUSoHm+tTITfDHn2SUWEZKmo1KfcgGhk4qtOheOsbj4ssygmnv4o06K89J36ElbziytaH6sw20uUgvxx+vrjoPAO6to/p+U/U3GooPgKgM0KJxuI21JW7dNfyOQIBIiiO+6F7w0Idz3fjwW7Y/RyA1hZTv619198eRc+tdJMUgg+eTJpyLrCErnSS9mLEdvJ/A5ZiNbyDPofF2A26D5x9aexNSA9WKWoRHQ16L/wm+m8BF0DvRDjHo33bIzpOIQ2eWo0bWhOUIAm3YmkqI9OjeEY+0PVG9pCFQ6mSUFNbtFE5PVp9k3ZBx3dRSxnKHdaPCMth85fkfdIxbmx3vVeTD1kLIFqSYvLFuwFVlbUDWXql7uccymRZ54L9qVVQJqR9vw9xUtetomw/T77HIGCvykL7d6YjUqjL/KP8F).
What is the difference between these two tilesets that causes the different behaviors? Is this how it's supposed to be? Am I missing some configuration option or is there another way to achieve this?
Thanks in advance for your help.
Contributor guide
Research direction
Start by reproducing the behavior in the two linked Sandcastle examples and compare the i3dm/b3dm tileset configurations and custom vertex-shader behavior. Determine which tileset or coordinate-system difference causes scaling along the y axis to shear, and document or correct the behavior so per-instance height scaling works consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100