Creating a forest with billboard clouds and static geometry

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Creating a forest with billboard clouds and static geometry

Post by Assaf Raman »

Creating a forest with billboard clouds and Static Geometry

I am trying to find the best way to use OGRE and the results of the new billboard cloud generator.

I wanted to create a demo of a forest with lots of trees.

My idea was to have a low-poly model that was created by the billboard cloud generator repeated over and over on terrain, I changed the grass demo so it will load the this model and not the grass model.

The grass demo uses StaticGeometry class that is very good for massive geometry like the one I need in this case.

Now I had a big forest - but with no level of detail – the StaticGeometry isn't built to support a model specific level of detail – the whole idea is to have a sort of a giant mesh that you can't distinguish its subparts.

My problem was that there is easy way to create a level of detail that will switch to the high-poly model when you get closer to a tree or trees.

Theoretically I can stop using the StaticGeometry and use multiple "regular" OGRE entities – but then I will lose the benefits that the StaticGeometry class gives.

I am not sure how to continue.

My options are:
1. Stop using the StaticGeometry class – the worst option because then I will lose the batching that it gives me.
2. Change the code of StaticGeometry in a way that it keeps a list of its origin meshes\entities and the functionality to show\hide a part of the geometry based on the origin entity name. Then I will hide the relevant trees and show the origin entities that has a level of detail.
3. Use SceneManager::setWorldGeometry.

In all of the ways I described I also don't have an easy solution for a gradual Alpha fade in\out effect between the different levels of detail.

:arrow: Anyone got ideas?

Sample of how the demo should look:

From up-close:
Image

From above:
Image


Here are the mesh files I uses:
http://www.upload2.net/page/download/na ... s.zip.html


The billboard cloud mesh in the file was create by swx with his billboard clouds generator. here is the forum post:
http://www.ogre3d.org/phpBB2/viewtopic.php?t=21714
Watch out for my OGRE related tweets here.
Captain Nemo
Greenskin
Posts: 134
Joined: Sun May 02, 2004 5:06 pm
Location: Kassel, Germany

Post by Captain Nemo »

Have you looked at the "instancing" thread?

http://www.ogre3d.org/phpBB2/viewtopic. ... &start=125

Perhaps you could use instancing to achieve what you want. If you do, please keep us updated about your progess. I'll have the same requirements pretty soon.
http://www.aridocean.com
The Marine Life Simulation
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

Captain Nemo:
Have you looked at the "instancing" thread?
I did look at it.

Crashy is my hero.

:arrow: But as I anderstand from his work summary - you benefit from instancing only when the case is a busy CPU – we have a different problem here – too many polygons for the high-poly model – this will still be the case even if I use instancing.

:?: Or am I wrong? (I will be happy to find out that instancing is the solution… )
Watch out for my OGRE related tweets here.
Captain Nemo
Greenskin
Posts: 134
Joined: Sun May 02, 2004 5:06 pm
Location: Kassel, Germany

Post by Captain Nemo »

I haven't tried out crashys instancing yet, so I am not sure if it helps. It was just an idea... I have to look into all this in more depth.
http://www.aridocean.com
The Marine Life Simulation
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3

Post by Praetor »

Really, I think StaticGeometry itself needs to be changed slightly to allow for manual LODs on a per-region basis. Basically, instead of polygons just simplifying per-region, it can also do a full switch to billboards at a certain distance. As far as I know StaticGeometry does not support manual LODs and I think that would be useful.

As for instancing, it has only one drawback: SM3.0 is required. At this point it is a pretty steep requirement.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

That is a good idea - but :
  • :?: what happen if you have different LOD distances for different meshes?
    :?: Should the LOD be based on the original entities meshes or something else?
    :?: And if the scene manager control the reigns – what if the reigns are too small or large?
    :?: What happen if a model is split in the middle to two or more reigns?
:arrow: I think a new level for keeping track of each of entities geometry is needed.
Watch out for my OGRE related tweets here.
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3

Post by Praetor »

You would have decide on a heuristic for determining the overall LOD distances for each region. Probably something like the largest distance of any entity. Currently the LOD is generated from the original mesh. In this case you'd be able to insert a manual LOD level before you build the static geometry and it would get built in. I'm not sure what issue you are talking about with regions being too small or large. I'm not sure if meshes get split between regions. If it does happen this would suggest we either need a new version of StaticGeometry to handle different methods of batching, so you have a choice at runtime, or just redo the batching method of the current StaticGeometry.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

Praetor:
I'm not sure what issue you are talking about with regions being too small or large.
I just wanted to show that a region is not that good for LOD – if you have a region that is good for a house object LOD – will it be good for the LOD of the grass outside the house? Think of the side difference.
Watch out for my OGRE related tweets here.
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3

Post by Praetor »

Oh ok, I get it. Yeah, that may be a problem. Unfortunately regions are the only things we have to work with in the current implementation of StaticGeometry, and they were designed for with culling in mind than LOD.
sunrisefe
Halfling
Posts: 42
Joined: Mon Oct 06, 2008 7:43 am

Re: Creating a forest with billboard clouds and static geometry

Post by sunrisefe »

does the OGRE-ADONN pagedGeometry realize the need?
cloud
Gremlin
Posts: 196
Joined: Tue Aug 08, 2006 6:45 pm
x 14

Re: Creating a forest with billboard clouds and static geometry

Post by cloud »

I'm doing something similar assaf and learning towards instancing mostly because theres I think the possibility of supplying per instance data like AO (which is a must have for me) Static geometry seems an all or nothing option like you couldn't fade out individual trees, where as I think that "might" be possibly with instancing via INSTANCE_ID and some user set array of params.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Creating a forest with billboard clouds and static geometry

Post by jacmoe »

OK, guys.
This is really old - do visit PagedGeometry in Addons Forum.
JohnJ has made a killer library for rendering large scale forests and grass. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
cloud
Gremlin
Posts: 196
Joined: Tue Aug 08, 2006 6:45 pm
x 14

Re: Creating a forest with billboard clouds and static geometry

Post by cloud »

I now feel a right pudding :oops:
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Creating a forest with billboard clouds and static geometry

Post by jacmoe »

cloud wrote:I now feel a right pudding :oops:
Wasn't my intention. :)
Just wanted to direct you to PagedGeometry before you pursue your idea any further. Chances are that JohnJ's plugin does exactly what you want to do, or better. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.