I am encountering a strange issue since recently.
A model that looked always nice in cesium seems to have some inverted parts. The preview in ion looks ok, but in the main viewer, some parts look “inside-out”, see:
I suspect that this might be related to the fact that some parts possibly have negative scales & this was handled wrongly in cesium till the recent update introduced with the new gltf model class, see here
…can you confirm this? Thx!
PS: The id in ION is 98379
Thanks for reporting, @katz. Cesium ion’s preview is actually a few versions behind the latest CesiumJS release right now, so your assertion about this being caused by a recent CesiumJS update is almost certainly correct.
I wrote up Gltf model: Some parts seem inverted since recent update · Issue #11045 · CesiumGS/cesium · GitHub so that the CesiumJS team can confirm whether this is a regression introduced in the recent refactor or if the model was always like this and bugfixes in CesiumJS now show it correctly (but visually wrong)
I tried out your model, and confirmed what you said here:
I suspect that this might be related to the fact that some parts possibly have negative scales & this was handled wrongly in cesium till the recent update introduced with the new gltf model class
This is correct. The plane had negative scales, and the old Model code had a bug and these details “canceled out”. Since then, we fixed the handling of negative scales to be compliant with the glTF 2.0 spec which is why you only see a visual difference now in recent versions of Cesium (1.97+)
More details in the issue: Gltf model: Some parts seem inverted since recent update · Issue #11045 · CesiumGS/cesium · GitHub
Also if you’re looking to fix the model, a couple possible ways:
- Remake the data to avoid using negative scales
- Or for primitives that use negative scales, store the geometry with clockwise triangles to cancel out the scaling factor. This idea is based on this implementation note in the glTF spec
Thx a lot @ptrgags, really appreciate your insights, assistance and suggestions.
- Option 1 is unfortunately not possible as this would imply to re-create the animations from scratch.
- Option 2 seems to require a substantial amout of gltf knowledge.
- So we might have to take option 3: Export the models again now with the the correct settings of the exporter (same settings as babylon & three.js).
Link to my answer on github: here