-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Merge/batch different meshes at import-time #901
Comments
I have a custom_module for this https://github.com/godot-extended-libraries/scene_merge/tree/master. Please review. It's not in the Godot Engine pipeline for submission, but you know how to ping me on Discord. |
I didn't consider custom modules, thanks for the ping - IIRC they became easier to use with a very recent PR, didn't they? |
Why can't this be done in Blender or another 3D graphics application before creating the collada file? |
The closest attempts are either proprietary or don’t work. https://www.rizom-lab.com/ One draw call tech. https://github.com/Grim-es/material-combiner-addon This doesn’t work. There is a unity tool to bake avatars to one mesh, but I only have pictures that it exists. Can't find the git repo. It relies on the flattening materials to a square and render via the camera. Microsoft’ Simplygon and Unreal Engine’s voxel lod tools exist too. The closest viable project to contribute is Blender’s GPL plugin. I prefer mit for remixing. My plan is to chain merging -> mesh tri decimation -> export to gltf or fbx inside of Godot. The ui is already being worked on Concept Graph. https://github.com/HungryProton/concept_graph The described pipeline works manually. Thanks |
In case it wasn't clear, I was thinking of static meshes, not characters. @fire: Unity has a built-in function: https://docs.unity3d.com/ScriptReference/Mesh.CombineMeshes.html An open-source asset: https://github.com/mogoson/MeshCombiner (and at least one more on the asset store that I once used, but can't remember the name of) @aaronfranke: In many cases, the assets are gotten from elsewhere (asset stores, Blender Kit, free sites like turbosquid) and a programmer cannot be expected to know his or her way around Blender (I have used Blender a bit, but I wouldn't even know where to start looking). |
This is also a requirement for hierarchal lods in Godot Engine. The idea behind that is you combine arbitrary clusters of meshes and then decimate. This is not needed for lod imposters though. |
Since this was repeatedly mentioned: The cats plugin requires you to install https://github.com/Grim-es/material-combiner-addon and I had trouble getting meshes to merge. It might be me though. |
I see a need for merge meshes as well. As far as I understand there is only one way to regenerate the NavigationMesh by calling create_from_mesh, but you can only add one mesh. If I dynamically need to generate the level at runtime it would be so good to have this feature. |
I wrote a simple function on a script that can merge the meshinstance array into one. I'm not sure about performance and so on, but it seems to work for simple meshes with one uv, tangents, and vertices. If it would be fast and would be a part of the engine, in C++, perhaps it would make sense to merge static objects for the sake of reducing the number drawcalls. I would like to consult and ask if such a function makes sense for merging into a single collision shapes grid? |
Available at runtime in godotengine/godot#46130. If there's interest I can try and make this available standalone (maybe in a second PR). |
A second PR, pretty please? I know the portal occlusion has taken you quite some time so let's not hold it up further... |
Ah forgot this, for basic functionality it just needs binding two existing functions potentially:
The latter one might need tweaking slightly as the binding requirements for gdscript can be a bit fiddly. If that worked we could look at any UI improvements that could be made to make it easier for users. I've also currently been banditing this for LOD development so you can do deduplication + simplification + vertex cache optimization at the same time, but that may be better as a separate function call. |
Describe the project you are working on:
3d racing game
Describe the problem or limitation you are having in your project:
Collada files import as several meshes instead of one.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
An option to merge meshes.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
It could be an import-time switch, but a more generic solution (preferably exposed to GDScript so that I could merge already imported assets/scenes via tool scripts) would also be necessary.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Nope
Is there a reason why this should be core and not an add-on in the asset library?:
Import-time switch cannot be done via an add-on. There was an asset that claimed to do the generic kind, but it crashed on Collada imported meshes, it only worked for Godot primitives.
Original issue: godotengine/godot#7844
The text was updated successfully, but these errors were encountered: