• 3D
  • Workflow for importing glb and editing Materials

In our current project we have exported single meshes (some with multiple materials) from Blender as glb into Godot.

We import the glb, press "New inherited" and save that to a scene. This scene still references the glb and gets reloaded if we make changes to the glb.

We want to make changes to the materials inside the mesh. The godot docs say about this use-case that we should choose to store the materials outside of the glb and mark "Keep on reimport".

Our problem with this is that the created material files are too large. For a glb that is 4mb the three material files amount to a total of 15mb. If we choose .tres instead of .material the files are even larger! I've noticed that the textures inside the material such as albedo are marked Uncompressed but I have no idea how to specify that it would be fine to import those lossy.

Are we missing something about the way we should work with glb scenes in Godot?

The GLB import is messed up, as far as I'm concerned, and should never be used. It makes things easier for simple testing, but it's inflexible (you can't edit the textures), takes significantly more file space (as the images are uncompressed), and also results in horrible performance loss (about half, or even less, the performance of separate textures with VRAM compression). So you should not use them, I believe the docs are either incorrect, or there is a serious bug in the engine.

When you export from Blender, you should select "glTF + bin + textures". Then in Godot, select all the textures in the system (you can shift/control + click to select multiple) then go into the import tab and make sure they are all set on VRAM compressed. This will have the best performance. If performance is not a problem, then you can alternatively select Lossy, and set to compression to a lower number. I found that even 0.7 still looks good and almost indistinguishable, but saves quite a lot of space on the disk.

Thank you very much! Since the docs recommend glb and a binary format sounds efficient, we didn't even consider using gltf. It worked and we can easily edit materials once we make them unique in the scene . Also having the textures as external references is great for when we're reusing textures across meshes.

Yeah, maybe I will go in there and update the docs, because I followed them and it wasted a lot of time on my last project because they are misleading (at best) or just wrong. But in Godot 4.0 the texture compression has been updated, so maybe they fixed this issue.

Our problem with this is that the created material files are too large. For a glb that is 4mb the three material files amount to a total of 15mb. If we choose .tres instead of .material the files are even larger!

This is because the textures are embedded within the material files. If you manually save the textures to be external PNGs or JPEGs, the .material or .tres files will be much smaller.

I'm new to Godot and have thus far only used Godot 4 Alpha 1 and 2. I do have some years of experience with Unity. So this is why I'm accustomed to a particular workflow. I have a similar question regarding working from blender to Godot. Currently there are 3 ways I tried to dot it:

  1. Referencing the .gltf directly in a scene
  2. Creating an inherited scene from the .gltf file and referencing that in a scene
  3. Using the "Set Mesh Save Path" action and than referencing the extracted Meshes in 3DMesh Instances.

Solutions number 1 and 2 don't seem to work at this point and that might be because of a bug in the early alpha releases. The 3rd solution does seems to work but is very cumbersome.

So my question is... am I thinking in the right direction or is there something I'm missing?

Inherited scenes are working for me. After you import the glTF, right-click it in the file window on the bottom left, then choose "new enherited scene". Save the scene that opens, and now drag this into the tree.

Hmm this is what happens to me when I make an inherited scene. as you can see the mesh data is not connected. Once I open the import settings for the gltf file it does show that there is actual correct data

Changing up the flow with an added "reimport" and "closing the inherted .tscn get's the box into a scene!

After reimporting the box bigger though....

It does not update in the scene:

Only after i restart Godot, it updates:

Pretty weird workflow... but getting closer to get it working :)

You don't have to restart Godot, but sometimes you have to close all scenes open in the editor and reopen them. Not sure why this is, because sometimes it does work, but it's just a quirk.