-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Add multimesh_get_buffer_rd_rid
method to RenderingServer
.
#98788
Conversation
Fixed styling error pending re-run of workflow review, sorry for all the extra commits, still figuring this out. |
The error blocking the merge appears to be related to that regression you mentioned in rocket chat |
Are you familiar with this error?
I think the class is called something else. |
It's |
Should be resolved with latest commit, I tested this one in gdscript should be good to go. I keep breaking things lol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me! I have just one suggested change in the dummy renderer
multimesh_get_buffer_rd_rid
method to RenderingServer
.
Would you be interested in doing this for the rendering server part of MeshInstance3D? I want to use it for Opensubdiv and Delta Mush compute shader editing of rigged skeleton meshes. https://github.com/V-Sekai/godot-subdiv https://github.com/V-Sekai/unity-mesh-deform-direct-delta-mush |
I am going to be honest, I just spent two hours trying to sort out the merge conflicts for this, it was very nerve wrecking, after this thing is merged I might go hide under a rock for a couple months. |
I want to access enough of the ArrayMesh/Mesh to compute new meshes from nothing or at least be able to implement compute shader mesh skinning (or subdivision) for fame and profit! |
Sure sounds interesting, let me have a gander, I'll see what I dig up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Please squash your commits into one, see the interactive rebase for details |
Currently there is an issue with this branch, if you have a GPU particles3D in the scene with Transform Align set to Z-Billboard, it will throw continual errors if you update a multimesh buffer via it's Rid randomly (in my test scene it can sometimes take a couple hundred updates for the error to occur.) I'm going to work to see if I can resolve this. |
Fixed style error. Updated dummy mesh_storage to move from cpp to h the return of a blank Rid on _multimesh_get_buffer_rd_rid.
I resolved the issues from @AThousandShips and squashed all the commits into one, the issue with the GPUParticles3D compute shaders being called outside of the render thread is unrelated, see this issue here: #99025 |
Thanks! Congratulations on your first contribution! 🎉 |
Woo! thank you xD |
Implements a method ( multimesh_get_buffer_rd_rid ) which can be called on the RenderingServer, which retrieves the RenderDevice Rid of the buffer, this allows direct manipulation of the buffer, without having to take it into the main thread, this lets you perform operations like copying, but for my purposes it is more important that I can now pass that Rid to a compute shader running on the global render device, letting me write to the buffer directly in the compute shader.
This has been tested on GDScript and Mono, though much more extensively on mono, I only fetched the buffer and read it on GDScript, on Mono I used a compute shader to generate foliage, with very little performance cost.