Page 1 of 1

Tree Generator

Posted: Wed Feb 09, 2005 6:22 am
by aligorith

I often find myself trying to find a good way to economatically generate trees.
There are basically several ways currently:[\b]

1) Model it by hand (yuk! troublesome, and very time consuming)

2) Use an external program (they either don't look right, or have too many verts = large files = slowness)

3) Hack one of the outdated existing scripts so that I can run it (hmm... quite difficult to do)

Of these current methods, I know that one good method is the one Arbaro uses, with quite a good result, but sadly too many verts meaning that the filesizes are just too large for me to use in any decent time.

What we should aim for:[\b]

1) Well, as a last resort we can still model them it hand...

2) Make some improvements to the particle system, so that particles
can be in a group together, growing off each other and being connected,
and then each group can optionally be duplicated and positioned. This could then be used for lightning bolts as well...

3) Create a new Python script to make trees.
This would possibly be the one I could look at. However, for this to work, some new things would need to be added to Blender:
- ability to find out whether the frame change is caused by rendering. this is useful so that scriptlink scripts can choose whether to do anything during editing
- ability to generate data at the start of a rendering session, instead of generate during design/editing before render, and save with file or (re)generate everytime the frame changes.


Posted: Wed Feb 09, 2005 10:14 am
by joeri
There are some more ways to make trees.

-Shaders. Put a cube in the scene and assign a tree shader that will render a tree.

-Paint effects. Pretty much like a shader but more 3d visual feedback.
Nice about paint effects it's that you can mix vertex with paint effects.
So you can paint the leaves on a vertex tree. giving not much verteces in the scene and high detail on the rendering.

Posted: Wed Feb 09, 2005 12:25 pm
by bullx
you have already considered to use an external program.
but maybe you can give a chence to the one called arbaro
it's os and it's java based
it can export obj and dxf.
it's a loto of vertex, yes, but you can produce very nice trees

Posted: Fri Feb 11, 2005 6:07 am
by aligorith
bullx wrote:you have already considered to use an external program.
but maybe you can give a chence to the one called arbaro
it's os and it's java based
it can export obj and dxf.
it's a loto of vertex, yes, but you can produce very nice trees
actually, my favourite option would be to have arbaro or an arbaro clone in python able to generate directly inside Blender, at the start of a render session.

Posted: Fri Feb 11, 2005 6:30 am
by SamAdam
that could be done, with a lot of coding, and python ain't all that fast, if you plan on adding thousands of verticies.

Posted: Fri Feb 11, 2005 9:06 am
by oin
with deeper knowledge of arbaro, you can produce very low pol trees.I have even done low enough as to get loaded in a game engine. People don't usually know, but there's a way to output a tri per leaf.

Iloaded perfectly a arbaro tree I made from zero, into blender, with ideasman obj script.JMS one is very good ,too.

no uv generation yet.

so I found a method to uv map it in short time in Ultimate Unwrap, with a packing-overlaped, separated by conectivity feature that Ultimate has . (I don't know a similar workflow in Blender) I selected the leaves group, and applied that auto maping. Asigned an alpha material to the overlaped leaf shape (of zillions of leaves all matching same leaf i did an automatic workflow in Ultimate like th ouput Xfrog has, but with more control on how I want the mapping,hehe) of an scanned leaf with transparent bacground.

did some auto map(ruling lines one, for this would be a bit better blender's auto map, but all can work) for the sterns group, other for branches group, other for trunk.

rendered in a real time 3d previewer with 2 sides renderable alpha faces, and man, did it look nice for such a low poly count.

so yep, can be pretty good for any purpose, low or hi res.

it's gonna have uv export in obj someday, but not yet.

i needed for this Ultimate Unwrap, whic costs 40$, but I had it since years, for all my mappings and converting my character animations.

Posted: Fri Feb 11, 2005 9:15 am
by joeri
I think the main problem are the leaves, not the branches. Polycount wise.
On the fly (at render time) poly creation can solve display problems, but it can create huge render times. (At least the poly limit has gone up dramaticly so maybe it's just a matter of swapspace)

There is no forest in arbaro :)

Paint effect/particle solutions seem to give good results (if the tree is not to close) also for grass and flowers. But that needs illuminated 3d brushstrokes, and that's not easy to implement.

Posted: Fri Feb 11, 2005 10:20 am
by oin
As I mentioned, ther's a trick in arbaro to not use that minimum of 5 or 6 tris per leaf...but just one tri (you can't go lower than that in any tree generator, comercial or not ;) ) an alpha texture the uvmapped leaves. I posted it some while ago, not in elysiun nor here.If I see someone interested (though I doubt it) , I'll rescue that thread and paste here the trick(or just load arbaro to remember that simple 3 settings.I know is hard to guess,though. ;) )

arbaro has a seed value: with same config of tree, u can export several random trees of that includes many realistic existing trees in real life (in xml) but i like producing my own, even if not to accurate (you can make accurate from scratch too) So you can go exporting obj with different random value once you have an small number, just one do an automatic array of them (I use other packages, sure you can do in blender)

Posted: Fri Feb 11, 2005 11:16 am
by joeri
I'm not sure how particles are drawn, but I think they use less poly's than a tri. In my imagination it's a brushstroke in 3d, a function that draws in the rendering. Leaves can be like that to. In a renderpipeline a tri with a texture is much easier, but can get very slow, specialy when it's a texture with alpha.

Posted: Fri Feb 11, 2005 12:59 pm
by oin

Maybe for a forest is better what you suggest.

Posted: Fri Feb 11, 2005 10:40 pm
by Friday13
How about implementing text-based object generation, like the one use in L-system?:

Have a look here for an example:

This is good, and not only for making trees!

Posted: Sun Feb 13, 2005 1:18 pm
by dsp_418