$npx -y skills add scottstts/Threejs-Awesome-Graphics-Agent-Skills --skill threejs-procedural-vegetationGenerate authored procedural trees, grass, ivy, and vegetation in Three.js. Use for surface-following vines, painted ivy paths, stylized or GPU grass, trunks, recursive branches, roots, canopies, leaf cards, species presets, deterministic growth, and rooted blade or petiole-hinge
| 1 | # Procedural Vegetation |
| 2 | |
| 3 | Represent a plant as a growth hierarchy plus rendering adaptations. Do not model it as randomly scattered cylinders. |
| 4 | |
| 5 | ## Build sequence |
| 6 | |
| 7 | 1. Define a per-level species table: length, radius, taper, child count, emergence range, angle, twist, gnarliness, sections, radial segments. |
| 8 | 2. Grow branches iteratively from a queue so recursion depth and budgets remain inspectable. |
| 9 | 3. Emit each branch as oriented rings with an intentional UV seam. |
| 10 | 4. Update section orientation from: |
| 11 | - inherited direction; |
| 12 | - stochastic curvature; |
| 13 | - tropism or external force; |
| 14 | - optional attraction constraints. |
| 15 | 5. Spawn children with stratified longitudinal slots and independently permuted angular slots. |
| 16 | 6. Generate leaves only after branch topology is stable. |
| 17 | 7. Build foliage normals from both card orientation and local crown volume. |
| 18 | 8. Choose wind scope explicitly. Leaf-root deformation, branch hierarchy deformation, and whole-tree sway are separate systems. |
| 19 | |
| 20 | Read [references/structured-ash-growth-system.md](references/structured-ash-growth-system.md) and preserve its preset, continuation, child-placement, leaf, material, wind, and composition contracts before tuning. |
| 21 | |
| 22 | Read the [Ash Growth System implementation](examples/structured-ash-growth/tree-system.js) |
| 23 | with its [authored preset](examples/structured-ash-growth/ash-preset.js) for a |
| 24 | contract-accurate implementation and its diagnostic attributes. |
| 25 | |
| 26 | Read the |
| 27 | [stylized meadow grass implementation](examples/stylized-meadow-grass/grass-system.js) |
| 28 | for authored blade-cluster geometry with a procedural fallback, image-driven |
| 29 | path masking, per-instance origin/facing attributes, circular-arc rooted wind, |
| 30 | gust fronts, tip flutter, color clumps, macro variation, translucency, and rim |
| 31 | diagnostics. |
| 32 | |
| 33 | Read the |
| 34 | [GPU-computed grass implementation](examples/gpu-computed-grass/gpu-grass-system.js) |
| 35 | for MRT blade-parameter generation, deterministic terrain-conforming placement, |
| 36 | Voronoi clumps, Bezier blade folding, wind-facing yaw, distance LOD/culling, |
| 37 | normal/color fading, translucency, and field diagnostics. |
| 38 | |
| 39 | Read the |
| 40 | [procedural surface ivy entry](examples/procedural-surface-ivy/ivy-effect.js) |
| 41 | and its complete |
| 42 | [TypeScript implementation](examples/procedural-surface-ivy/source/ivy.ts) |
| 43 | for seeded spline-following stems, repeated mesh reprojection, tangent-plane |
| 44 | creep and droop, parallel-transport tube rings, growth reveal, instanced leaves |
| 45 | and umbels, and rigid petiole-hinge wind. Treat the TypeScript modules as the |
| 46 | only implementation; the entry file only re-exports them. |
| 47 | |
| 48 | ## Visual failure conditions |
| 49 | |
| 50 | - branches form visible helices; |
| 51 | - dense grass ignores terrain height or clump-level variation; |
| 52 | - every child emerges at the same relative height; |
| 53 | - bark texture scale changes with branch radius; |
| 54 | - leaves reveal flat card normals under rotation; |
| 55 | - leaf wind moves card roots instead of remaining anchored; |
| 56 | - branch wind is claimed to match a reference whose branches are static; |
| 57 | - different seeds change species identity rather than controlled variation; |
| 58 | - geometry cost grows without a per-level budget; |
| 59 | - surface-following stems are offset from the host or flip normals across seams; |
| 60 | - ivy branches ignore the tangent plane while attached; |
| 61 | - leaf wind rotates around the card center instead of the petiole. |
| 62 | |
| 63 | ## Routing boundary |
| 64 | |
| 65 | Use `$threejs-procedural-geometry` for generic branch-ring emission without a |
| 66 | growth model. This skill owns species tables, vine and branch topology, |
| 67 | surface-following growth, foliage, grass fields, roots, and rooted wind. |