Tree Rendering Demo

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3
Contact:

Tree Rendering Demo

Post by Falagard »

Tree Rendering Demo:

http://www.larabie.net/ogre/LegendsOfTa ... Demo01.zip

Screenshots:

http://www.larabie.net/ogre/Demo_LoTTre ... -31-01.jpg
http://www.larabie.net/ogre/Demo_LoTTre ... -31-02.jpg
http://www.larabie.net/ogre/Demo_LoTTre ... -31-03.jpg
http://www.larabie.net/ogre/Demo_LoTTre ... -31-04.jpg

Here's something I've been working on which uses a billboarding technique for the leaves using a vertex program for speed. It requires a 3d card that has vertex program support.

The next big thing I'm going to work on is impostor rendering (replacing tree with billboarded quad which was done using render to texture).

After this, I may possibly add LOD support for a few levels of detail below the highest before it drops to impostor.

Then, various crazy tricks to support a fairly large number of trees on the screen at once, such as pre-rendering 8 impostors into a single texture, so all trees of a certain type can share a single impostor texture, and then also add vertices of impostors grouped into vertex buffers.

Let me know if it runs and if you have any problems,

Clay

stodge
Goblin
Posts: 217
Joined: Thu Oct 24, 2002 4:12 am
x 1
Contact:

Post by stodge »

Just to let people know, you need to have the DevIl.dll file installed. 8)

User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

Gorgeous, works beautifully, 150 fps for both dx and opengl :)
phear hingo

My Webpage

User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3
Contact:

Post by Falagard »

Ahh, thanks. I've added the missing dlls.

Clay

nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

Sweet! Ran with no problems on my ATI 9600 XT.

mike
Gnoblar
Posts: 3
Joined: Sun Apr 04, 2004 2:27 am

Post by mike »

It ran fine on my ATI mobility 9200, fantastic work Falagard.

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 »

Very nice, runs at about 400fps on my FX5900. :)

You're right, you can't really tell that they're billboards, except if you go really close to the tree, look up, and then yaw the camera around while standing on the spot. Then you can see the billboards rotating. But that's just picky ;)

AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary
Contact:

Post by AssiDragon »

Gets a bit choppy when going close to the trees and siding around them (Worst FPS: 17.786562) but I guess that's due to my 32MB Geforce4GO! card.

Very impressive work. =)
Hope is the first step on the road to disappointment.

User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3
Contact:

Post by Falagard »

Thanks for the encouragement, everyone.

AssiDragon, depending upon which GeForce 4 GO card you have, it might be emulating the vertex program in software. Only the GeForce4 4200 GO has support for shaders.

I use a GeForce ti 4200 for development and get very good speeds.

Thanks,

Clay

AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary
Contact:

Post by AssiDragon »

It's a Geforce4Go 420. I guess it's software emulated, then. :)
Hope is the first step on the road to disappointment.

User avatar
bana
Greenskin
Posts: 132
Joined: Mon Aug 02, 2004 7:40 am
Location: Austin, Texas
Contact:

Post by bana »

Awesome work there Falagard, I can't wait to see what comes out of this with imposters :shock:

It runs fluid smooth on my Geforce 6800GT although there are no fps numbers for some reason (I am running it through Cedega (wineX) emulation in linux :wink:)).
A proud member of the OpenFrag Coding Team.
http://coolhands.blogspot.com/

User avatar
IoN_PuLse
Goblin
Posts: 220
Joined: Mon May 31, 2004 5:54 am
Location: Canada
Contact:

Post by IoN_PuLse »

Have you tried running OGRE in OpenGL with straight WINE? Works well for me :D

User avatar
bana
Greenskin
Posts: 132
Joined: Mon Aug 02, 2004 7:40 am
Location: Austin, Texas
Contact:

Post by bana »

No I don't have regular WINE setup since I have Cedega (I bought myself that Christmas present heheh).
A proud member of the OpenFrag Coding Team.
http://coolhands.blogspot.com/

User avatar
paddy
Greenskin
Posts: 136
Joined: Sun Aug 01, 2004 7:07 pm

Post by paddy »

It looks excellent. :D

My card doesn't have vertex program support, but it runs well with OpenGL.

The only thing I notice, and I don't know if its because of my card or not, is when you view straight down from above the tree, as your angle of view approaches straight down, all the leaves vanish and it leaves only the trunk and branches. As you pan up slightly, they all appear again.

I really like the detail close up, it looks really great.

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

Post by Sputnick »

Nice results.
I got good speed too on my PC. :o

Sure, I'll be happy to collaborate. :wink:

The way I see it, is a 3 LOD tree:
1) Med res with the trunk and main branches as a mesh and leaves pack as billboard like in your demo (~ 1000 tri).
2) Low res with the trunk as a mesh and fix quads for each main branch textured with my generated texture (~ 200-300 tri).
3) Very low res with just a billboard (2 tri).

Then with some dynamic packing, we can reasonably expect to display between 10'000 to 100'000 trees in the viewport like in the SpeedTree demo.

Can you send me some exemples of what you exactly expect as input:
1) the tree XML file
2) the corresponding Ogre tree mesh

Then I can do an export function in my code to write both files

- Sput

innovati
Kobold
Posts: 35
Joined: Mon Feb 07, 2005 6:01 pm
Location: Ontario Canada
Contact:

Source availble?

Post by innovati »

Hey, I relaly like that demo, is source availble for it?

RoundSparrow
Greenskin
Posts: 145
Joined: Wed Jan 19, 2005 4:36 am
Location: Arica, Chile
Contact:

Post by RoundSparrow »

I also would like to see source code for this... anything?
Looking to hire people working out of their home to do C++ Ogre programming. Blender artists also wanted. Looking for long-term relationships. PM on forums or contact via AIM or email Art@Arica3D.com

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Yeah - there's source for it. But not in this thread. :wink:

The original meshtree author is sputnick - and the thread is here :)
If falagard's code hasn't been merged in by now, it probably will be soon.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

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

Post by Sputnick »

Falagard and I are quite busy currently (at least I am).
But the plan is to merge our codes, or at least our concepts in the coming weeks.
So be patient guys... :wink:

- Sput

User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3
Contact:

Post by Falagard »

I'm sure it won't do you guys a lick of good, but here is the source code for the rendering of the trees and the tree xml to ogre mesh converter.

I'm not supporting it currently, and it worked with Ogre 0.15 but I'm sure will need some fixes to get to Ogre 1.01

The missing piece of the puzzle here is the tree xml exporter for 3ds Max, and that piece is broken and code needs to be reworked (in fact, it's lost on a backup CD somewhere). The code was pretty simple - it was using one of the 3ds Max exporter projects - I can't remember if it was cTH's 3ds max exporter dll, or cTh's other flexporter project - I modified it to look for specially named objects in max and export position information to a tree.xml file. I am going to redo this to use a max script instead because it's simpler.

I WILL be looking at these again, specifically after I work on the paging landscape editor since trees are a major thing I want in my game, but for now here's what you get:

Sample project:
http://www.larabie.net/ogre/LoTTreeSrc.rar

It is missing media, though you can get the media from
http://www.larabie.net/ogre/LegendsOfTa ... Demo01.zip

And the xml to mesh converter:
http://www.larabie.net/ogre/TreeXMLToMeshConverter2.rar

And yes, super busy. I'm finishing up 2 year software project at work, final crunch phase before release. ;-)

Clay

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

Post by Sputnick »

Thanks Falagard,
I'll try to find some free time next week to do the integration and the Ogre 1.01 fixing. :wink:

- Sput

Post Reply