Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Frequent runtime updates of Curvy Generator for simulating plant growth using Splines
#1
Hi! I've been using Curvy for a couple of months now and I like it a lot. I've learned a lot of its idiosyncrasies and read all of the Documentation and guides. What I'm trying to do is make a system for growing large trees (~100m tall) from tiny seedlings, all using splines. I'm using the Curvy Generator to do this, but I've quickly run into performance problems as I add branches to the tree. Each branch is a separate Curvy Generator, and each generator takes ~2ms to update each frame. Ideally I want 10-100 branches growing and updating at a time, so I need to get the Curvy Generator update speed down around 0.1ms for each branch. 

There are two kinds of updates happening:
-Branch extension, where I add new control points to the Input Spline Path while changing the local transform of the terminal control point to simulate branch growth
-Branch widening, where I increase the radius of a CSCircle at the base which dirties the Input Spline Shape and updates a Variable Mix Shapes Modifier to simulate branch thickening

These two types of spline updates, mainly via rasterization, account for ~60% of the update time and I would like for them to occur every frame. The rest of the update time is related to Create Mesh and I view that as unavoidable. A lot of the Editor functionality (Dirtying, checking Configured) seems to be slowing things down as well.

I have tried having two generators where only the tip of the branch is updated, but there aren't that many savings, especially because of branch widening and the cost of Variable Mix Shapes, which is quite high actually. I've employed all the other suggested optimizations, like reducing the rasterization resolution, disabling transform checking, spline orientations etc. What would need to be done to get a big network of splines growing fast?

So far my ideas are to speed up the rasterization procedure somehow, and to reduce the amount of cached information that is recomputed (Fpath, etc) each time a spline is updated since I am dealing with very frequent runtime updates to simulate growth. Specifically I've implicated InputSpline.GetSplineData as the main target of any optimization efforts

I kept getting Base Request 400 uploading my project on the forum here.
I included a sample project with my Generator graph and the code for building a tree at this link: <censored>
Maybe simple changes to the Generator can help?
Reply


Messages In This Thread
Frequent runtime updates of Curvy Generator for simulating plant growth using Splines - by h4ck3rd4wg - 10-01-2020, 04:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Information New free asset: Converter For Unity Splines _Aka_ 5 18 04-25-2024, 11:11 AM
Last Post: _Aka_
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 10 04-03-2024, 03:16 PM
Last Post: _Aka_

Forum Jump: