Tree Scene Node v2.1

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Postby lug » Fri Dec 08, 2006 12:32 am

Thanks, Klasker! I'm going to try it out when I get home from work!

I don't remember but does it play well with physics? Like say using newton to simulate wind and deforming parts of the tree, breaking branches, knocking off leaves, seeing leaves fall off tree, etc all realistically through physics?

I saw the tree falling over and splitting apart in the crysis video. I immediately thought about your tree and whether it can be done with something like newton behind it.

It looks like bullet has support for sending the physics stuff to a gpu. So, in the future we can do physics through:

1. multi-core cpu

2. 3d graphic card gpu or
multi-core gpu

3. physic processor card or
multi-core ppu

Gosh, so many different ways to go with physics what a programmer to do? :)
lug
 
Posts: 79
Joined: Tue May 02, 2006 5:15 am

Postby Klasker » Fri Dec 08, 2006 2:18 pm

The trunk itself cannot be deformed, since the tree skeleton is not exposed. The code for animations wouldn't be too complicated, but it would consume more CPU, which I don't like. Deforming it on the GPU is not a good idea, since it relies on skeletal animation. I will look into it for the next release, though.

Breaking off leaves and branches sounds cool, but I think it is overkill. I can think of ways to do this, but it involves a lot of work not really related to trees.

I am developing this with computer games in mind, and good frame rates are more important to me than über-realistic physics.

I guess the short answer is: No. It does not play well with physics. The leaves can be animated, but that's it.
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby krama757 » Tue Dec 19, 2006 10:12 am

Great job on this Klasker! I am currently working on making a small scene builder for my game that includes your trees and bit's grass nodes :)

Wish me luck!
krama757
 
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Update!

Postby Klasker » Sun Feb 18, 2007 10:32 am

Update!

Complete rewrite of the code (again) - this time it loads tree designs from XML files, leaves are now billboards, and four tree designs are included in the download. This version is officially called version 2.0.

The full feature list:
  • Loads tree designs from XML files.
  • Four tree designs included: Oak, Pine, Aspen and Willow.
  • Leaves are now billboards. Looks a lot better.
  • Leaves can have variable vertex colors (defined in the XML file). Very effective.
  • Shadows can be emulated by darkening those leaves on the side of the tree facing away from the light source.
  • The automatic LOD has been revamped. The old method was not very good. Trees now have three levels of detail:
    1. Full detail
    2. Low detail : Radial segments reduced to 4, highest branches are cut.
    3. Billboard : Tree becomes a billboard.
  • Trees can be scaled and rotated without breaking (mostly the billboard leaves were problematic here). This is useful for water reflections.
  • Note that wind is no longer supported. I will work on this.


Screenshots:
ImageImageImageImage

I have made an effort to make it a lot more usable than last time. This means that there are only 6 files now (3 headers and 3 sources), and the LOD looks a lot better now (it used to look rather hopeless).

Download (2.89 MB)
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby drac_gd » Sun Feb 18, 2007 11:43 am

I just gotta say WOW.
These are really looking sweet. Thats some kick ass code you've written. and thanks for open sourcing it :D
drac_gd
 
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Postby Virion » Sun Feb 18, 2007 11:58 am

so how to import the trees into the irrlicht application?
User avatar
Virion
 
Posts: 2109
Joined: Mon Dec 18, 2006 5:04 am
Location: Malaysia

Postby BlindSide » Sun Feb 18, 2007 11:59 am

Wow that truly looks awesome.
BlindSide
Admin
 
Posts: 2812
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby sio2 » Sun Feb 18, 2007 12:12 pm

I predict a demo coming up. I have some terrain with grass - would look nice with trees. :wink:

Hmmm. I have: Klasker trees; reflective water; my grass stuff (not yet released); and (fake) HDR. Yes, I definitely predict some eye-candy. Maybe I could add a deer with fur...
sio2
Competition winner
 
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Postby BlindSide » Sun Feb 18, 2007 12:31 pm

sio2 wrote:Maybe I could add a deer with fur...


:lol: That sounds very nice...

Klasker, I saw on an Ogre project they use 8 directional imposters. Basically the billboard image changes depending on the direction it is viewed from. I know that is not really part of your project as you already said before. But maybe something more complex like this will catch your interest? (I wonder if you can generate these images on the fly, too?) (Maybe render inside a blackbox from 8 different directions and use the screenshots as textures?)

PS: Here is link to the Ogre thing it might help you steal some ideas :D
http://www.ogre3d.org/phpBB2/viewtopic.php?t=24918
BlindSide
Admin
 
Posts: 2812
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby dawasw » Sun Feb 18, 2007 12:56 pm

Excellent work Klasker :D I'm definately going to use it now. :)
dawasw
 
Posts: 357
Joined: Tue Aug 10, 2004 4:39 pm
Location: Poland

Postby Klasker » Sun Feb 18, 2007 2:26 pm

I finished the description of the XML format I use for the tree designs, so if anyone is interested you can read it here.

Virion wrote:so how to import the trees into the irrlicht application?
Try looking at the demo program included (main.cpp). Very simple, you can do it like this:
Code: Select all
scene::CTreeGenerator* oakGenerator = new scene::CTreeGenerator( manager );

io::IXMLReader* xml = device->getFileSystem()->createXMLReader( trees/Oak.xml" );
oakGenerator->loadFromXML( xml );
xml->drop();

scene::CTreeSceneNode* tree = new scene::CTreeSceneNode( manager->getRootSceneNode(), manager );
tree->drop();

tree->setup( oakGenerator );


Klasker, I saw on an Ogre project they use 8 directional imposters. Basically the billboard image changes depending on the direction it is viewed from. I know that is not really part of your project as you already said before. But maybe something more complex like this will catch your interest? (I wonder if you can generate these images on the fly, too?) (Maybe render inside a blackbox from 8 different directions and use the screenshots as textures?)

Every tree from the same tree design uses the same billboard texture. I don't want to litter up the video card's memory by having 8 textures PER TREE stored there. That would literally kill the video card in a forest. Unless I misunderstood what you meant. If more variation is required, it is possible to give the tree node different billboard textures, so they don't all look identical.
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby BlindSide » Mon Feb 19, 2007 11:37 am

Not PER TREE, but 8 for every tree, for every direction. That is if most of the trees look enough alike. Please have a look at the link I provided for more detailed information.

Cheers :D

PS: You are awesome for making this and also your extended text :D
BlindSide
Admin
 
Posts: 2812
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby drac_gd » Fri Feb 23, 2007 3:48 am

Klasker,
Do you have a logo? I am planning to use your trees in my project

here is my current image .. Is this OK?
Image
drac_gd
 
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Postby Klasker » Fri Feb 23, 2007 7:35 am

Wow, time to make a logo 8)

Here you are:
Image

Yet another shameless ripoff of Irrlicht's logo :D The trees are still free software so you don't have to display the logo, but it's always nice to get credit :wink:
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby bitplane » Fri Feb 23, 2007 10:42 am

wow, very cool.. nice to see the progression over time! I wish I had time to develop my toys to this level of depth.
nice work!
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
User avatar
bitplane
Admin
 
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest