I’ve exported my models in Blender as .fbx files. When I’ve tried importing them to the Godot Engine, I’ve noticed that the imported materials do not have anything set on Roughness and Metallic parameters. This means that there is literally no Rougness texture and no Metallic texture being used in the material. All values are 0.
Now this is quite uh problematic. Especcially, when according to the metallic texture - only specific part of the wall texture have metallic applied. I geniunely don’t know what to do. There isn’t much answers on the internet.
I remember having troubles with normal maps not being imported and I’ve solved it by modifying the blender .fbx exporter addon but that do not relate to the Rougness and Metallic in any way (as even the default unchanged one still have same issue).
Please help me. I’ve already have many room .fbx models imported to Godot Engine being setup as scenes with all lighting nodes i’ve made. Is it the problem with the Godot Engine? Is it the problem with the Blender? If it’s with the Blender do I need to re-export and re-import everything to Godot Engine? If yes then is there any way I can just replace the .fbx model files in my project directory without re-creating the scene on that model
(I just need materials to appear. Technically, that’s using re-import button when right clicking on a model file but still i want to be sure that I am NOT gonna re-create all the scenes. There is so many of them…).
Overriding surface materials would also be quite problematic for the following reasons:
I have many (like 20-30) room models imported to the Godot Engine that have specific materials with specific metallic parameters.
It’s quite inconsistent. I mean I don’t really remember all the materials of each room model that have metallic parameters set. If I am gonna override surface materials of each room by hand then I am probably gonna miss one of the materials that actually had the metallic set in my .blend project file…
Godot uses a different rendering pipeline than Blender, exported models are not guaranteed to render the same and Godot can’t always convert the material appropriately. I’d recommend exporting your textures separately and creating a StandardMaterial3D in Godot with your textures attached to the correct mappings.
Typically you can overwrite a model file and Godot will re-import it without needing to edit any scene files.
Here’s the thing. I do not use anything fancy for the materials in Blender. It’s literally just ImageTexture connected to the Metallic property. Apparently it works for the Albedo but does not work for the Metallic and Roughness when the exported .fbx model is imported to Godot Engine which is weird.
There are also some materials that literally have just the number set on the metallic and roughness e.g. 0.5. And in the Godot Engine these numbers are zero.
Now as I said that would be quite complicated for me to override the surface materials of the imported .fbx model. Why? Because I have already 20-30 rooms imported which have their own props and walls and etc. There is so many materials that I literally don’t remember which materials exactly have the metallic property set. That would take up so much time for me just to replace all of that.
There must be a different solution! Godot Engine should pick the metallic and roughness!
Blender also defaults to no backface culling which can hurt performance, unless you want to re-export materials I’d highly recommend creating Godot-specific materials to replace any imported materials.
You can apply external materials the advanced importer on each model file, double click your fbx/glb file and select the materials, check “Use external” and path to your Godot created material. This will update every instance of the model in every scene, as it changes how the file is imported.
I agree it would be nice, but the FBX file format is complicated and I understand how hard it can be to write a perfect parser for a proprietary format. I believe Godot’s implementation is or is based on ufbx, you may have better luck exporting to GLB/GLTF as it is easier to parse for and not proprietary. Still though, the materials for one modeling software should not be used for a game engine.
I’ve clearly said that I can’t. There are 28 room models (I’ve re-counted) and the Materials on them are not consistent. Some material e.g. for walls at one specific room model will have specific metallic settings but on the other room model there would be no such settings. That would be so long and timey to go through all 28 rooms and go through all 28 .blend project files just to setup everything.
I do not want to do that. I hope you understand…
There must be an error either in the Blender addon .fbx exporter or in the Godot Engine addon .fbx importer… dear god I don’t know what to do. I hope it’s again just a problem with the Blender so I can idk edit the .fbx exporter addon and perhaps solve the issue. Maybe the .fbx model file have metallic and roughness properties being saved in such a way that the Godot Engine just can’t understand it (that happened to me with the normal maps)?
I mean I understand your idea. Just having the Godot Engine material files being saved in my project files and I would just use them on the imported .fbx models instead of using the automatically created materials from the import of .fbx models.
That’s quite a good idea. But to be honest I am not sure whether or not is this a good and common practice in the Godot Engine. And again… to be honest I would like to hear another solution.
If there is no such another solution or the another solution does not work for some reasons then I am going to go with what you just said
Sorry I didn’t realize you meant 28 models, I assumed you were exporting a dozen props and a few rooms then placing props inside of the rooms within Godot, which may be less files overall or at least less materials.
But the sad fact is it sounds like you have potentially 28 problem files and do not want to fix 28 files, with each file having a unique problem you cannot automate fixing this; such as EditorScenePostImport scripts that are often recommended. This makes giving advice quite difficult. I think the only thing that may perfectly solve your problem is fixing the Godot engine itself, and/or ufbx, but that also would take much longer than spending what really should be a few hours at most clicking through materials. Or just praying it is fixed in 4.6.
You shouldn’t have to open blender to implement the Godot materials through the advanced importer like I described, you would go through .fbx files inside of Godot.
Using Godot materials can make you more conscious of how many unique materials you are loading/compiling in the game, speeding up load time and reducing stutters. There are a lot of reasons to avoid imported materials, you will be fighting against the Godot importer and Blender’s exporter trying to get them to communicate when you could tell Godot exactly what you want; while re-using materials for better performance.
I am sorry, perhaps my wording was bad but…
What I’ve meant by “going through .blend project files just to setup everything” is that… each room model have it’s own unique problem and I can’t of course remember all the metallic and roughness specific properties of each material of the room model. So if I needed to create Godot Engine materials and use specifically them on the imported .fbx model instead of the automatically created ones then that would mean that I would need to go through my .blend project files to check each room model and each material for the roughness and metallic properties to set them in the Godot Engine…
In simpler words is that I would verify each material of the each room model that is in each .blend project file with the Godot Engine materials I’ve created so all settings would be the same.
Wow this is quite interesting. I have never thought of that and I did not know that. So you want to tell me that just having specific material files in my project directory that I just re-use speeds up the loading speed just because it’s a single same instance? Like it’s not an unique one from the Room B that needs to be again loaded even though it has everything the same as the other previous material on the other imported Room A?
Does this apply to the MeshInstance3D by any chance? Y’know when you duplicate that node the Collision Mesh of the duplicated and the original nodes will be the same. That means that if I change the settings of the Collision Mesh on the duplicated node then that same mesh would change on the original node. Now I am quite interested.
Thank you so much for telling me about all of that! I will perhaps think about creating material files and re-using them.
There are instructions in the docs. You’re gonna have to learn how to automate things like this if you’re going to make all your own models and import them, or you will drive yourself nuts with issues after issue. Because any import problems can be solved once and then you don’t have to deal with them again on re-import.
Yes if you used the same material for all of your walls, doors, rooms, props etc then Godot would only have to load (and compile) one shader for your entire game; of course this would look bad, but if you have similar-ish materials it is often better to merge them into one.
I could be the single largest performance bottle neck of modern games, shader compilation can be significantly reduced by reducing the number of shaders to compile (materials), and load times as each material may have multiple textures associated to load.
MeshInstances can also benefit from shared resources though I’m not getting your example with the collision shapes, those may require different mesh/polygon data to function properly. Collision doesn’t want to read UV/texture data for instance.
If your room model has multiple duplicate props such as barrels or doors then it would be better to export those separately and place them inside a room from Godot. This way Godot can reused the mesh data when loading, and use GPU instancing to draw all similar objects in one draw call, as well as create accurate LODs for the props.
Thank you so much for recommending and teaching me this. I did not know any of that. I will go with using Godot Engine shader files on imported models instead of using automatically created ones.
My example on collision shapes was for the case when: there is a room with two walls (on the left and right side accordingly). The left wall is the same as the right wall in every single way, especcially, in the size. It would be perhaps better then to use same colision shape instace on the left and right wall?
Yes I see what you mean now; Using the same mesh including collision would be better. You could rotate the wall instances in Godot, another trick to flip objects is to scale one axis by -1, though this usually breaks collision so it’s best for just visual objects.
In one of my games we created grate prefabs for the floor, a middle, corner, and side pieces were rotated and flipped to create a modular floor with only 3 loads and 1 material. The floor’s collision was a box shape.