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.

Author
Message
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 11th Sep 2011 01:12
@ paul5147

THAT IS AMAZING!!!

I may have to join in the "I'm not worthy" chant

Sometimes I like to use words out of contents
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 11th Sep 2011 18:10
Same tree generation code as above but with a simple GUI tacked on to control the main parameters.
Max Branches - The maximum number of branches
Max Sections - The number of sections the trunk is made from
Branch Diameter - The Diameter of the base of the trunk
Amount Of Bend - The bendiness of the branches
Section size - The space between sections
Render New Tree - Renders a new tree
Save Tree - Saves the current tree as a dbo file for later use

This is a massive piece of code and was originally a set of includes so be warned readability is not good as one big file,ill split it all back up and post a zip later if any one wants.



Hope this comes in handy and if anyone uses it just leave a credit somewhere to me in your game.
Mugen Wizardry
User Banned
Posted: 11th Sep 2011 19:34
@paul: yes PLEASE do! For readability sake of n00bs

As stated before. I'M NOT WORTHY.

man! =D

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Sep 2011 22:18
@paul5147
It's a fast and good way to make a tree, I like it. What about using an external trunk image ? . Have you fit the UV's for the whole mesh?

Cheers.

I'm not a grumpy grandpa
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 11th Sep 2011 22:39 Edited at: 11th Sep 2011 22:42
@Chafari
No its set up at present so each section should be a seamless texture that runs around each section of the branch.
If you imagine that each section is made up like this all around it,it will give you more of an idea.
0,1___1,1
|\ |
| \ | 20 of these make up a section
|__\|
0,0 1,0
It wouldnt be too much trouble to make each branch take 1 texture merely by spacing the v component over its whole length and its u around it if thats what you need.
I was actually thinking about saving an image of the tree and just using them as billboards as it will quite easily push around 5 trees a second out on my PC.
I could have a virtual forest in no time.
Edit:
That little stick drawing is harder to make work than the tree generator,it should be just 2 triangles,but i cant get the spacing to work.
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 11th Sep 2011 22:47
I'm more for going down the billboard route. My laptop can't handle a forest with that amount of verts.

Warning! May contain Nuts!
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 11th Sep 2011 22:58
@WLGfx
The way it produces the data for the branches and the leaves is actually very easy to change so it can produce a low,medium and high poly version of the same tree.
If thats the way people want this to progress im more than willing to implement it into a later version.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 11th Sep 2011 23:08 Edited at: 11th Sep 2011 23:08
The branches aren't welded to the trunk are they? That's the major reason for me to make this program. So that a tree can be edited in ZBrush without tearing apart.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Sep 2011 23:13
Quote: "No its set up at present so each section should be a seamless texture "


That what I thought, With a seamless texture looks too unreal but your leaves look pretty good though

Cheers.

I'm not a grumpy grandpa
Mugen Wizardry
User Banned
Posted: 11th Sep 2011 23:13
is there a function to smooth the tree trunk & branches? =D

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 11th Sep 2011 23:15
@Pincho
The tree itself is actually a DBPro cube that all the branches and leaf meshes are added to as limbs,they can be split off and saved seperatly at the time of creation if needed.
Or the object can be exported with .x format using some code lying around on one of the forums here,i think its in code snippets somewhere.
What formats does zbrush support?
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 11th Sep 2011 23:22
That would definitely be interesting to create different LOD's for the trees. Nice piece...

Warning! May contain Nuts!
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 11th Sep 2011 23:23
@Chafari
Its set up to use a seamless texture,but its not using one,all the textures are generated at runtime then saved out and reloaded to get around a save object bug

@Mugen
The only smoothing routine its using is the DBPro command Set Object Smoothing to blend the normals a bit.The rest is just down to how it generates the branches.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 11th Sep 2011 23:25 Edited at: 11th Sep 2011 23:27
Quote: "@Pincho
The tree itself is actually a DBPro cube that all the branches and leaf meshes are added to as limbs,they can be split off and saved seperatly at the time of creation if needed.
Or the object can be exported with .x format using some code lying around on one of the forums here,i think its in code snippets somewhere.
What formats does zbrush support? "


I can convert X to ZBrush, but I need a whole tree to edit, the leaves can be separate though.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 11th Sep 2011 23:51 Edited at: 11th Sep 2011 23:58
This is the plan. To make a single mesh object by wrapping many objects together in boxes that make coordinates for triangles. And the same with the branches, all the same model, no limbs apart from the leaves.



paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 11th Sep 2011 23:58 Edited at: 12th Sep 2011 00:04
@pincho
Change the "GLOBAL hide AS INTEGER=1" to "GLOBAL hide AS INTEGER=0" near the top of my latest code snippet and see if thats something like you need when you click on render new tree
EDIT
Its possible to make all the branches into one mesh at the time of creation with "ADD MESH TO VERTEXDATA" rather than adding a new limb,i only did it this way so that each limb (branch) could be set up with different textures if needed
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 12th Sep 2011 00:08 Edited at: 12th Sep 2011 00:11
That's exactly right. So all that needs is several trunk objects combined to make the lumpy rings on the trunk. But I can't figure the code out apart from the code that I have written. I was going to use sparky's collision to remove boxes inside the trunk so that you just end up with the lumps around the outside. Then figure out how to connect the branches.

See the lumpy tree trunk...



Mugen Wizardry
User Banned
Posted: 12th Sep 2011 01:21
Can you MAKE it generate smooth limbs?

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 12th Sep 2011 01:32
If you pick 1 trunk section for the tree, you get a smooth tree.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2011 03:17 Edited at: 14th Sep 2011 03:18
Hi there. I wanted to put this here in the tree section . Here is my Tree Editor in action.I still have to finish it. I make the branches ramdomly but I place them in the main GUI. The leaves are placed like painting on the air in real time. I used a trick for the shadows.

You and see a video here.
http://www.youtube.com/watch?v=BIaNPAA2kx0

You can download the attached example. I hope you like it

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Sep 2011 03:29
yeah looks good! I thought you would be daring, and weld the branches on though, you nearly had it working at one time.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2011 03:32
I could weld branches if I use triangle method, but lastly I decided to make an easy one , we can add real images to the branches al leaves.

Cheers.

I'm not a grumpy grandpa
darkvee
20
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 14th Sep 2011 04:56
Hi guys awesome work! on the real-time tree generator.
Keep up the good work.

darkvee
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 14th Sep 2011 07:28 Edited at: 14th Sep 2011 19:47
Hi Everyone,
Latest update of my tree generator here,there are a few major changes but all in the generation routines of the tree object.
The trunk and branches are now one welded object thanks to Ianm´s Matrix1 plugin using shared vertex index list structure,so the tree can be manipulated on a vertex by vertex basis without riping the mesh apart.All the leaves are still added as limbs in the same way.
The tree has now got a `bumpiness` factor as part of the generation routine and produces lumpy looking branches.
This has given the whole generation routines a massive speed boost, on the test code i use im pushing almost 50 trees a second out depending on the complexity of the tree which is almost double what i had before.
The code snippets are arranged a little different than before so as to make reading and editing a bit better,the main part is tree.dba and should be set as the main project file with all the rest of the snippets as includes
In future that means i will only have to post any included files that have changed.

tree.dba - make this into a DBO project

All the rest of these code snippets should be included files
make tree object.dba

gui.dba

make tree data.dba

make textures.dba

make leaves.dba

mouse control.dba

free object.dba

I know this is`nt the easiest thing to set up and i could have just included a zip file with the dbo project file,but i use BlueIDE and i dont think the project files a compatible with the latest U73 editor.
EDIT:
@Pincho - I Know this was your thread Pincho,but would you mind if i moved this over to the WIP forums,it might get more views and hopefully more ideas that would help with your own project.
The objects saved out are now 1 welded mesh for the tree and a number of limbs for the leaves.If anyone can find or has a good .x exporter code snippet,that would be much appreciated.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2011 11:49 Edited at: 14th Sep 2011 11:51
Wow really cool!! . Now you got more realistic branches . You don't even need any external texture, as your bumped branches are perfect.



Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Sep 2011 16:52 Edited at: 14th Sep 2011 17:15
Getting better all the time, but unfortunately my problem still isn't solved. What we now have is much better trees than before, which is great! I need photo, quality trees close up. To explain.. I am making a real ants nest where the ants will be Neural Networks. They will look real, and act real. I have tried to make everything look like their photograph...



Now when you get the camera close up to the ant climbing the tree, they need to match.. like a nature documentary. That is my problem. Anyway, if I can get a whole tree saved as a Direct X model, I might be able to get that look. The two major factors are welded branches, and a complete texture. Then I can add a normal map to the texture, and maybe fade in a mesh for close up.

paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 14th Sep 2011 19:58
@Chafari - Thanks

I`ve managed to get the code tags to work in the post above,so its a bit more readable,had to post each one separately until i found the snippet.

Right back to typing,LOD versions of each tree i think next,unless anyone has an more ideas they would like me to try out first.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2011 20:04 Edited at: 14th Sep 2011 20:05
@Paul5147
Your are welcome !!

@Pincho Paxton. Your ant is coming to life When working in high detail, that means more work, but at the end it will give us more stisfaccion. What I'm trying now, is to weld correctly the branches to the main trunk, although that is not so in a real tree. I made some test in low poly, and works perfect, but I need to do some more test with the correct texture union. Here's an image of what I have at the moment.




Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Sep 2011 22:56 Edited at: 14th Sep 2011 22:57
That's really good. I had an idea about the boxes. The boxes will be hard to sort into the right order using their object numbers. I was going to make the boxes start at object 1 at the bottom, and work around the tree, and then up the tree. that is OK until you get to branches. But then the branch connections will always be different numbers. So I thought about making an array, and not look at the object numbers, instead look at the array numbers. Then the array numbers can always be the same numbers for every branch. That way, if we can get 1 branch to weld to the tree, we can use the same numbers to get all of the branches to weld to the tree.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2011 23:34
What I will do, is a random main trunk made of bones(limbs)and a single mesh then conect all random branches in those limbs, so in every new branch conection , I have to apply this function to weld branches in a smooth way. The creation of the tree, will not be just random, but the user can deside where to connect branches and we'll need those sleeves.


Cheers.

I'm not a grumpy grandpa
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 15th Sep 2011 01:02
@ paul5147

Dude that's really cool. I think you should put that in a dll and sell it. It would be awsome to just call a function and create a random tree that looks as good as yours do.
You got one sale here.
kezzla

Sometimes I like to use words out of contents
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 4th Dec 2011 04:32 Edited at: 4th Dec 2011 04:34
for paul5147

I own "BlueIDE" and it runs fine in DBP 7.61
and for others I'm posting the dba files

also there is similar free "BBB Gui Plugin"

so folk's have there choice
both work equilay well and BBB Gui Plugin
has a working thread if you have any problems

to move side ways - is to move forward
Since a Strait line gets thin fast
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 4th Dec 2011 09:49
@Resourceful
BlueIDE is a free IDE for DBPro and the project files do not seem to be compatible with the old or new IDE´s that come with DBPro,are you thinking of BlueGUI for making windows interfaces,i have that as well,but dont use it or the BBB Gui Plugin for any of my interfaces as i prefer to use my own EasyGUI that i posted a couple of years ago in the WIP forums.
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 4th Dec 2011 18:04
paul5147

my mistake on that

I tried to use the compiled exe and they would not work
but once I linked every thing in one file it worked fine
with the new exe

your EasyGUI also worked perfectly

paul5147 one tiny question

I was wondering if I could get your updated "race track editor" ?

you had promised to post but never did

perhaps a pointer on how some of the code could be used
to make roads but not for a race track but for a city or country setting

I've collected many things now and can do a lot more and this one one
of several additions I was needing

to move side ways - is to move forward
Since a Strait line gets thin fast
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 4th Dec 2011 18:20
@Resourceful
Sorry, i thought i got back to you about the race track editor,a while ago i had a pretty disastrous hard drive crash and lost quite a bit of source code,mostly newer stuff that i hadnt got round to backing up.
As it stands at present i havnt had the time or the need to work on it any more,but i may just dig it out over the christmas break.Most of the work was concentrated on the procedural texturing that was used for the track and the terrain.The actual track editor had only minor tweeks and switched the interface over to my easyGUI routines.I may still have a video of the newer track in action somewhere but its hard to see the difference on youtube.
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 4th Dec 2011 18:36
@paul5147

things come up and thoughts go else ware
the nature of thinking

sorry to hear about the had drive crash

I still would like to take a look at the video

I and other appreciate the work you have dun
I've seen many peaces of code folks have created that produce
amazing examples

to move side ways - is to move forward
Since a Strait line gets thin fast
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 4th Dec 2011 19:11
@Resourceful
Thanks,it makes the hard work and lots of hours stairng at a screen doing the complete opposite to what you expect seem worthwhile.
I´ll look through what backups i have and try to find the video for you,If not i´ll try my best over the holidays to find a bit of time to work some more on it and some other projects i put on the back burner.
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 4th Dec 2011 19:26
@paul5147

yes soo many ideas come out all at the same time
there all good but which one's to put the efforts into
that's the bugger of it all

at least now I know it will make a showing so to speak that is

to move side ways - is to move forward
Since a Strait line gets thin fast
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Dec 2011 20:10
Some brilliant demos here! You've probably saved me (and others) a lot of time and heartache.

I had been thinking of doing something along these lines myself but will probably use this as a starting point instead. My only complaint about the latest demo (from Paul1547) is that there's an obvious seam where a branch joins the parent stem. Is it just a matter of smoothing/averaging the normals along the seam? I hope to find time to study the code and see where the problem arises.

Aside from that quibble, very nice work indeed.

Login to post a reply

Server time is: 2026-07-09 22:02:51
Your offset time is: 2026-07-09 22:02:51