# Procedural Trees

I don’t really know how graphics works so I may have gone off in an unworkable direction so say if I have.

So a while ago I made a procedural tree generator and posted it to the old forums. And the trees looked pretty good (and they had a lot of parameters so we could make a lot of different species) but the branches were just straight lines.

So now I have taken some ideas from the flexible membrane and made this branch generator. What it does is

1. Work out the beginning and end point of the branch (as is done in the prototype above). [RED dots]
2. Put in two intermediate points and move them off centre (based on how bendy the tree is) [RED dots]
3. Put some points on a Bezier curve between these four points. [GREEN dots]
4. Wrap each of these points with some points [BLUE dots]
5. Move these points around randomly to create a more organic feel
6. Put these dots into triangles which cover the branch [BLUE triangles]

The advantage of this system is that you can tell it how many polys to put on the branch, in the first instance the branch has only 5 layers but in the second it has ten and then fifty (I think it was fifty). So if you are a bird flying over a forest you can just see the outline of the trees but if you are a bug sitting on the branch then we can put in a zillion polys. Moreover the Bezier curve is fixed by the properties of the tree so is always the same, so the braches will always look the same shape from any distance, they will just be better rendered close up. Moreover moreover we could offer people a graphics setting so those with mad rigs can increase the poly count pretty much arbitrarily.

What do you guys think? Does this make sense?

1 Like

So, you’ve developed a LOD scheme, essentially? That’s not bad at all!

I’ve seen some papers with much more efficient ways of rendering bumpy branches, though – bump maps, for example.

What’s LOD?

Level of detail.

Ok yeah cool, that was the idea. Is there a standard way of doing this stuff? I imagine the graphics card has a lot of this kind of think built in.

Ogre may have something, I’d be surprised if it doesn’t.