Space Tree Pro: new features

I have updated my Space Tree Pro add-on for Blender. Its latest version (201510041334) comes with additional skinning modes, and option to add some random bumps to the basic crown shape and and option to randomly drop some mature branches from a tree to add 'character'. The new update is of course free to download for people who have previously purchased the Space Tree Pro add-on.

Better skinning

The native skinning option in the add-on left something to be desired, especially for thinner, highly curved branches which may end up looking rather squashed. This new version therefore sports three additional skinning modes, each with it own pros and cons:
The original modifier. An example of the flattened twigs is shown in the image:
Skin modifier
It is now possible to use Blenders built-in skin modifier. It looks better but is really slow:
Convert to curve
Another choice is converting the tree skeleton to a collection of bevelled curves:
Ball and pipe
The final option is to use the conventional ball and pipe approach:
The quality of the new methods is comparable but the time to generate the mesh and and the number of polygons in the mesh differs significantly: For a moderate tree (1000 markers, 400 new markers, branch segment length 0.25, kill distance 1.0) the four skinning methods give the following numbers (on a Intel i7, 4 cores, your mileage may vary)
MethodTime (seconds)Tris
Native 1.5 73,886
Convert to curve 1.2 63,536
Skin modifier 35.8 415,092
Ball and pipe 1.6 141,376

A more random crown

It was already possible to vary the branch generation by choosing a different random seed but the overall shape of the crown stayed the same unless you used a crown group. Now with the added bumpiness and size variation for the basic crown shape it has become much simpler to generate unique trees. Compare the three different trees on the top row (diffent branching, same overall shape) with the three trees on the bottom row (which have random bumpiness and shape).

Dropping some mature branches

The final new addition to this version is the option to break away a random number of branch segments after the tree is fully generated. This may add some character to trees think storms etc.). The image below show the same trees where the one on the right has 50 segments removed:

Approximating translucency with inverse ambient occlusion in Blender

Prompted by a question from Superflea if it would be possible to add a translucency map to my WeightLifter add-on I found it was possible to use ambient occlusion baking with inverted normals for this purpose as suggested by this paper. Baking with Blenders built-in baking options is much faster than what is possible using Python and this might be useful for more people so that's why I share it here.

The idea is simple enough: just create a map for each position at the inside of the mesh with a value that represents how much light would be received at that point from nearby surfaces. Sounds a lot like ambient occlusion so the idea is to use ambient occlusion baking but with the normals inverted. The only snag is that inside a mesh it is extremely unlikely that a ray will ever reach the sky (even impossible if the mesh is watertight), resulting in a black map. However, Blenders AO settings have a distance parameter that can be used to tell the AO baking that any ray that does not hit a surface within this distance is considered sky:

(Note that we do not even have to enable AO for our purpose, i.e. baking, just setting the distance to 0.1 or something will suffice)

Now we can create a map that approximates translucency with the following steps:

  • Invert the normals on the mesh (they should all point inward)
  • Bake the ambient occlusion to an image texture (documented here)
  • Make sure you point the normals to the outside again
  • Use the inverted values of the image as a translucency map.
An example image is shown below (the head model is from OscarLeif on BlendSwap)

The noodle that uses this map to illustrate their values with an emission shader is shown below

Now if this is really useful to for example tweak a subsurface scattering shader is up to you :-) If you create a skin shader with it I am eager to see the results.

Space Tree Pro: new features WIP

My Space Tree Pro add-on for Blender is doing quite well. However, any piece of software needs contineous attention and that is what I am giving it at the moment.

The features I am working on right now need some internal testing before I release them but you can expect them in a few weeks or so. The main focus is on the quality of the tree mesh. The algorithm I use now is pretty fast but the results are not optimal, especially for thin branches connected to thicker ones and for highly curved branches.

