Tree Scene Node v2.1

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

Tree Scene Node v2.1

Postby Klasker » Mon Jan 16, 2006 1:54 pm

This is a pseudo-random tree generator I made for Irrlicht. It loads a tree design from an XML file and creates a mesh representation of the tree using a seed for random numbers.

The current version is 2.1. This post has been edited to fit the newest version.

Current features:
  • 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 (3.11 MB) | XML Tree Design Format | shogun's IrrEdit Plugin
Last edited by Klasker on Sun Dec 02, 2007 12:42 pm, edited 11 times in total.
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby Conquistador » Mon Jan 16, 2006 2:02 pm

Brilliant!
Royal Hamilton Light Infantry - http://www.rhli.ca
Paris/Port Dover Pipes'n Drums - http://www.parisdover.ca
Conquistador
 
Posts: 340
Joined: Wed Sep 28, 2005 4:38 pm
Location: Canada, Eh!

Postby ry » Mon Jan 16, 2006 2:05 pm

looks great, keep up the good work
ry
 
Posts: 8
Joined: Mon Dec 12, 2005 4:15 am

Postby etcaptor » Mon Jan 16, 2006 4:11 pm

Great!
This is another great addition for Irrlicht users.
Just some ideas in addition:
- maybe will be good to placing leaves and related functions in CTreeSceneNode class. Leaves can be created like child nodes.
- Several types for leaves - it's easy to implement and gives more realistic look.

Thanks.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
etcaptor
 
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla

Postby Klasker » Mon Jan 16, 2006 5:15 pm

Thanks for the comments.

In the program, you can press F8 to toggle leaves on/off. There is a method for placing leaves:
Code: Select all
const core::array<core::vector3df>& getLeafPoints() const

That way, it is up to the user how to render the leaves.

I forgot to take a screenshot of the leaves in my first post (doh!), but as you can see, you didn't miss out on much - my leaves stink.
Image
But the point is that the leaves can be rendered differently without touching the tree source code - which is a nice separation imo.
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby Klasker » Sat Apr 15, 2006 4:07 pm

Update: LOD

Trees now support continous level of detail. On the downside, I have removed support for leaves for now. I will develop some pretty leaves later.

It also uses a random seed for reproducible behaviour. Using the same seed twice will generate the same tree twice.

Here is a quick screenie of a tree in various levels of detail.
Image Image
Image

The demo program is almost the same as before, but you can download it here including the source:
http://www.wc3jass.com/files/Trees.zip

Note: The download also contains a CLODSceneNodeAnimator which is not used in the demo program. You can use it to automatically update the tree's LOD for you, if you decide to use it in a project of your own.
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby puh » Sat Apr 15, 2006 6:36 pm

Nice work, Klasker! Thank you very much, very usefull and clean code.
Would be nice to have better control over branch generation, to get different types of trees, but i'm sure you will develope this project further.
Anyway, LOD animation system is a huge improvement! Keep it up, nice done!
P.S. Now with this cool treenode and nice grass-node we can get a continuous nice-looking terrain, just like in Oblivion ;)
puh
 
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

...

Postby xhrit » Sat Apr 15, 2006 7:29 pm

what would also be nice is if the trees 'grew' - sorta like unreal's nali fruit, but as simulation, not animation.

There are some good tree growing algorithms on levitated.net - they are in flash but it would not be too hard to reproduce them in a more complex language.

Too bad there are no trees in space - I'll have to wait until I start working on something ground based to use this.
Core2Duo E8400 3.0ghz - 2048mb DDR2 800 - geForce 9600 - Slackware12.1

Word-image-symbol programming limits, controls, and imprisons the individual.
Smash the control images, smash the control machine.
User avatar
xhrit
 
Posts: 140
Joined: Mon Jun 14, 2004 8:54 am
Location: earth

Postby bitplane » Sat Apr 15, 2006 9:24 pm

nice work, I love these trees! lets put speedtree out of business! :twisted:
LOD is one step closer to the holy grail - the forrest node ;)
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

Postby Spintz » Sat Apr 15, 2006 10:02 pm

very nice, gonna look at it once i finish backing all my crap up and reformatting so I can dual boot my machine to Fedora Core 5 and WinXP x64.
Image
Spintz
 
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Postby Klasker » Sun Apr 16, 2006 1:32 am

what would also be nice is if the trees 'grew' - sorta like unreal's nali fruit, but as simulation, not animation.

Not sure what you mean but it sounds a bit like overkill. The tree node is meant to be generated in real-time (speed > precision).

P.S. Now with this cool treenode and nice grass-node we can get a continuous nice-looking terrain, just like in Oblivion
LOD is one step closer to the holy grail - the forrest node :wink:

That's exactly what I had in mind. I made this as part of the infinite world game I'm working on.

Would be nice to have better control over branch generation, to get different types of trees, but i'm sure you will develope this project further.

Yeah, I'm planning to do that. But not now :wink:

Edit: Hmm.. posts with multiple quotes seem to look wierd :?
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Re: Tree Scene Node

Postby Jesus.Net » Sun Apr 16, 2006 10:59 am

Really brilliant: how do you do to see the sheets? :?:
User avatar
Jesus.Net
 
Posts: 31
Joined: Sat Apr 15, 2006 6:14 pm

Postby WhiteNoise » Sun Apr 16, 2006 10:38 pm

Very cool!
WhiteNoise
 

Postby Klasker » Mon Apr 17, 2006 11:50 am

Update again. Leaves were less painful than I anticipated, though they are FPS eaters nevertheless.

The leaves support wind, and will use the same IWindGenerator as bitplane's grass, for convenience. The wind is not very realistic, but it's something.

I also made an effort to quicken the process of generating trees, but anything above LOD 6 is still very slow. Takes about 10 seconds to generate an LOD 7 tree. Anything below LOD 6 is still very fast though.

Download: http://www.wc3jass.com/files/Trees.zip

Here is a screenshot of a tree with leaves (much better).
Image

And here is another one with many trees and many leaves ...
Image
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby dawasw » Mon Apr 17, 2006 12:30 pm

OMG!

klaskTREE & bitGRASS (tm)

Great! Just great!
dawasw
 
Posts: 357
Joined: Tue Aug 10, 2004 4:39 pm
Location: Poland

Next

Return to Project Announcements

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest

cron