18

I am looking for an algorithm or product that will generate low poly trees. Doesn't matter the language. I have searched all over and there are plenty of "tree generation" algorithms but they cater to more realistic looking trees not the opposite.

Here is the type of tree I'm looking to generate on the fly: Low poly examples

Even just algorithms to generate blobs that look like the top part of the tree would be helpful.

utahwithak
  • 6,235
  • 2
  • 40
  • 62
  • Interesting question, here is an idea you can generate top part of the tree starting from an ico-sphere and randomly changing it's vertex positions, you can make ico-sphere either from a modelling software or from Unity [with this script](http://wiki.unity3d.com/index.php/CreateIcoSphere) – nexx Apr 01 '15 at 07:45
  • You may find more answers on the Game Development SE site: http://gamedev.stackexchange.com/ – rhughes Apr 02 '15 at 01:52
  • I may be interested in picking this up if you need help. pm 'eelstork' on unity forums. –  Apr 02 '15 at 03:41
  • Take a look at the tutorial [here](http://www.pixelcodr.com/tutos/trees/trees.html) for a step by step instructions and algorithm in JS. – Vignesh Feb 02 '17 at 12:08

2 Answers2

4

I have put together something with unity. It generates solids with a Quickhull algorithm which is pretty easily explained and found around the web.

This will generate Convex Hulls of the input points. So I randomly generate points inside of a tree-shape.

Then after the blob is generated I can then shift around the vertices adjusting the normals accordingly. Things to keep in mind is to get the object the "low poly" look you need make sure each triangle has it's own vertex and normal and all three on the triangle are the same.

This solution is solidly 1.0 and only allows for one tree chunk but its what i'm currently using and is up on the asset store for anyone interested. Low Poly Tree Generator

utahwithak
  • 6,235
  • 2
  • 40
  • 62
2

Try using any of the existing systems available to you, while tuning parameters to reduce triangle count.

Otherwise...

A general purpose L-system will help with procedural plant generation (not only trees).

If you're asking specifically about how to merge leaves, you can generate isosurfaces around nodes and evaluate using marching cubes. Can be made from scratch or scripted but either way a significant piece of work.

As a much cheaper alternative to iso-surfaces, you can get results quickly by modifying pre-generated primitives. I would probably generate a few icospheres (using data from the L-System) and use additional branch data to scale and deform them. This is not only cheaper to build (saving you days of work getting your iso-surfaces right) but also will execute faster and gives you direct control over foliage topology.

Once you have your blobby shapes, randomise coordinates to give an organic look.