The improvements in the works are threefold:

  • Crease the branch forks. This gives a tighter look for small branches connected to thick stems with a negliable impact on speed,
  • An option to use Blenders skin modifier. Looks great but is much slower (5-10x),
  • An option to convert the skeleton to a beveled curve (a la Sapling). Is actually faster and although thin branches look better, the branch forks are somewhat inferior to the skin modifier
The last two options look a lot cleaner but there's no control of the uv-map, which means procedural or box-mapped textures only. (images will follow)

WeightLifter add-on: new feature

Version 201509040905 adds a new option to the view from camera mode: a height offset. It add allows you to add weight to vertices even if they are in a valley on not directly visible from the camera. A tree for example might have a top that is visible if it is longer than the valley is deep at that point. Using this feature when populating an area with tree particles still reduces the number of particles needed but adds an extra bit of realism, especially on ridges seen side-on. This is illustrated in the image below:

In the bottom image you can see that the tiips of some trees peak above the ridge. The generated weight maps used are shown below, with the default on the left and the one with a slight height offset to the right:

The new version is of course available free of charge to people who have already purchased the add-on. Check the BlenderMarket page for more details.

Extending the Voronoi node in Cycles: a progress report

In a previous post I reported on a small project to extend the functionality of the voronoi noise node in Cycles. After some discussion with developers and users, I spent some time on it and the basic code is done.

Basically the Cycles Voronoi texture node will have all the functionality of its Blender Internal counterpart: you can choose different metrics (= ways to define what a distance is) including the manhattan and chebychev metrics and you can choose whether you want to closest neighbor, the 2nd closest (and 3rd, 4th) or the difference between the 2dn and the 1st closest (a.k.a. Voronoi Crackle). A sample is shown below:

The node has the same outputs as before and just has two extra buttons and an extra input socket (E, which controls the exponent of the Minkovski metric):

The node defaults to the old options and produces output that is pixel for pixel identical to the old output (with a distance metric of Distance squared). The downside of all this extra functionality is that it is slightly slower (because it now has to choose between different metrics and has to keep around more data). So currently I am checking if or where it makes sense to optimize the code some more. I don't want to complicate the code too much because that would make both maintaining and reviewing the code harder, so at this point it might be more sensible to let it be and accept a few percent penalty for now.

Small additions to the floor board generator add-on for Blender

The floor boards add-on most recently described in this article got a minor update: by request I added options to rotate and scale the generated uv-map. Although this might done in the uv image editor as well, any actions there would be overwritten when changing the floor boards mesh again with the add-on. Of course a uv map can be tweaked in the material just as well with a vector mapping node for example, so which method you prefer is a matter of taste. The defaults are such that it shouldn't break existing objects/materials.

Another option that is now visible is 'Keep materials'. This was on by default but not exposed in the options. You can now uncheck it if you like in which case any associated materials will be removed from the object. This is of questionable utility, but I'd rather not keep an option hidden.

The UV randomization drop down now offers a Packed option: instead of randomizing uvs it lets all the uv coordinates of planks start at (0,0) without altering the scale. This might come in handy when texturing planks with small and non tileable images. (It will look repetitive but that way it won't show seams)

I also fixed a rather embarrassing normal problem. Thank you maraCZ for pointing it out so clearly.

Known bugs

Under certain circumstances the generated mesh will contain doubled vertices. I think this is caused by Blenders boolean modifier. (To simplify the code we generate a pattern that is guaranteed to be big enough and then cut it to size with a boolean modifier). For now, if you see strange lighting artifacts, go to edit mode, select all and choose remove doubles. I will look into this later.


The code is a single file, available on GitHub.

How to add a new node to the Cycles source code

I created a page where I documented each file that needed to be changed or added to create the VoronoiCrackle node that I would like to get included in Blender. It documents what is what and contains a link to the actual patch. It is certainly not perfect but might serve as a good starting point for people how want to give it a try (and for myself as a cheat sheet because adding a node involves many, many files :-)
The page is listed in the pages widget on the top right of the blog or via this link.