-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Actual pipedream shit right here, but it could help with editor responsiveness and having lots of Trail3Ds, probably even more if I rewrote stuff in Mono...
In the current code, every time a line gets updated (every curve change for Line3D, every frame for Trail3D), a completely new ArrayMesh is produced. That's an unnecessary new memory allocation we could probably do away with if we could literally update the surface directly. We generally know the vertex count of what we're gonna draw anyway, and Trail3D doesn't change vertex count at all!
This function can apparently do it: https://docs.godotengine.org/en/stable/classes/class_renderingserver.html#class-renderingserver-method-mesh-surface-update-vertex-region
("If you're gonna have it be that complex, why not just write a Godot module directly for ultimate performance and flexibility?" Because I like fancy shaders and I'm scared that I won't be able to reimplement the stuff that makes them work! Also I don't know how to program, I just script...)