Grass

Started by
18 comments, last by soconne 19 years, 9 months ago
I'd like to render some sort of grass/plants on the ground... Any suggestions for a (reasonably performant) way of doing it? Cheers Andy
Advertisement
The easiest(and ugliest) is a quick texture-mapped quad. This works great if too much detail isn't too important, especially if you have a good texture. Any other way I can think of seems too slow for real-time graphics(games). If you want it beautiful, but slow, just render it with little triangles, just like everthing else.


First of all, did you even try to search for it? That should give you some nice links. Then there might be something on vterrain site or GT&P FAQ.
You should never let your fears become the boundaries of your dreams.
The book GPU gems I think has something on using pixel shaders to simulate fields of grass. I just looked at it in the store, but it looks like what they did was combine 3 billboards with grass on them like this:


x x
x x
xxxxxxxxx
x x
x x

This way some of the grass billboards are always facing. They repeat these things lots of times. Of course, they used the power and speed of the pixel shaders to do lots of fancy stuff to these things, but that's the basic idea, I think.
Oops, the post ruined my diagram. It should look like an X with a horizontal line running through the center.
Quote:Original post by unreason
Oops, the post ruined my diagram. It should look like an X with a horizontal line running through the center.

Try . ;P
If your billboards are animated, you can also get some nice wavy grass effects without the special shaders.
AndrewAurora Interactivewww.aurora3d.com
Actually the most popular algorithm is probably the "Shells And Fins" algorithm, which has been implemented for instance in the incredible life-like real-time fur demo (with source code) sumbitted to NeHe Productions last year. Despite the current lack of support of the site, there is still tons of very useful resource at NeHe Productions. :)
Ta to the community for all the useful advise!
Feel free to keep on posting. I'll post my decision on which model to use soonish.
Cheers
IMHO, the best tradeoff between speed and nicelookingness is to create a cylinder mapped with a color keyed texture. Works great for grass and grassy like plants (such as some waterplants and weeds). It also looks good from any angle, except if looked at from the top.
Most of the demos I've seen have a big plane with a grass texture, and while it looks good if the camera is pointed at the right angle, when you move the camera, especially looking downwards, or just rotating in place, it will look VERY ugly.

This topic is closed to new replies.

Advertisement