Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

_DarkWIng_

Tree/Forest LOD

This topic is 5545 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 been trying to add some kind of trees/forest to my terrain engine. I''ve implemented a semi-random tree generator simmilar to nVidia''s tree demo. Now the trouble is drawing lots of these trees. Since one tree is +2000 tris, so there is no way I can reneder more then let''s say 150 of them at decent framerate (I''ve tried just about all the tricks I know.. [all data in VRAM, cache optimized tri-strips,... ]). So I need to implement some kind of (C)LOD. I was thinking about imposters as they are used in forest scenes alot. But the problem is in how to implement them. I realy have no idea how to setup projection matrix to render them. Transformation matrix should be the same as for normal rendering, right? And even when I have it on texture, how do I make smooth transition from 3D geometry to imposter. I kind of doubt simple fade-in/out will do. Any help would be welcome (links, tips&hints, code,...). Or if you have better idea for tree/forest LOD please tell. You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
Advertisement
To find out more about imposters, look up billboarding on google. And if you have a tree generator kinda like nvidia''s, can''t you make the trees a different LOD in realtime, just by reducing the depth and fullness of the trees as they get farther and farther away from the camera?

-------------------
Realm Games Company

Share this post


Link to post
Share on other sites
For switching out from a model to a sprite imposter, a simple alpha-blend is actually plenty. Especially if it is likely that other things are going to be in the way.

For example of this kind of imposter switching, play the demo for Delta Force: Land Warrior, and look around on the desert/pyramid level. All around where you start, you''ll see some trees... which fade out to billboarded sprites at about 20 meters. And unless you''re watching for it, it works well!

I''ve figured out techniques for making it more seamless, but my techniques only work well in moderately-thick (2 or more trees in every 15x15 meter patch) forests...

Share this post


Link to post
Share on other sites
GreatOne : Rebuilding tree is not something you want to do in real-time. It kills your performance big time.

Would be nice to get response from someone who actualy coded this thing. Just the thing how to setup render to texture thing.

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
don t know if you have ever played battlefield 1942

they do the best trees i have ever seen with only 100 polygons


what they do is render the stem with one texture


and then they use sprites for the leafs with decreasing alpha value from front to back


so you do:
- render all the stems with the same stem texture
- then render all the other stems sorted by texture of course
- render the leafs sorted by texture


trees are static geometry so you can easily sort them
created a vertex array for the stem

and one for the sprites which you use for the leafs

you do this in an model object

and for each tree you create an entity object which stores the index of the model you use
every frame your setup the sprite`s vertices
then render all the stems
and then the leafs


why?
because switching textures decreases performance and switching the rendering state to alpha blending consumes a lot of CPU power as well especially when you are drawing several thousand trees

you manage 150 with 2000 polys so you should reach an approximate number of 3000 with BF1942`s methode

nice eh?

Share this post


Link to post
Share on other sites
Basiror : I havn''t played battlefield 1942. But this is simmilar to what I have seen in Ultima Reborn. The method is actualy quite nice but doesn''t it require artist to create trees in first place? I was going more for procedural approach.

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
well get photoshop
a picture of a tree with some leafs on it

create an image of 32*32 or 64*&4
copy a piece of the leafs so you can create a ball like looking sprite of leafs

and cut out the alphachannel at the positions where you have the background of your source photo

maybe you want to apply some blur effects the further you are away to make it look more realistic

Share this post


Link to post
Share on other sites
eh?

that hasn t been an offtopic reply

what i have tried to say, is that this little art work can be done by every ***** (imagine a word with 5 letters , 1st is I)

Share this post


Link to post
Share on other sites
Sorry for the comment. But trouble is that what is drawn by **** also look *realy* fake.

I would *realy* want to implement imposters... anyone please!!!

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites

  • 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!