Skip to main content
GameDev.net gamedev.net
🔒 Locked

Vegetation Rendering

Started by nDealO Oct 5, 2004 at 9:41 PM 10 replies 2.6k views
Original Post
nDealO
nDealO
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
deffer
deffer
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
tomek_zielinski
tomek_zielinski
There was superb topic about vegetation, where Yann described nice tricks.
www.tmreality.com
soconne
soconne
You can check out my grass rendering demo

http://www.gamedev.net/community/forums/topic.asp?topic_id=272674
Author Freeworld3Dhttp://www.freeworld3d.org
samgzman
samgzman
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.
yodaman
yodaman
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
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
Bruno
Bruno
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
deffer
deffer
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
Allmight
Allmight
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.
-------------------------------------------------Founder and DirectorAllSoft Studios
deffer
deffer
Maybe I'm wrong ;) but what do you mean by "draw all objects into one buffer", into one 2D buffer? It like looking at the world from only one point of view, isn't it?
_DarkWIng_
_DarkWIng_
deffer: Transform all objects in a group into a single buffer using CPU. Then upload this buffer and render it using only 1 call. This is almost necessery to keep good framerate.

One thing that has not beed stated enough here is the importance of LOD. This will save you or doom you. Rendering forest with all trees at max detail will kill your performance. So you have to some kind of transition form full detail models to a bit lower detailed models of individual trees to chunks of trees to imposters or even pregenerated textures at last. All this is also combined with shader LOD.
You should never let your fears become the boundaries of your dreams.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.