Incorrect bounding box after loading a model quantized by gltf-transform

Environment:
Windows 10 x64
Chromium 111.0.5563.65 x64 (ungoogled-chromium build)
Babylon.js 5.53.0

Assets:
models.zip (75.3 KB)

  • model_orig.glb is the model before quantize, which is ok
  • model_gltf-transform.glb is the model quantized with steps below, which can reproduce this issue.
  • model_gltfpack.glb is the model quantized with gltfpack -ke -kn -km using gltfpack 0.18, which is ok

Actual behavior:
Load model_gltf-transform.glb in and drag around:
229266795-cbf74599-be61-4482-ba69-5a19c1fe241b

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://gltf.report/ and drag in model_orig.glb
  2. Click on Script button
  3. Use code below to do a quantize
import { quantize } from '@gltf-transform/functions';

await document.transform(
	quantize()
);
  1. Run and export
  2. Open https://playground.babylonjs.com/#N036XF and load the exported model in the right panel.

Extra Info:
This issue is also reported to glTF-Transform:

Another thing to notice is that gltfpack uses u16 for position and gltf-transform uses i16_norm for position, this could make a difference.
gltfpack
gltf-transform

cc @bghgary ???

Thanks for the report! Issue is fixed in this PR: Fix bug with glTF accessor min/max code by bghgary · Pull Request #13696 · BabylonJS/Babylon.js · GitHub.

4 Likes