Tree Scene Node v2.1
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?
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?
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.
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.
Update!
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:
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)
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.
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)
I predict a demo coming up. I have some terrain with grass - would look nice with trees.
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...
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...
Irrlicht Demos: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=6&t=45781
That sounds very nice...sio2 wrote:Maybe I could add a deer with fur...
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
http://www.ogre3d.org/phpBB2/viewtopic.php?t=24918
I finished the description of the XML format I use for the tree designs, so if anyone is interested you can read it here.
Try looking at the demo program included (main.cpp). Very simple, you can do it like this:Virion wrote:so how to import the trees into the irrlicht application?
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 );
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, 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?)