CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.01k stars 3.51k forks source link

Incorrect decoding of draco model with high quantization bit number #7471

Closed OmarShehata closed 1 year ago

OmarShehata commented 5 years ago

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.

lilleyse commented 5 years ago

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

wangzhongliang commented 5 years ago

@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 commented 5 years ago

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

lilleyse commented 4 years ago

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

lilleyse commented 4 years ago

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.

Ben-Mack commented 3 years ago

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

lilleyse commented 3 years ago

@Ben-Mack, no, still an open issue

lilleyse commented 2 years ago

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

lilleyse commented 1 year ago

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

lilleyse commented 1 year ago

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