Sign in to follow this  

Realtime forest rendering

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

Hello, I'm working on a 3d game which is supposed to be able to render realtime forests. The "world" is pretty big and needs quite a lot of trees (think a few million). Now, I was thinking to make a file with bits which stand for tree (1) or no tree (0). This way I can generate "bitmaps", using the diamond-square heightmap generating algorithm as a definition on how big the change is for a tree, so 1 or 0. So the forests are all pre-generated in a file of a few million bits. Now, since I have no real experience in Level Of Detail techniques, and my mind is too lazy to think up a technique that doesn't fry my cpu, I thought I could use some help. I haven't really got further than using a grid, my mind locks up here. About the trees: They are not generated in realtime, they are just a number of slightly different low-characteristic models. So, if you have some experience with this, or something pops up in your mind, I could really use your help. Greetings, Michel

Share this post


Link to post
Share on other sites
This paper and its accompanying web site provide an overview of the issues involved in drawing lot of trees and one technique for solving them.

As always the Virtual Terrain Project is a good source for info about all things terrain related.


People putting trees on large terrains usually have some sort of tree density map, rather than store the position of every tree, and procedurally decide how many and where they should go for a particular cell in the map.

Share this post


Link to post
Share on other sites
I think you need to specify what is the most used point of view.

Depending on the camera staying on the ground or flying over the world, different lod strategy will be used.
beside, if you don't have many models, you may need to create some diversity artificially.

I didn't understand this sentence : "This way I can generate "bitmaps", using the diamond-square heightmap generating algorithm as a definition on how big the change is for a tree, so 1 or 0."

Share this post


Link to post
Share on other sites
Quote:
Original post by dave j
This paper and its accompanying web site provide an overview of the issues involved in drawing lot of trees and one technique for solving them.

As always the Virtual Terrain Project is a good source for info about all things terrain related.


People putting trees on large terrains usually have some sort of tree density map, rather than store the position of every tree, and procedurally decide how many and where they should go for a particular cell in the map.


Thanks for the references.
By the way, I definitely need to store the position of every tree, I need the forest to be persistent.

Quote:
Original post by Wagnerious
I think you need to specify what is the most used point of view.

Depending on the camera staying on the ground or flying over the world, different lod strategy will be used.
beside, if you don't have many models, you may need to create some diversity artificially.

I didn't understand this sentence : "This way I can generate "bitmaps", using the diamond-square heightmap generating algorithm as a definition on how big the change is for a tree, so 1 or 0."



The most used point of view is on the ground.
About that sentence, it basically means i have a file containing bits. The bits are sort of a map for the train. A 1 (bit) in the file means there is a tree. The rest of the blahblah is just how i intend to generate that file.

Share this post


Link to post
Share on other sites
Quote:
Original post by Bear777
Quote:
Original post by dave j
People putting trees on large terrains usually have some sort of tree density map, rather than store the position of every tree, and procedurally decide how many and where they should go for a particular cell in the map.


Thanks for the references.
By the way, I definitely need to store the position of every tree, I need the forest to be persistent.


You don't need to store the position of every tree - that was the point about about procedurally decide where the trees should go. Supposing each cell in the tree density map represents 30m2. When you come to draw the trees in the cell you could do something like:

Work out a new seed for a random number generator based on the position of the cell.
for tree=1 to number of trees for this cell
generate 2 random numbers between 0 and 30 and add these to the cell's position for the tree's x and z coordinate
calculate the tree's y coordinate by working out the height at x, z
draw the tree at x, y, z

You'd want to cache this the first time you see the tree so you don't have to calculate it every time. You can discard the tree positions when you can no longer see the cell because you can always generate them again in the same position.

Share this post


Link to post
Share on other sites
Quote:
Original post by dave j
Quote:
Original post by Bear777
Quote:
Original post by dave j
People putting trees on large terrains usually have some sort of tree density map, rather than store the position of every tree, and procedurally decide how many and where they should go for a particular cell in the map.


Thanks for the references.
By the way, I definitely need to store the position of every tree, I need the forest to be persistent.


You don't need to store the position of every tree - that was the point about about procedurally decide where the trees should go. Supposing each cell in the tree density map represents 30m2. When you come to draw the trees in the cell you could do something like:

Work out a new seed for a random number generator based on the position of the cell.
for tree=1 to number of trees for this cell
generate 2 random numbers between 0 and 30 and add these to the cell's position for the tree's x and z coordinate
calculate the tree's y coordinate by working out the height at x, z
draw the tree at x, y, z

You'd want to cache this the first time you see the tree so you don't have to calculate it every time. You can discard the tree positions when you can no longer see the cell because you can always generate them again in the same position.


yeah, but this way i'd still have to add the "heightmap" of the tree density to the engine. It'd be about 8 times bigger than the bit-based one I intend to use to avoid squary effects to the forest.
Any idea how to avoid this?

Share this post


Link to post
Share on other sites
Quote:
Original post by Bear777
yeah, but this way i'd still have to add the "heightmap" of the tree density to the engine. It'd be about 8 times bigger than the bit-based one I intend to use to avoid squary effects to the forest.
Any idea how to avoid this?


Have a look at the Plants->Books and Papers page on the VTP site. It has several papers that cover vegetation placement.

Share this post


Link to post
Share on other sites

This topic is 3723 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this