Doubled up embedded textures in GLTF Separate files in Needle with UnityGLTF

Same as title, noticing 4k textures going out as 4k when in Unity they were set to max size 2048. Noticed this as my builds went up by 50% in size recently on a project. I have a repro project I can send.

Override for Needle Engine settings are also ignored when I ticked that and set max size 2048 x 2048, it still spat out them as 4k/8k in the exported GLB under dist/assets

Original Post on Discord

by user 103054507105067008

Some textures even going out as 8k rather than being compressed down to max size, I left Override for Needle Engine unticked for all textures and left at Unity default import settings max size 2048x2048

by user 103054507105067008

Changed the channel name: Texture Max Size being ignored by 2.58.1-pre

by user 103054507105067008

This is not editor specific as I just rolled back to the original version of Unity I was using which was 2022.1.23f1 from 2022.2.1f1

by user 103054507105067008

Rolled back to 2.55.2-pre and it still happens, I might need to send a repro as I’m stumped

by user 103054507105067008

@marcel :cactus: Repro project is here, apologies about the size, it is just one model with some hefty textures and some of those still go out as 8k/4k in the export https://drive.google.com/file/d/17e7OekLQNQEU4dWJsHATdAgSfJMgNIgw/view?usp=share_link

by user 103054507105067008

Is this a pass-through glTF object? Like, a glb or gltf on disk that you just dragged into your scene and added the GltfObject component?

It is a GLTF + Separate Bin file that is import in Unity then dragged into the scene as a child under GLTF Object

by user 103054507105067008

The textures being separate all have import settings set to max 2048x2048 default in Unity

by user 103054507105067008

OK so the inspector for GltfObject doesn’t look like this? Just to make sure
image.png

Nope, not doing anything different with this model to my usual workflow, only just started using GLTF + Separate files so that I can manage textures separately
image.png

by user 103054507105067008

by user 103054507105067008

Understood. Will take a look

You’ve seen that you can override individual texture settings for GLBs now as well, right?

Was using this model in a build for a client only recently noticed that the build sizes swelled so I investigated this. I was using GLB embedded before and the override texture settings are super useful!

by user 103054507105067008

by user 103054507105067008

It seems like youre still using textures embedded in your model file

when i export a cube with a material and just the texture (4k) set to 2k it gets exported in 2k res as configured/expected.

That being said there was a change that caused texture resize not being passed to UnityGLTF anymore directly thus the resize only happening when doing a production build/ applying compression. I’ll add a fix for that

Additionally another issue caused the embedded compression options not being selectable in 2022 it seems which should also be fixed in the next version.