> [!abstract] Summary
> **Parameter reference** for the Houdini L-System used in the [[Moss Generator - Thomas Spony and Nick Medukha|Moss Generator]] — explains every tuned parameter (generations, step size, gravity, randomisation, rules) and *why* it produces the wet, droopy Sphagnum-moss look.
> [!info] L-System primer
> Full L-system documentation: [Houdini Kitchen — How to create L-systems](https://www.houdinikitchen.net/2019/12/21/how-to-create-l-systems/)
---
# Houdini L-System Moss Parameters
## 1. The Engine: Iteration & Scale
These parameters drive the recursion engine—how many times the rules repeat and how large the geometry is.
### **Generations (`generations`)**
- **Definition:** The number of times the L-System recursively replaces variables with their rules.
- **Value in File:** `7.375` (Capitulum), `2.013` (Base).
- **Why it was changed:**
- **Fractional Values:** Note that these are not integers (e.g., 7 or 8). In Houdini, a fractional generation (like `.375`) renders the "next" generation partially grown. This is crucial for **smooth growth animation**. If you animate from 7 to 8, the branches grow out smoothly rather than popping into existence.
- **Detail Level:** The Capitulum (Head) needs `7+` generations to create the dense, fuzzy mop. The Base (Stalk) only needs `2` because it is just a simple supporting line.
### **Step Size (`step_size`)**
- **Definition:** The default length of a move forward command (`F`) if no specific length is given.
- **Value in File:** `0.03`.
- **Why it was changed:** Moss is microscopic compared to trees. A default of `1.0` would make a giant tree. `0.03` scales the "turtle" down to centimeter/millimeter scale suitable for macro photography logic.
### **Step Size Scale (`step_size_scale`)**
- **Definition:** A multiplier applied to the step length at each new generation.
- **Value in File:** `0.5` (Capitulum), `0.99` (Base).
- **Why it was changed:**
- **The Capitulum (0.5):** Each time a branch splits, it becomes half as long as its parent. This creates a **fractal density**—long at the center, extremely tiny and detailed at the tips.
- **The Base (0.99):** The stalk maintains a consistent length as it grows up, imitating a sturdy stem.
---
## 2. The Body: Geometry & Thickness
These parameters control the mesh generation if the L-System outputs polygons directly, or the attributes if outputting skeletons.
### **Thickness (`thickness`) & Thickness Scale (`thickness_scale`)**
- **Definition:** The width of the tube (`@width`) at the start, and how much it shrinks per generation.
- **Value in File:** Start `0.055`, Scale `0.915`.
- **Why it was changed:** This creates a **taper**. The moss strand starts relatively thick at the center and becomes hair-thin at the extremities. This is critical for the `Polywire` node downstream to generate natural-looking tapered geometry.
### **Tube Texture Coordinates (`apply_tube_texture_coordinates`)**
- **Definition:** Automatically generates UVs (`@uv`) wrapping around the limbs.
- **Value in File:** `1` (On).
- **Why it was changed:** Essential for applying textures later. Without this, the texture would streak or look planar-projected.
---
## 3. Forces: The "Organic" Feel
L-Systems are mathematical. These parameters break the math to make it look biological.
### **Gravity (`gravity`)**
- **Definition:** A force that bends the turtle's heading downward toward negative Y in world space.
- **Value in File:** `90.3` (Capitulum).
- **Why it was changed:** This is the **Defining Characteristic** of this network.
- Standard gravity is usually small.
- `90.3` is massive. It forces the geometry to "weep" or droop immediately. This creates the **Capitulum**, the heavy, wet, mop-like head of Sphagnum moss that hangs down around the stem.
### **Random Scale (`random_scale`)**
- **Definition:** Randomizes the length of segments (`F`).
- **Value in File:** `-0.173`.
- **Why it was changed:** A negative value in Houdini L-systems often implies a specific type of variation (like Gaussian noise) to prevent the "perfect fractal" look. It ensures that no two branches are exactly the same length.
---
## 4. The Brain: Rules & Variables
This is the logic programmed into the text fields.
### **Variables (A, B, C, D)**
- **Definition:** Custom floating-point numbers injected into the rules.
- **Why they are used:** They allow you to control angles and lengths without rewriting the complex string codes.
- **`variable_b` (31.7):** Used in `rule_4` as `&(b)`. This controls the **Pitch Angle** of the leaves. Changing this opens or closes the flower shape.
- **`variable_c` (61.5):** Used in `rule_5`. Likely another rotation angle for sub-branches.
### **Rule Analysis (Capitulum Node)**
The syntax here is specific. Let's decode the "DNA" of your moss:
#### **Premise: `"A"`**
The seed. The simulation starts by running Rule A.
#### **Rule 1: The Spine**
Plaintext
```
rule_1 = "A = "(.8) ! B ~(5) A"
```
- `"(.8)`: Multiply current length by 0.8 (get shorter).
- `!`: Decrement diameter (get thinner).
- `B`: **Run Rule B** (Create a cluster of leaves here).
- `~(5)`: Twirl/Roll randomly by up to 5 degrees (organic variation).
- `A`: **Recursion**. Repeat this rule again. This creates the main "chain" of the moss strand.
#### **Rule 2: The Cluster Hub**
Plaintext
```
rule_2 = "B = !(0.9) [m] // [m] // [m] // [m] / [m] // [m] / [m] // [m] / [m] // [m] / [m] // [m]"
```
- This rule spawns the "leaves" or "hairs" (`m`) around a central point.
- `[` and `]`: Push and Pop. It remembers the position, draws `m`, and snaps back to the center.
- `/` and `//`: Rotations around the Up vector.
- **Visual result:** A radial explosion of branches `m` emerging from a single point on the spine.
#### **Rules 3, 4, 5: The Leaf Conditionals**
These define what `m` actually looks like. The node uses conditional logic (`:`) based on parameters like time/generation (`t`).
Plaintext
```
rule_3 = "m :t>6 = " ! &(10) F T F !(0.1) F"
rule_4 = "m :t>4 = "(0.5) ! &(b) F T(d) F...
rule_5 = "m = " ! &(c) F...
```
- **The Logic:**
- If the generation (`t`) is greater than 6 (the oldest parts of the plant), use **Rule 3**.
- If it's between 4 and 6, use **Rule 4**.
- Otherwise, use **Rule 5**.
- **Why do this?** Nature isn't uniform. Old leaves look different from new buds.
- **Rule 3 (Old):** Uses `&(10)` (small pitch). The leaves might be droopier or longer.
- **Rule 4 (Middle):** Uses `&(b)`. Remember `variable_b = 31.7`. These leaves stick out at ~32 degrees.
- **Rule 5 (Young):** Uses `&(c)` (`61.5`). The youngest tips curl tightly at 60+ degrees.
### **Summary Of the "Sphaigne" Look**
You achieved the Sphagnum look by:
1. **Overdriving Gravity** (`90.3`) to make the head droop.
2. **Using Conditionals (`:t>...`)** to make the top of the moss tight/curly and the bottom loose/straight.
3. **High Branching Density** (Rule 2) to create a fuzzy volume rather than a tree structure.
---
# 🔗 Related
- [[../TOOLS MOC|TOOLS MOC]].
- [[Moss Generator - Thomas Spony and Nick Medukha|Moss Generator — Thomas Spony & Nick Medukha]] — the parent tool.
- [[../../PIPELINE/Notes/DETAILS/PIPELINE ENVIRONMENT|PIPELINE ENVIRONMENT]] — environment workflow.
- [[../../../KNOWLEDGE/PLANTFACTORY/PLANTFACTORY MOC|PlantFactory MOC]] — alternative procedural vegetation.