Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Random LOD Tree Generator

Author
Message
paul5147
17
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 9th Oct 2011 19:37 Edited at: 9th Oct 2011 19:39
Small utility for generating random tree`s,simply play with the sliders and then click on "render".
This will take you to a preview window showing you the tree`s that were generated.It generates 3 levels of detail for each tree and also spring,summer,autumn and winter textures for the leaves.
If you are happy with the tree`s click on the "save" button,they will be saved to a folder named "tree*number*" in the directory that the program was run from,*number* will be automatically replaced with the next free number it finds,for example if folders tree1 and tree2 all ready exist it will create a folder named tree3 and save all the models there including a copy of there textures.
The models are saved as 1 object with multiple limbs,limb 0 being the branches and the remainder of the limbs as the leaves,the bottom of the main trunk is set as the origin to make it easy to place them on a terrain or matrix.




Hope this comes in handy for someone,feel free to ask for features adding to this if you want it to do something particular and i`ll see what i can do for you.
Latest version i`m working on at moment saves out the images of the tree`s complete with alpha as well so they can be used as transparent billboards,but that can wait for a later update.

Attachments

Login to view attachments
Darkzombies
12
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 9th Oct 2011 19:46
Wow, great! I think you could still do some work on the models, especialy the leaves. But still great!

"Insert funny coding-related joke here"
paul5147
17
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 9th Oct 2011 19:58
Thanks Darkzombies,but there are no models to play with,leaves or otherwise,its all randomly generated including the textures so the number of tree variation is unlimited.The textures can be swapped out later for any you like,and are only there for demonstration.
Chris Tate
DBPro Master
14
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Oct 2011 21:03
Looking really good vertex wise. The textures should be a trivial matter of applying decent textures, and if necessary shaders.

Trees are not easy. Getting the alpha-transparency to look decent is a nightmare for me. I'm struggling with trees in my game at the moment; it's like a battle between performance and realism; it is easier for me to make a polygon rich realistic tree than to make one that looks good with minimal polygons.

Where it says 12816 polygons, is that for all of the trees loaded in the screen shot; or the focused tree in the middle being worked on?

paul5147
17
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 9th Oct 2011 21:41
Hi Chris, that's for the highest level of detail tree that's shown in front,the lower levels are about a 1/4 of that,but that can change depending on the amount of branches or sections that are used.
Its a balancing act like you say.
paul5147
17
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 10th Oct 2011 20:01
Small screen cap of the lod trees in action
Chris Tate
DBPro Master
14
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Oct 2011 20:06
Very nice!

gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 4th Dec 2011 03:40
hi

a good addition to the DBP Family

to move side ways - is to move forward
Since a Strait line gets thin fast
paul5147
17
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 5th Dec 2011 19:46 Edited at: 5th Dec 2011 19:48
Decided to release the source to this,bare in mind that it was written in BlueIDE and the project files dont seem to be compatible.
So if you dont use it then open DarkTree.dba
and add all the other dba files as includes in the standard editor then recompile/run.
Hope this helps someone and just give me credit if you use it.
Merry Christmas.

Attachments

Login to view attachments
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 6th Dec 2011 00:40
the first one ran fine
the second one ran but only updated
a few times and if you made a change then the updateing did not happen

one final thing
a missing dba file

save tree.dba

the pointer in the "DarkTree.dbpro"

had the following line

include5=D:\Program Files\Dark Basic Software\Dark Basic Professional\Projects\tree\save tree.dba

other than that nice work

to move side ways - is to move forward
Since a Strait line gets thin fast
paul5147
17
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 6th Dec 2011 06:14
@Resourceful
I zipped the whole project folder but for some reason winzip missed that file out,dont know why,but ive attached it to this post anyway.
As for the updating,that was a problem in the first release i thought i had fixed with this version.I dont seem to get any loss of updating however long i use it for.
Can you try recompiling the new source with the savetree.dba ive attached and try it again for me and let me know how it works.

SaveTree.dba
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 6th Dec 2011 09:39 Edited at: 6th Dec 2011 09:50
@paul5147

well it's nice to have the missing file

but if any changes are made it dose not render
and in a post that was made in anther forum header
there is no save button

I've attached what it compiled

to move side ways - is to move forward
Since a Strait line gets thin fast

Attachments

Login to view attachments
paul5147
17
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 6th Dec 2011 20:17
@Resourceful
Runs just fine here,you are clicking render to view the trees in preview window,then exit preview button to go back to the editor,or no updates will be done?
Clicking directly back into the editor window will simply shift focus to that window without closing the preview window merely hiding it behind the editor window.

Login to post a reply

Server time is: 2023-02-08 23:47:48
Your offset time is: 2023-02-08 23:47:48