-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow GridMap to combine child meshes into a single MeshItem #7970
Comments
We missed the 4.2 feature phase but I’ll try to champion this for 4.3 |
This is different from merging actual mesh data though (which has its own complexities when it comes to managing materials). Here, we want multiple overlapping meshes to draw onto the same tile. |
It's a shame Godot doesn't have a MultiMesh type node that allows multiple meshes to be non-destructively combined into a single mesh at runtime, and that could be interchangeably used in Gridmap. |
This is exactly what godotengine/godot#61568 does, but it's not as relevant for 4.x given draw calls are cheaper in Vulkan and automatic instancing is performed when possible. There are still some benefits to mesh merging in Vulkan, but the drawbacks (such as material handling and increased loading times) remain the exact same. This tends to tip the balance of mesh merging towards "not worth it" in most cases. |
Hey, I've looked into this issue (encountered a similar situation where I didn't want to merge objects in Blender but have multiple parts on the same grid position). @elvisish for this particular case, assuming the object is modelled in blender, it might be easier to just create one fence object and use an array modifier to duplicate it. As the modifier is applied upon importing blender in godot, you would end up with one mesh which can then be used by the gridmap. |
I can recognize that there's likely significant difficulty in implementing this, but I'll add that I do have use for this feature. It may not require merging the meshes, just letting the GridMap's mesh library stack meshes when created. |
Describe the project you are working on
Walking simulator.
Describe the problem or limitation you are having in your project
It's inconvenient to have to use the CSG addon to combine multiple meshes into a single mesh in order for them to appear as one MeshItem in MeshLibrary. It's also confusing when importing a GLB that contains multiple meshes into a gridmap meshlibrary and only one of the meshes is used.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
When building the meshlibrary, godot should combine child meshes into a single meshitem.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This:
Should be combined into a single meshitem when building the meshlibrary.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It would be a gridmap enhancement. The current workaround is installing Ed's CSG to MeshInstance (https://godotengine.org/asset-library/asset/1425), painstakingly adding each mesh into a CGSMesh, adding those as children of CSGCombiner and destructively combining the meshes into a single mesh.
If in Blender, merging the meshes before exporting to GLB.
Is there a reason why this should be core and not an add-on in the asset library?
Gridmap core.
The text was updated successfully, but these errors were encountered: