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

Ok - i see if I can get this version out today, maybe that was what was causing the bigger textures there

Just want to note that some (all?) versions of glTFast import separate textures as subassets again to ensure texture settings are correct. UnityGLTF does that differently

I exported both production dists here, one is using GLTFast and one is using UnityGLTF you can see the UnityGLTF one is twice the size. All I did was change the importer from GLTFast/UnityGLTF between builds with that repro project:
https://drive.google.com/file/d/1Tjb-jAsWRulJtP6toXNk1Lp8cXuIrSI5/view?usp=share_link

by user 103054507105067008

“twice the size” can be expected as we’re setting 100% texture quality. Please compare texture counts and sizes :slightly_smiling_face:

Texture count is almost identical (33 vs. 35) but seems you also exported the skybox, so that is one more in the UnityGltf export

How can I override UnityGLTF setting 100% texture quality on those textures? They are GLTF + separate textures and I didn’t change their import settings at all between switching GLTFast and UnityGLTF

by user 103054507105067008

Feels like a bad user experience when the separate texture import settings are unchanged just the importer on the base file is changed and that doubles the sizes of the textures or am I missing something :sweat_smile:

by user 103054507105067008

You plan to do a production build in the end right? So its better to export with the best possible quality now and apply compression to that instead of exporting with lower quality from the beginning

I do but not at double the size, I found that in 2022.2.1f1 with 2.58.1-pre I can’t actually select the Needle import settings override for those textures that appear as embedded in the GLTF+Separate file with UnityGLTF
image.png

by user 103054507105067008

See

Try updating to the latest version please

That fixes it, I can now see that the texture import settings with UnityGLTF there are 100% size or 4k which is the issue as Herbst mentioned. The issue here is that the textures are in a separate folder already with their own import settings, but UnityGLTF treats them as embedded textures so the textures have 2 import settings. This is an issue when switching between GLTFast which uses their own texture import settings, and UnityGLTF that treats those separate textures as embedded and gives them their own import settings, ignoring the import settings of the source file

by user 103054507105067008


by user 103054507105067008

So if I have the texture import settings for the separate textures of a GLTF+Separate texture configured already on the actual texture file, can UnityGLTF/Needle respect that the file is a GLTF+Separate and use those texture import settings already? Or clone them across to the version of the texture on the UnityGLTF import hierarchy that looks like it is embedded? There is no point in having 2x the texture import settings in this case and it caused this issue as I was looking at the texture import settings on the textures themselves and the settings there are ignored/overriden by the UnityGLTF import.

by user 103054507105067008

This also makes me wonder if I have another UnityGLTF imported GLTF+Separate file using the same separate texture, would Needle then export 2 of that texture as it treats them like they are embedded in the GLTF itself?

by user 103054507105067008

Only textures that you use in your materials or reference via a script or a referenced asset are exported, no matter if they exist in the source asset that you use or not.

I will see if the newest version fixes this, I can see if clicking on the materials in the UnityGLTF import, the textures link back to those ‘embedded’ versions not the ones outside the file in the /textures/ folder, I would prefer UnityGLTF respecting that the materials link to the separate textures in /textures/ as those already have their own import settings

by user 103054507105067008

I agree, me too :slightly_smiling_face:

I dont think it will be fixed by clicking on the materials tho.

Because UnityGLTF suddenly makes all the materials in the file use its own internal imported versions of the textures it led to a bad user experience with me on this

by user 103054507105067008