Jump to content
  • Advertisement
Sign in to follow this  
b3rs3rk

Grass rendering (screenshot)

This topic is 4870 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've implemented the method described in chap.7 of Gpu Gems.. it's really far from perfect, but it's cool :D Here's a screen: A single grass patch is made of 3 quads, rendered with a display list and animated via vertex shader. The "unique" problem is the framerate (lol): i get ~200fps with a single grass patch and ~10 with 9000 on a Gefo Fx 5700 LE with 256mb.. There are lots of things to improve, first of all the appearance (yes it's cool seen in action, but the patches always look as a crap...), so if anyone has some advices, please tell me ^__^ [Edited by - Shannon Barber on July 14, 2005 8:57:56 PM]

Share this post


Link to post
Share on other sites
Advertisement
Hi there... I did a similar implementation of my grass engine, but I used immediate mode with sin() animated vertexes.... works like a charm and speed is quite high too....

a display list for 3 quads seems like a bit much CPU overhead... ? :)

Share this post


Link to post
Share on other sites
It would be an overhead if i render few patches... remember that i draw ~9000 :)
anyway,do you have a screen of your grass engine?

Share this post


Link to post
Share on other sites
/could have sworn he posted something in this thread...maybe it's one of those twilight zone where only I remember stuff and everyone think I'm crazy ...

SB - It got deleted, I scavenged it:

Here's some tips to accelerate your rendering:
Try batching several grass objects together to reduce the number of glDraw{Elements|Arrays}.
Use interleaved arrays and indexed geometry.
Compile your geometry into several VBOs where each VBO represents a region in your scene that has its own AABB that could be used for frustum culling.
Try experimenting with the count of grass objects per grass-region.

Try packing your vertices in 32 bytes memory chunks, the following struct does that for ya if you have a vertex program-ready hardware.


typedef struct gVertex
{
float translation[3],
uvCoorinates[2],
vertexCooridnates[3];

} GrassVertex;

Later on in a vertex shader add translation to your incoming vertex position before multiplying it by the modelviewprojection matrix.

[Edited by - Shannon Barber on July 14, 2005 8:49:12 PM]

Share this post


Link to post
Share on other sites
does the fps increase lots when u make the window smaller?
if so than VBOs, drawing fewer batches etc are not really gonna help

Share this post


Link to post
Share on other sites
thanks :D i'll modify my map editor adding the code for placing the grass (using large zones of grass, not a single patch).
The next thing i should improve is the appearance.. so if someone has a better texture that can share, or some advices to make the grass a bit more "smooth",please tell me :/

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!