Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Zylann | |
Old Version | Published before Godot 3 was released. |
I generate a mesh with SurfaceTool, but I wonder how can I define multiple materials for different parts of the mesh? Like: solid part, transparent part, two-sided part etc
The only way I have at the moment is create a MeshInstance node per material, but it sounds ineficient because the engine has to cull several times the same instance at the same position…
Just for the context, I am doing voxel terrain generation where some of the chunks have transparent cubes, some are two-sided and others might have special shaders etc.
In blender every object of a mesh for my projects has to be separate objects. Then I put them under a single object type then export. The engine really doesn’t have good support for meshes.
SupToasty | 2016-04-26 13:21
I don’t use Blender, I’m doing procedural generation within Godot directly.
I see there are “surfaces” inside a mesh, but SurfaceTool only allows to commit geometry in a mesh., and I don’t know how multi-materials work.
Do you mean I have to create a separate MeshInstance node for each part of my mesh?
Zylann | 2016-04-26 13:24
Sadly yes. If you don’t use a tool like blender you can’t get just one mesh.
SupToasty | 2016-04-26 13:27
I can get a mesh without Blender (otherwise it would be really really sad), the only problem is how do I generate it so it has multiple materials on it.
Zylann | 2016-04-26 13:29
Miscommunication on my part I forgot to add with multiple materials to the end of that last comment. Sorry. I known you can get a mesh without a tool like blender.
SupToasty | 2016-04-26 13:35
So you mean it’s not possible to get multi-materials on meshes that don’t go through the mesh importer?
Zylann | 2016-04-26 13:38