GLB Optimizer for Geometry and Texture Conversion (WEBP and KTX2)

@labris would you be so kind and add a link to this on the main doc? This needs to be there
@PatrickRyan where do you think we should add this link?

1 Like

I think we could do a new page under Preparing Assets for Babylon.js | Babylon.js Documentation (babylonjs.com) that talks more about optimization and compression and showcasing this tool. I looked around the other parts of the documentation for another place for it to show up, but most of the mentions for glTF under features are about the glTF file loader plugin or the exporters from Autodesk. This seems to not fit as well with those topics, but we can add some cross links in the exporters page to the preparing assets for Babylon section.

4 Likes

Maybe if we were PHP developers instead of Javascript developers I’d buy us all lambos :joy:

1 Like

I’ll prepare a page draft in a week or so. Not all functions are documented at the moment :slight_smile: (and probably I’ll implement several more while preparing the documentation).
Feedback and contributions are welcome!

2 Likes

I know PHP a bit but coffee is OK for me. Stronger drinks should go to wgsl experts :slight_smile:

You got a point there. Tell you what: .aspx… :money_mouth_face: Never paid a dev as much as with aspx (microsoft certified). It was a client requirement back then :sweat_smile: :joy:

2 Likes

I could read the doc draft and (‘shit’) comment it :laughing:. Ensuring even people like me would find their way around it :sweat_smile: :grin: Don’t expect me to contribute to the code, however :joy: BTW: Great tool. Totally deserves proper featuring in the official doc :smiling_face_with_three_hearts:

Greate tool, optimized my project a lot! But I’am loosing UV’s on few of primitives :slightly_frowning_face:. How can I prevent this?
(pics before and after)


It is impossible to say how to prevent it without knowing your optimization settings.
Also, would be good to look at 3D model which you use, if it is possible.
Is it valid GLB file (I mean passed validation tests)?

1 Like

After multiple compressions of GLB, WebP may appear blurry. Can this problem be solved?

This is inevitable with lossy formats.
As a rule of thumb, texture compression/conversion should be the last and only step in optimization process.
So, in order to solve your problem don’t useTexture Resize and keep original texture till the last step.

3 Likes

I love your tool (already said but still) :slight_smile:

1 Like

Understood

Hello, may I know if this will ever have “Download with DRACO compression” or some DRACO compression option? Right now I have to use terminal to manually do draco compression with gltf-transform after optimizing the GLB file with this tool then check the final result with the Babylon.js sandbox and it’s quite a hassle… I think it would be nice if the tool has built-in DRACO compression support as well :smile:

I use gltf-transform draco input.glb output.glb --method edgebreaker to compress, though it fails for models that are optimized with glb optimizer tool and don’t have textures and I’m not sure why…

I hope so :slight_smile:
While node.js Draco implementation is quite simple, it is not so for the web environment; I know it is possible but still didn’t manage how. I hope I’ll solve this in the next update in February.

Meanwhile you may use Meshopt compression instead of Draco. Most of the times it is even faster.

1 Like

Note that Draco compression is coming to our glTF exporter, see:

Once it has been merged, you can take advantage of this feature.

5 Likes

That is great!

I just tried it on one of my characters, and it went from 0.90MB to 0.45MB

I put it into my game, but the scale of the model is now much larger (like 100x), and the orientation is now rotated around 90 degrees (the model is now laying down instead of standing).

I have been unable to open it in Blender to inspect it, due to this error
Extension EXT_texture_webp is not available on this addon version
Even though it was already using webp as texture format.

I guess it should be possible to tweak the exporting, so I get to keep the scale and orientation, I just haven’t had the time to look into it yet.

But overall this is great! I will definitely optimize all my models, when I’ve solved my current issue :slight_smile:
Thanks @labris :star_struck: