#Modeling Grass Blades via Bezier Curve on the GPU

1 messages Β· Page 1 of 1 (latest)

frank oxide
#

So, I have a mystery that I was wondering if anyone could solve--mostly Visual Tech Art, because of his grass video: https://www.youtube.com/watch?v=gfQNjC69PCM.
I watched this video: https://www.youtube.com/watch?v=LCqeVnmcz3E&t=689s
But since digging deeper into his presentation and methods, I've found that I don't believe that he actually solved this problem the way that he says he solved it, mainly in the creation of his grass geometry. What I don't believe is the idea that he was able to drive his grass with Bezier curves via any math he could have done in the vertex shader of his grass material. I've watched Visual Tech Art's grass video and know that bending a straight piece of geometry into a curve doesn't actually utilize the tilt, height, bend and midpoint parameters that he was talking about. Unless I'm wrong, and you CAN use the material graph to create Bezier curves via world position offset. I haven't been able to come across anyone who's been able to make grass bend in there except for Visual Tech Art's. I've looked for many ways to bend grass, and since he's cited Visual Tech Art's video in the creation of his grass system, I'm of the opinion that he actually just used that method to drive the bending of his grass, haha. I'm over here wondering if I can do it via 3 GPU particles per grass blade attached to each other with the ribbon renderer thrown on to render it--which is probably not very efficient.

[DISCLAIMER] I know, this video is not very easy to follow, it requires some more than basic knowledge of the subject, but I think everyone should be able to wrap up his head around it eventually.

Here I illustrate my personal take on getting a realistic and good looking wind animation for the grass. As always I'm more than open to any feedback...

β–Ά Play video

For a long time, mesh cards were standard for rendering grass in games – but it looks flat and artificial. So single-mesh-per-blade technique came to the rescue. It was used in games such as "Ghost of Tsushima" and "Zelda: Breath of the Wild" – and you have to admit: the grass there looks fantastic. During this talk, he will guide you through im...

β–Ά Play video
rare idol
#

Hey, just dropping by this thread to say this is extremely cool and interesting. I have no answer to your question but I would love to see where this goes so im gonna follow it!!!

frank oxide
#

So what I can say now is that you can push mesh vertices into the shape of a Bezier curve via WPO if you have a straight standing grass mesh. It just took me a while to understand how points along a Bezier curve are calculated. If you understand that, then you can pretty easily push them into position; I highly recommend going to the DESMOS example that Radoslaw has in his slides if you'd like to learn more.

rare idol
true owl
#

@frank oxide and @rare idol, how's it guys? Looks interesting. I don't know if you've fully solved this or not, but in principle, you could probably have a mesh with UVs representing the grass blade (as shown in the second video) as data input.

Not only can you use this for a color gradient and other maps, but the UV.y component is also the t parameter for the Bezier math (curve and derivative), meaning in a vertex shader, you plug this value into "prog" (progress) as he has it named on the slide. This interpolates the Bezier curve for 3 control points, one at (0, 0), the second at "mid", and the last at "end". He also manipulates "mid" (and possibly "end" - as indicated by the animation on the slides) cyclically using the "tilt" parameter and sines and cosines. As "tilt" increases, the grass blade "mid" will circle round and round. "bend" is the amplitude of that move.

Once you calculate the Bezier part, you assign the vertex to the appropriate position with some offset (perhaps using the mesh coords or the UV.x) so that points with the same UV.y don't end up in the same spot. Then there could be per instance data that orient each grass blade randomly or something. Oh and you have the derivative of the Bezier here as well, so you can compute and assign a normal here and so 3D shading will work.

The other (first) video uses circles to achieve a similar result. I guess the main difference is that it doesn't stretch the geometry.