cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Incorrect decoding of draco model with high quantization bit number

Open OmarShehata opened this issue 6 years ago • 8 comments

This was reported by Chris Wang on the forum.

The glTF file attached in this post was encoded with the following Draco parameters:

sOpt.pos_quantization_bits = 20;
sOpt.tex_coords_quantization_bits = 15;

And renders incorrectly in Cesium. Here's what it looks like in Bablyon:

babylon

And in CesiumJS:

cesium

@lilleyse believes this might be because the quantization is hardcoded in a few places in our Draco decoding.

OmarShehata avatar Jan 07 '19 20:01 OmarShehata

@lilleyse believes this might be because the quantization is hardcoded in a few places in our Draco decoding.

Specifically I wouldn't be surprised if UNSIGNED_SHORT is hardcoded somewhere.

lilleyse avatar Jan 07 '19 21:01 lilleyse

@lilleyse Hi Sean, will this be fixed soon? if not, can you tell me where is possibly hardcoded, so that I can fix myself.

wangzhongliang avatar Mar 15 '19 08:03 wangzhongliang

When I set dequantizeInShader to false, the model is not distorted, and displays well. Hope it will help.

wangzhongliang avatar Mar 18 '19 08:03 wangzhongliang

This also came up in https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues/511

lilleyse avatar Dec 28 '19 20:12 lilleyse

Opened an issue in the Draco repo about whether it's possible to query the quantization bits without decoding to quantized form: https://github.com/google/draco/issues/573

@sanjeetsuhag and I talked offline - if there's no way to do it in the API, we'll need to dequantize in our own code.

lilleyse avatar Jan 23 '20 15:01 lilleyse

@lilleyse Has this bug been fixed on the latest Cesium?

Ben-Mack avatar Mar 29 '21 05:03 Ben-Mack

@Ben-Mack, no, still an open issue

lilleyse avatar Mar 29 '21 15:03 lilleyse

Came up again in https://github.com/CesiumGS/cesium/issues/10516

lilleyse avatar Jul 06 '22 20:07 lilleyse

Came up again in https://github.com/CesiumGS/cesium/issues/10977

lilleyse avatar Jan 02 '23 20:01 lilleyse

Fixed in https://github.com/CesiumGS/cesium/pull/10979

lilleyse avatar Jan 02 '23 21:01 lilleyse