cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Animated model optimized with gltfpack crashes / won't render

Open nikiosna opened this issue 1 year ago • 3 comments

What happened?

This animated model works fine in cesium 1.120 windturbin.glb.zip

But after investigating the optimization of a model import pipeline I notice that it won't work anymore after applying the gltfpack meshoptimizer. In my setup It just is missing the rotating blades but in the sandcastle I once saw an error too. But this don't seem to happen every time.

Optimized model using gltfpack -noq -i windturbin.glb -o windturbin_optimized.glb windturbin_optimized.glb.zip

I believe its a bug in cesium because the optimized model still works fine in threejs and gltf validator shows no errors.

One thing to note is that if I import the optimized model to blender and export it again the result works again in cesium.

You can't open the sandcastle out of the box unfortunally because I used a localhost url to provide the glb files.

Reproduction steps

  1. Copy the cesium sandcastle
  2. Adjust the localhost urls from the windturbin and windturbin_optimized
  3. Open the sandcastle with the optimized windturbin model ...

Sandcastle example

https://sandcastle.cesium.com/#c=vVRdb9MwFP0rVp8yKTjp2n0QuokxkECiYqwTPBCE3OS2sXDsyHbajqn/nes4adMyIfFCXmrfj3Puufe6mZLGkhWHNWhyRSSsyS0YXpf0S2ML0kHW3G+VtIxL0OkgJE+pJITLhXqjNglZMGEgdCYDAjLLlfwgc54xq/SBt2C5WpuEWF13FlWL/EbyklnY2bcnr1KZykUtGyySaUD3VOUgglqLkBTAl4U98WX42ilIyy0HQzWUagU3QgQehpCs0Vgpwxu4q07hLdMWT0yO6EKr8i0sNYAJXAohL4anIxpfjMfnw5ehN43HND6LRxfxeWvwdbizo+qICmA5l8s9z5TZglp1j2YmTTAcnfXDK26zAoPjnk0rIY5MRXU0n/ee5s6l32N80PKGHjFsQPpESnNsEjvswYPGkhZKl4YWR4Cfa+y6lhjetqTrYKe+0p30PUkzhkfEPx4Ly/PgySdKVuKw3SQPcZNjhl7FSf/Suku3EQlpUQki8j4sBnDcrLq84xsQM/4LSYenl3sv2zjvLGMCPacxfq1v2/xuffNaIVaz7Cfk7zp9XihGbJ38tsOVq86g95vLbAuzsLEJSQdfucxtredc4hNqBUr/YvCVdMsenOwF9Re/sxFEKqytkigSCksvlLHJJdYeGdecLGq6YqL1jo0uxXzH6L64O3qBO73hX4tu1JXYxfz/lv9jx/svQr43WzljMs+YsQLc/j0oJeZMT0HWQTsqlzgIBxNjHwVcd3CveVkpbd0uBZRGFspKoBITzWvcAUszYzrGSdRPneR8RXh+9cyfJskEMwY9i1o0y5gOricRxv+RKlTzDj+tQAv26MKK4fVHb6SUTiK8Pp9pvcAj5N8

Environment

Browser: Firefox CesiumJS Version: at least 1.118.2 up to 1.120 (latest) Operating System: MacOS

nikiosna avatar Aug 28 '24 07:08 nikiosna

Thanks for the report @nikiosna.

but in the sandcastle I once saw an error too

Would you be able to copy the error here?

ggetz avatar Aug 28 '24 12:08 ggetz

This is the error, but it isn't shown every time and is maybe just related to the viewer.trackedEntity.

An error occurred while rendering.  Rendering has stopped.
DeveloperError: cartesian has a NaN component
DeveloperError@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:9817:13
Ellipsoid.prototype.geodeticSurfaceNormal@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:18318:13
Ellipsoid.prototype.cartesianToCartographic@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:18369:20
updateMembers@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:192362:69
Camera.prototype._setTransform@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:192729:18
updateTransform@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:159502:14
EntityView.prototype.update@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:159591:20
Viewer.prototype._onTick@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:255300:20
Event.prototype.raiseEvent@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:20103:22
Clock.prototype.tick@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:137631:17
CesiumWidget.prototype.render@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:242328:39
render2@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:241749:20

nikiosna avatar Aug 28 '24 13:08 nikiosna

Ok sorry I now improved the sandcastle the error is indeed more or less unrelated to this issue. Here is a improved sandcastle which skips the trackedEntity for the optimized model and some screenshots.

Bildschirmfoto 2024-08-29 um 16 35 39 Bildschirmfoto 2024-08-29 um 16 35 47

https://sandcastle.cesium.com/#c=vVRdb9MwFP0rJk+pFJx2LdsI3cQYSCAxMbYJHghCru00Fo4d2U7bMfW/cx0nbVYmJF7IS+37cc69516XamUdWgm+5gadIcXX6JJb0VT4S2uL84i290utHBGKmzxK0EOuEBKq0G/0JkMFkZYn3mS55NQJrT4oJihx2jzyloTptc2QM01v0Y1kF0pUxPGdfTt6latcFY1qsRA1HNxXmnEZN0YmqORiWbpRKCPUjrlywgluseGVXvELKeMAgxBte6y1FS3cWd/hJTEOTkRNcWF09ZYvDec29ikIPZ8cTfH4ZDY7nrxMgmk2w+MX4+nJ+LgzhDr82VP1RCUnTKjlnueKuBI7fQNmomw8mb4YhtfC0RKCxwOb0VIemMr6YD7vA821T7+B+LjjTQJi0oIMibQRIBJ5rMGdgZIKbSqLywPAzw2obhSEd5L0Cvbd16ZvfU/SjuEe8A/HQhiLH0KiIhUM20/yMW52yDCoOBteOnflNyJDHSoCRDGEhQABm9VU12LD5a34BaSTo9O9l2y895YSCZ6jMXydb9v+boN4okDxM0DFQlHZML8g0Voo5hqzEOqHrp2oAJvl0WjU19I17wyhPzl712sSxGlRt7DmXrduNLVvy0LIN+/sUBzfuAzl0dcdG7y9ThkVnho8r/6VxKO9EsMX09sQIJXO1VmaSg09l9q67BSaTq1XlaatnDbd94aXcrFj9N+4PwZldkIlfy0aDST6n+XvR/MvjXxv1/mWKEaJdZL7xb3TWi6IueKqibtR+cQoiebW3Ut+3sO9FlWtjfNLGGOcOl7VEjqx6aKBRXCYWtszztNh6pyJFRLs7Il/W0QlsRY8RSPbLc6j83kK8X+kSt0+4E8rbiS592Hl5PxjMGKM5ylcn850ocED5N8

nikiosna avatar Aug 29 '24 14:08 nikiosna

Thanks for the update @nikiosna! This appears to be due to lack of support for sparse accessors: https://github.com/CesiumGS/cesium/issues/10284.

I'm going to close your issue to keep the discussion in one place. If you have any further input on this, please post it there instead.

ggetz avatar Jan 14 '25 16:01 ggetz