L-Systems - Trees, Plants and Fractals Generation V2 (Geometry-Nodes)

Alex Martinelli in Procedural Generators


A Blender file with Geometry-Nodes (GN) modifiers to generate and experiment with L-systems.

Requires Blender >=5.2.

Have questions or want to share your results? Reach out on Twitter/X or Threads.

L-systems allow generation of complex shapes via iterations over a user-provided grammar. Results have often fractal like composition, and can resemble trees, snowflakes or other organic branching structures. Check the wiki page for an introduction to L-systems, or the Houdini entry.

Summary of the setup

In the Blender file you can find a lsystem object with three modifiers slots: LSystem for the base algorithm and structure generation, Hair/Cloth Sim for extra simulations like wind and Render for rendering the results. You can start playing with these and get results right away!


LSystem Main is the node-tree that exposes all controls for the L-System generation. It provides different groups with presets and the main parameters that drive the final structure (returned as an edge-only mesh). These presets are examples of popular rules which you can play around without any prior knowledge, just edit the modifier parameters to adjust results as you find fit.

In the "Group Type" you can then also find the "Custom" entry, which allows to write your own custom rules. Just provide the axiom and the rules, for example "X=F++//F". For rules, the system supports a single character input, followed by the equal sign and then an arbitrary number of characters (aka the replacement string). Valid letters for rules are ABFGXY. Any other letter will be ignored.

"Iterations" defines how many times to apply the grammar rules and the "Max Str Length" specifies the maximum length of the resulting string that will be drawn. Be careful with these values, as a string can get quite long depending on the grammar, resulting in Blender slowing down or even fully crash. Test with small values first and increase gradually.

The "lystem_renderer" is what takes care of transforming the generated string to a mesh. It follows the "turtle" graphics routine. The following is the set of operations allowed in this setup, with the corresponding "turtle" effect.

  • F: move forward (drawing a line)

  • + or -: turn right or left by angle[1] (where angle is the "Angle Add" vector input for the modifier)

  • & or ^: pitch down or up by angle[0]

  • \ or /: roll clockwise or counterclockwise by angle[2]

  • ~: turn/pitch/roll by a random amount

  • " or _: multiply or divide current length by "Step Size Scale"

  • [ or ]: start or end a branch

Extra content

In addition to the basic setup we also provide an extensive preset of L-System rules, a wind simulation node-tree, a "Mesh To Tree" modifier with multiple sample materials plus the experimental "Forest" setup.

Preset include 6 2D plants, 6 3D plants, 12 fractals and some additional stochastic presets.


Hair/Cloth Sim

The premium version includes an extra modifier to apply a hair-like simulation. In particular the Wind Sim node-tree simulates wind forces affecting the previously generated mesh, using multiple attributes to mimic the behavior of a tree or plant. User can control wind strength and scale as well as "pinning" aspects, meaning which points are affected by the wind and in what measure.

As the animation triggers the L-System logic at every frame, it is advised to bake the output of the first modifier when satisfied with the initial structure, and only then run and experiment with the wind sim.

Render

The Mesh To Tree node-tree takes the results from the main modifier and transform it into a tree-like object, with profiled trunk and branches. It also allows to add leaves and flowers based on parameters of the initial system. It gives full control to the user and allows customization of different parameters like branch radius, leaves and flowers distribution. It also includes multiple sample materials for leaves, flowers and bark.

Forest

This is an experimental extra object present in the scene with a LSystem Distribute node-tree that allows to distribute different variations of a L-System tree on a plane. The idea is to first generate a set of unique "trees" (controlled via "Num Unique Tree" param) and then randomly instance them. The higher the number of unique trees, the more variation, but also the longer it will take to run the first generation.

Randomization is handled inside the node, covering different parameters both for basic generation and rendering, while leveraging the stochastic L-Systems rules.



Discover more products like this

tree 3D Trees blender procedural

$7

Have questions about this product?
Login to message

Details
Sales 20+
Published over 2 years ago
Blender Version 5.2
License Creative Commons