So, I like writing shaders, and a lot of the time I use shaders instead of textures on my models. However, I’m having a hard time finding a non-clunky way of doing this in Godot.
When I import a .glb it shows up as a scene and so I export the mesh data of the scene as its own resource file. Then I make a MeshInstance3D node and use the exported mesh data as its mesh. I can then apply a custom shader material to this node.
This leaves me with a lot of steps to recreate every time I want to reimport the model, and it also leaves me with two separate files (the .glb and the mesh .tres) for each model. This does not seem like a very good workflow, and I have to wonder if there isn’t a better way to do this.
I believe you can use import scripts to solve this issue. I haven’t messed around with them yet but anything should be possible (see Godot Docs | Import Configuration).
Creating your own import script should let you automate the steps you’ve outlined:
Exporting a separate resource for the mesh
Creating a new prefab-scene containing a MeshInstance3D
Applying your shader material to the MeshInstance3D
Right, thanks! Less convenient of a solution than I’d hoped, but I do believe it’ll do the trick.
Really wish there was a way to change the material of an imported model without having to extract parts of the model scene into a separate resource file, though.