Jump to content
  • Advertisement
Sign in to follow this  
DerAndiY

Grass

This topic is 5085 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Oops, the post ruined my diagram. It should look like an X with a horizontal line running through the center.

Share this post


Link to post
Share on other sites
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 [ code ][ /code ]. ;P

Share this post


Link to post
Share on other sites
If your billboards are animated, you can also get some nice wavy grass effects without the special shaders.

Share this post


Link to post
Share on other sites
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. :)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!