Unity mesh and texture compression settings do not match gltf-transform inspection

My exported glb is ~100mb with no mesh or texture compression. After setting textures to WebP at 1024px and enabling Mesh Simplifier, it is reduced to 25mb. However, using gltf-transform inspect it lists the textures as jpg. I’m able to get further reduction to 15mb switching to WebP.

After I manually run it through the full gltf-transform gamut, I can get it down to 2.8mb. Of course this doesn’t produce a drop in replacement, however the lack of WebP textures from the Needle export makes me wonder if some of these settings are not getting applied.

Unity 2021.3.5f1 on MacOS Apple Silicon

Original Post on Discord

by user 300386587278049291

I assume you inspect the glb after a production build? If they are still jpg it would suggest that compression wasnt applied. When you set texture or mesh compression settings they will be written to the glb on export from unity and are only applied when you make either a production build or run the command for testing in local dev via the ExportInfo context menu (Compression/Apply compression)

The size reduction you mentioned above might just come from setting the texture max size to 1k which is applied on export already :slightly_smiling_face:

You can also use https://gltf.report to check the textures

Cool tool! And yes I am building for production - I just used the above to inspect the glb from /dist/assets and its all jpeg, I assume the mesh simplifier isn’t running either

by user 300386587278049291

Sounds like the optimizations are not running. Do you get any logs in unity regarding compression when you make a production build?

WARN: failed to re-assign extension: NEEDLE_compression_texture 71 71 72

by user 300386587278049291

Thats ok. What do logs say above? Which version are you currently using?

lots of:
textureResize: Skipping, no settings found

by user 300386587278049291

(i have 1024 and webp override set for every texture)

by user 300386587278049291

Progressive transform finished in 0.0 sec.

by user 300386587278049291

Can you send a screenshot of your hierarchy in Unity?

image.png

by user 300386587278049291

inspection also yields these warnings:
"Missing optional extension, "NEEDLE_gameobject_data"." "Missing optional extension, "NEEDLE_components"." "Missing optional extension, "NEEDLE_persistent_assets"." "Missing optional extension, "NEEDLE_lighting_settings"." "Missing optional extension, "NEEDLE_compression_texture"." "Missing optional extension, "NEEDLE_mesh_compression"."

by user 300386587278049291

How are you building?

/ exporting.

I’ve done both File > Build and Needle > Export and build Dist (Production)

by user 300386587278049291

Im a bit confused because the “failed to reassign” warning sounds like its running as expected and the missing optional extensions sounds like it wasnt exported using the needle exporter but maybe UnityGltf directly?

Which needle engine exporter version are you on?

image.png

by user 300386587278049291