Jump to content
  • Advertisement
Sign in to follow this  
nDealO

Vegetation Rendering

This topic is 5397 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

Hi All, I am working on a terrain rendering project and I would like to add some vegetation for more realism. My inspirations have been coming mainly from Ghost Recon and Operation Flashpoint. Both have what I consider to be nice vegetation models. Currently, I am using an x-billboarding type of model which i am creating in 3d studio and then generate random positions for it. What are some good techniques for rendering vegetation? Just check each model's pos to see if it is in view frustum and cull the ones that are not? Should I store vegetation in a specific space partitioning structure (e.g. Octree)? Does anyone know of any good tutorials on how to make good vegetation textures, especially grass? Any help or guidance in the right direction would be much appreciated. --Neal

Share this post


Link to post
Share on other sites
Advertisement
I'm working on the same problem, and one thing I didn't expect at the beginning is huge amount of plant objects to render. For my world, there were several thousands of trees visible in the frustum. What was the issue, was the amount of drawing calls, which was a frame-killer. So the culling for each instance was impossible.
Instead, I am currently handling plants in chunks(as well as the terrain), so on that level goes the culling. In addition, I'm creating a merged mesh for each chunk, which contains plants of one type for the chunk. It turned out to be a huge FPS improvement.

Cheers.
/def

Share this post


Link to post
Share on other sites
You can check out my grass rendering demo

http://www.gamedev.net/community/forums/topic.asp?topic_id=272674

Share this post


Link to post
Share on other sites
There is a nice paper from Sigraph 95' by J. Webber and J. Penn called Creation and Rendering of Realistic Trees. The alogorithm covers LOD rendering using Full geometry as well as lines and points. The algorithm is awsome! and could be heavily modified to take advantage of todays hardware (in terms of CPU and GPU).

Parametric, procedural approaches have many benefits:
-Small storage requirements...for storage or network transfer
-dont have to be a skilled modeler
-can generate infinite varieties of similar or VERY dissimilar trees.

The cons are that:
-Take more CPU time (since models have to be constructed)
-In some cases have heavier memory requirements.

... Hope that enlightens u.

Share this post


Link to post
Share on other sites
Damn, I wish my card support geo instancing. I read that there has been cases of developers rendering over 30,000 complex models and keeping a frame rate of 100!!! That would work superbly for trees and such. Anyway, for grass, I would go with a procedural approach over creating grass models in a modeling package.

Also this is my own idea although im not sure if it's already been done, but you can create randomized 'patches' of grass and shrubery, build a bounding volume around it and then tree treat the patch just like any other entity in the scene.

Im sure this was already mentioned, but deffently use some sorta lod for both mesh trees and for the grass 'patches'. (ie. a grass patch that is x distance from the camera can have a lot fewer blades of grass rendered and still look very good).

ill be working on my own vegitation system soon ;)
~Jason

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

samgzman, could you tell us more about "Creation and Rendering of Realistic Trees"

do they provide source/example code?

Share this post


Link to post
Share on other sites
Quote:
Original post by deffer
Instead, I am currently handling plants in chunks(as well as the terrain), so on that level goes the culling. In addition, I'm creating a merged mesh for each chunk, which contains plants of one type for the chunk. It turned out to be a huge FPS improvement.

Cheers.
/def



How do you do that ?
I mean, if you have 300 trees, you need 300 drawcalls, how can you place 300 models in a single drawcall ?
Or did i miss understood ?

thanks,
Bruno

Share this post


Link to post
Share on other sites
As I was saying:
Quote:

I'm creating a merged mesh

Which means, I rip off the tree geometry from some amount of trees nad copy it that amount of times, transforming each tree to "arbitrally-choosen-one-base-tree" coordinates.
It uses more memory, but not that much, really. Preparing the merged model is not much longer, than rendering it, but it is done once.
And it really speeds up because you can process, as you said, 300 trees in one call.

I really cannot imagine, how one can handle 10000 draw calls in one frame and still have more than, say, 10 FPS ???
Another thought - am using as simple tree model as possible, about 50 triangles, and further away from the viewer - about 30 triangles. And my GPU chokes on me somethimes. How can people even imply rendering
Quote:
rendering over 30,000 complex models
being possible???

(confused)
/def

Share this post


Link to post
Share on other sites
Maybe i am wrong, but i dont think you have to make a draw call for each object. Cant you draw all objects into one buffer, and then draw that buffer. Should work as long as the textures etc are the same. So just group objects using the same texture and draw them into a buffer, then draw the buffer. Then set the new texture and do the same for the objects using the new texture.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!