Implementation of MultiMesh SetInstanceTransform(and SetInstanceCustomData) batching #12582
Jpegz0
started this conversation in
Engine Core
Replies: 1 comment 1 reply
-
It is funny that OP looks too gpt-generated, but it is not generated by gpt (or at least not completely) 😄 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Godot Developers,
I would like to propose an enhancement to the MultiMesh API to improve performance and usability when updating large numbers of instances.
Current Situation:
Methods like MultiMesh.SetInstanceTransform2D() and SetInstanceTransform() only update one instance at a time.
Similarly, SetInstanceCustomData() also updates a single instance’s custom data per call.
Looping over a lot of instances to update them individually causes signifiacnt overhead due to repeated function calls and internal processing.
Proposed Improveent:
Introduce batch update functions that allow updating multiple instances' transforms, custom data, and potentially other per-instance properties in a single call.
Examples could include:
SetInstanceTransforms2D(int fromIndex, int count, Transform2D[] transforms)
SetInstanceCustomData(int fromIndex, int count, Color[] customData)
Providing options to batch-update any instance properties currently limited to single instance updates would greatly improve eficiency.
Benefits:
Performance: Batch updates reduce CPU overhead from repeated calls and enable internal engine optimisations.
Clean code: Developers can update many instances with fewer calls, simplifying code.
Scalability: Critical for projects with large numbers of dynamic instatnces, such as procedural generation, large particle systems, or massive crowds.
Use Case:
My project requires updating millions of instance transforms and custom data every frame.
Currently, the per-instance API casues performance bottlenecks.
Batch update methods would allow passing data arrays directly, minimizing overhead and boosting frame rates.
Thank you for considering this feature! Adding batch update capabilities for MultiMesh instance properties would be a powerful enhancement benefiting many users working with large-scale rendering.
Beta Was this translation helpful? Give feedback.
All reactions