-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.x: Materials generated from .gltf file are too big in filesize #34641
Comments
Maybe |
Is there any way to avoid that without running a custom build of Godot? I've tried messing with the model's import settings, but couldn't find anything related to texture compression. |
cc @fire, as he has some knowledge about the glTF 2.0 importer. |
Looking!
You embedded something binary in the gltf2 file. I would try exporting as scn to check file size. There was other comments about text formats for example base64'd png files encoded as base64 versions. |
Indeed, text formats like |
I didn't embed anything in the gltf2 file, at least not on purpose. Could it be that some addons are causing the problem? I also tried disabling some functions that I don't need at the export stage (animations, skinning etc.) but it didn't reduce the size of the file. Thanks for the suggestion about the scn export, it doesn't include the textures inside the file like gltf, but at least I get to keep the size of my project small, as .dae didn't work for me aswell (I swear Godot hates me) |
Any update? I have a |
Might be duplicate of #31632 |
Is there any update on this? Would love to use gltf bin, but with this bug it is unusable. Here are my tests so far in different formats (all exported from Blender and imported to Godot). GLTF SEPARATE GLTF binary (and embedded) (only one generating the huge material): |
@Bleuzen As far as I know, nobody found a solution to this yet. Given how Godot's import system works, I'm not sure if we can even fix this at all. Maybe the textures embedded in the |
For me using gltf where you export text gltf and the textures to a textures folder as png etc works the best. |
@Calinou Any updates on this? My .material file sizes were too big. I realized it was the textures that were too big in size and I had to go through every file and change the texture compression mode to lossless compression. By default textures imported from .gltf material files are uncompressed. If textures were lossless compressed by default this wouldn't be a huge problem. Doing this reduced file sizes by 10 Mbs which also reduced scene loading times. My project size reduced by 1GB too after doing this for every material file in my project. There is no way of changing this in Import Defaults too. Sorry if I am missing something. |
Profile -> Set as Default in Import dock. |
@KoBeWi I am sorry can't find the setting you are talking about |
|
You mean these textures ignore defaults? Do the defaults work correctly for regular textures? |
Yes .gltf material files import texture with no compression and they ignore the import defaults for textures. I had to manually set the textures for each material to lossless compression and I will need to do this every time I import a gltf model with embedded textures. Unless there is a way to set an import default for this :/ |
Work for this was being done in #62499 It's blocked on astc support being merged |
@fire Awesome! When do you think this fix will be released? |
There is no ETA, but note that ASTC support will only be added in Godot 4 – it won't be backported to 3.x. |
I see, Godot setting built-in gltf textures to lossless compression would be enough for now. It is just a hassle manually setting all of them :/ And thanks for everyone informing me about this! |
This issue was solved in time for the release of 4.0, by extracting textures from glb files. It still exists in 3.x |
Godot version:
3.1.2
OS/device including version:
Windows 10 v1809
Issue description:
When you import fully textured .gltf scenes Godot automatically generates .material files for you. Unfortunately there's a flaw in it, because, for example - a door material is 13 mb in size while all the textures are barely 300kb in size. Also, the exported gltf is only 2,6 mb in size. Something's totally not right here.
Steps to reproduce:
Make a model in blender, make materials, export to gltf and finally import to godot.
Minimal reproduction project:
material-bug.zip
here's a screenshot of all of the wooden floor material files - they're only 718 kb in file size, while the material is 9,2 mb (!)

The text was updated successfully, but these errors were encountered: