Mesh Tree - Alpha Demo Released

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

Mesh Tree - Alpha Demo Released

Post by Sputnick »

The alpha demo of my tree generation code is just released (Win32 exe).
I haven't included the source code yet as it requires some cleaning. It will come soon.

http://www.goutte-d-eau.org/sputnick/og ... e_Demo.zip

You will need a 32bits HardwareBuffer capable graphic card with at least 64Mb to display the most complex tree definition (32Mb is enough for some simple trees).

I did not have time finally to work on a full GUI include all the main parameters of the code, so the interface is very basic and is fully Ogre based. More complex GUI will come when CEGUI 1.0 will be released.

Use the arrow keys to orbit the camera around the tree and Pg_Up / Pg_Dn to zoom in/out.

1 to 6 let you choose between 6 tree definitions.
Changing "Seed" or "Leaves Alpha" requires regenerating the tree (hit the corresponding [1-6] key to validate your settings).

Image

So, the next big step will be to generate texture map based on the complex geometry to rebuild simple tree meshes with LOD. :wink:

- Sput

User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

Visually stunning !
Very Hard to believe it's computed generated, and I've seen much worse looking modeled trees !!

(nice on directx but don't display anything under OpenGL under ati RADEON 9600 4.10)

robin_3d
Kobold
Posts: 27
Joined: Thu Oct 21, 2004 12:32 pm

Post by robin_3d »

Wow!! This is very impressive indeed, nice work.

Dont know if you knew about it, but I did notice a few leaves remaining in view at the top tip of the trees when you completely lower the alpha value.

When you manage to generate the texture maps for LOD, this will be an amazing tool!
What also about model levels of LOD, would this possible? Im thinking that the jump from high res model to a billboard may be quite noticeable if done fairly close up, and since these trees are very detailed, having a few of them in a scene will mean you will be forced to swap to billboard sooner rather than later.

How do you define the type of tree? Would it be possible to supply custom parameters easily in order to design your own tree type?

Anyway, great work!

User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

Post by Sputnick »

tuan kuranes wrote:(nice on directx but don't display anything under OpenGL under ati RADEON 9600 4.10)
Not working here either on MOBILITY RADEON 9000. I've checked with some older compiled debug versions I have here. It seems to come from the Vertex Color addon in the VertexData definition as it was working before. I'll do some test at home and provide a patch for OpenGL. I have a leak when running in OpenGL in: Ogre::GLTextureManager::create
tuan kuranes wrote:I've seen much worse looking modeled trees !!
Thanks :)
robin_3d wrote:Dont know if you knew about it, but I did notice a few leaves remaining in view at the top tip of the trees when you completely lower the alpha value.
I've noticed it, but had no time to investigate really. It does not appear for all seeds and not for all tree definitions. I'm pretty sure it is coming from a error in the index offset for the Vertex Color data. Some more debugging needed.
robin_3d wrote:Im thinking that the jump from high res ...
The plan is not to display these high res models at all. They will only be used to generated low polygon LOD tree textures and billboards. But the idea is to have this tool to generate an endless types of texture depending on the user's needs. The max LOD tree should have around 600 triangles, min one will be a billboard.
robin_3d wrote:How do you define the type of tree?
There is a list of about 60 parameters that define a tree (level of subbranches, number of branches at each level, angles, ...). These parameter will be included with the next version of the GUI.
Have a look at the link in my other post for more details.
http://www.ogre3d.org/phpBB2/viewtopic.php?t=6220

User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

alpha demo patched

Post by Sputnick »

The demo has been patched and can be downloaded.
OpenGL is fully working now. :D

Feel free to comment the demo.
Enjoy

- Sput

mac
Kobold
Posts: 34
Joined: Wed Jun 25, 2003 5:17 pm
Location: Berlin, Germany

Post by mac »

Really fine trees!
You can remove the files ogre.cfg and ReferenceAppLayer.dll from the zip.

Good work, mac

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Awesome! Really, really nice.

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

Very pretty ;)
I've haven't seen so good looking trees in a real time sample :D

@Sputnick: check pm ;)
Follow la Moustache on Twitter or on Facebook
Image

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Are you using the latest release of DX9? I can't use it, and I'm afraid it's because of that...
Image

User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

Very powerful and impressive tool, Sputnick! This kicks ass!

I cant wait for the future releases...

User avatar
PeterNewman
Greenskin
Posts: 128
Joined: Mon Jun 21, 2004 2:34 am
Location: Victoria, Australia
Contact:

Post by PeterNewman »

I can't run it, bombs out on DX create surface. I'm not sure if this is because it doesn't let me choose my render device, or because I don't have the required capabilities. I'm running an FX5700.

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Is this similar to the problems people have had running the pre-compiled Ogre demos? The exe is built using the latest version of the DX SDK, and you're not running that same latest version.

This runs fine on my FX5600 (and is great BTW!) so I'd think an FX5700 wouldn't have any problems.

User avatar
thegame
Gnoblar
Posts: 23
Joined: Tue Aug 31, 2004 7:50 am

Post by thegame »

Runs fine on my 5700FX too, the switching between tree types is a tad slow - but that could just be my drivers. Looks great !!
Linux Rocks!!!

User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

Post by Sputnick »

Thanks everyone.

I'm using DX9c SDK. I guess DX9c runtime is needed then.
If you don't want to upgrade, it should work fine in OpenGL (although the rendering is a little bit different than D3D9).
mac wrote:You can remove the files ogre.cfg and ReferenceAppLayer.dll from the zip.
OK, I'll do this.

BTW, the weeping willow tree doesn't look very real. This is normal as the pruning code is not finished and not used. Pruning is needed to shape some of the trees like the weeping willow. This will be in the next release, along with a CEGUI interface to play with all the parameters.

- Sput

User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

regen speed

Post by Sputnick »

thegame wrote:switching between tree types is a tad slow
Switching between trees regenerates an entirely new tree structure on the fly.
Some trees can have more than 5'000 branches and 80'000 leaves.
Each segment of the branches and each leaf have a position and a quaternion that need to be recalculated.
That's quite a lot of data to process.
Then everything is packed into a nice Ogre mesh.
Personally, I'm quite impressed by the speed I got here. :wink:

- Sput

User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

Those trees are amazing! Very close to the real thing :)

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

very nice. Shadows would make is look really great for the final billboard snaps (since I imagine shadows on a half million polygon model wouldn't be too realtime anymore :shock: )

User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

shadows

Post by Sputnick »

Shadows are a problem. I don't think it would be a good idea to implement stencil shadows as it would definitely kill the perf and then it would probably be even better to use a ray tracer.

Currently a very simple algorithm is implemented to fake self-shadowing:
Leaves near the trunk are darker than the ones on the outside of the tree (except for simple level2 trees like the Palm tree).
But I need to admit that the effect is not that visible, although it does increase realism a little bit.

I could add some specular effect to increase the contrast. :idea:

- Sput

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

I mean that say when you take a screenshot you could turn on the stencil shadows just for that frame (or however you turn it into billboards), so you could still move the trees about to the right spot.

User avatar
Borundin
Platinum Sponsor
Platinum Sponsor
Posts: 243
Joined: Fri Oct 03, 2003 5:57 am
Location: Sweden
x 2
Contact:

Post by Borundin »

Very nice demo, congrats!!
So good in fact that youre tempted to take a screendump and then use it as a texture for a billboard like tree :P

I also get very good frame rates even on the complex trees. Over 300 fps if not zooming in too much!
Image : Image

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

You'd need to use texture shadows - stencil shadows won't work on alpha-blended objects like the leaves. Texture shadows can work quite well on objects like these, although with the number of polys involved it'll still be quite expensive.

Is there any scope for reducing the poly count by pre-baking multiple leaves into a single texture? Right now every leaf is a quad I think, which is pushing the tri count up pretty high. Looks gorgeous though :)

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Is there any chance for dynamic LOD? :)
Image

User avatar
pbridger
Gnoblar
Posts: 3
Joined: Tue Jun 15, 2004 2:12 am
Location: Wellington, New Zealand

Post by pbridger »

Awesome. I can't wait to use some of these in my space game. :)
Paul Bridger

User avatar
spookyboo
Silver Sponsor
Silver Sponsor
Posts: 1141
Joined: Tue Jul 06, 2004 5:57 am
x 148
Contact:

Post by spookyboo »

@Sputnick
Looks nice. Useful for my future project

@pbridger
Very funny :P

User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

Post by Sputnick »

Kencho wrote:Is there any chance for dynamic LOD?
That's definitely the goal. But for the second part of project.
sinbad wrote:You'd need to use texture shadows
I'll try it, if I can find some free time.
sinbad wrote:reducing the poly count by pre-baking multiple leaves
That's correct, every leaf is a quad (no culling). Ok for packing leaves but then I loose the orientation of each leaf. Anyway, that's what is intended be done for the LOD trees, but at branches and subbranches level.

- Sput

Post Reply