I needed something to deform instanced meshes of trees for two reasons : roots/base shall be aligned with terrain slope, and top shall sway with wind/interaction. @rokojori.bsky.social made a curve-to-curve geometry deformation and i thought it was a good idea.
Code published. You might be disappointed by the simpl-ish Sinton I've chosen. I'll know work on curve-to-curve transformation. I know how to determine the curve parameter from a vertex, but i need it to be slightly optimized/tricked.
I'm mot disappointed at all, if you meant me ^^ Not sure however, about the need of the beziers. I'm usually using noise to offset vertices for wind. For a gpu vegetation system I'd use sth with only 2 poses. Bottom aligned to heightmap and than a moving one for the top...
Oooh, I've misunderstood what you've done, and I've come with a different idea 😅 my need was to align vegetation roots (or any object base) with the terrain slope, while being able to sway the mesh at the top. So cubic bezier was the simplest solution due to the curve nature.
...but if you want real fancy deformation, it could be quite interesting. Maybe also as an effect. I would still consider not using beziers and use something where you lerp 2 poses linear of multiple poses instead of computing one pose from a bezier (which is using 4)...
Really interested in the code for this! I'm in 2d right now and solving the stationary base - swaying top problem with a shader biased by the uv but seems like I could at least learn a trick or two from this
Comments