CesiumGS / gltf-pipeline

Content pipeline tools for optimizing glTF assets. :globe_with_meridians:
Apache License 2.0
1.94k stars 250 forks source link

index order not preserved #579

Open ua4192 opened 3 years ago

ua4192 commented 3 years ago

Hi.

I have a big problem with gltf-pipeline.

I use this convertor to convert my models to GLB with Draco compression. Everything works fine but the index order I have set on my models is not preserved after conversion.

I need to preserve index order because my models are composed by many individual other models (merge). The point is that before exporting the scene I sort the models to be merged order by box size (bounding box) in ascendant mode. In this way, depending on the distance to the merged model I can use the setDrawRange method in order to hide the small models inside the merged model.

The problem is under gltf-pipeline because if I export to GLTF without Draco compression it preserves the index order and setDrawrange works as expected.

Is there any possibility to keep the index order untouched?

Many thanks in advanced.

Best regards

ua4192 commented 3 years ago

May be I am only person with this problem?

donmccurdy commented 3 years ago

@ua4192 I believe this is an effect of the (higher compression) edgebreaker compression method. You can disable that and use sequential compression with the --draco.compressionLevel=0 option, which should preserve index order.

ua4192 commented 3 years ago

Hi.

Many thanks for the information.

Do you know what more or less will be the increment of the size of glbs comparing wusing --draco.compressionLevel=10?

Many thanks in advanced.

donmccurdy commented 3 years ago

The file size will be higher (less compression) with level 0 than with level 10, but it's hard to say how much higher. Reordering vertices allows Draco compression to be more effective.