@genex-ai/cli-demo 0.93.0 → 0.94.0-dev.249

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/index.js +26 -5
  2. package/package.json +1 -1
  3. package/templates/skills/genex-ai-model/SKILL.md +3 -2
  4. package/templates/skills/genex-ai-skybox/SKILL.md +4 -4
  5. package/templates/skills/genex-ai-texture/SKILL.md +1 -1
  6. package/templates/skills/genex-ai-video/SKILL.md +1 -1
  7. package/templates/skills/genex-game-director/SKILL.md +321 -411
  8. package/templates/skills/genex-game-director/references/design-contract.md +130 -179
  9. package/templates/skills/genex-game-director/references/routing-map.md +242 -362
  10. package/templates/skills/genex-getting-started/SKILL.md +2 -2
  11. package/templates/skills/genex-threejs-exposure-color-grading/SKILL.md +3 -7
  12. package/templates/skills/genex-threejs-multiplayer/SKILL.md +19 -2
  13. package/templates/skills/genex-threejs-procedural-assets/SKILL.md +112 -0
  14. package/templates/skills/genex-threejs-procedural-materials/SKILL.md +3 -7
  15. package/templates/skills/genex-threejs-procedural-vfx/SKILL.md +6 -11
  16. package/templates/skills/genex-threejs-shadow-systems/SKILL.md +2 -3
  17. package/templates/skills/genex-threejs-visual-validation/SKILL.md +0 -4
  18. package/templates/skills/genex-updates/SKILL.md +1 -1
  19. package/templates/skills/genex-threejs-atmosphere-aerial-perspective/SKILL.md +0 -46
  20. package/templates/skills/genex-threejs-atmosphere-aerial-perspective/references/atmosphere.md +0 -213
  21. package/templates/skills/genex-threejs-bloom/SKILL.md +0 -44
  22. package/templates/skills/genex-threejs-bloom/references/bloom.md +0 -187
  23. package/templates/skills/genex-threejs-exposure-color-grading/references/exposure-grading.md +0 -205
  24. package/templates/skills/genex-threejs-game-content/SKILL.md +0 -198
  25. package/templates/skills/genex-threejs-game-content/references/content-tables.md +0 -269
  26. package/templates/skills/genex-threejs-image-pipeline/SKILL.md +0 -56
  27. package/templates/skills/genex-threejs-image-pipeline/references/image-pipeline.md +0 -197
  28. package/templates/skills/genex-threejs-lighting-design/SKILL.md +0 -144
  29. package/templates/skills/genex-threejs-lighting-design/references/light-recipes.md +0 -137
  30. package/templates/skills/genex-threejs-open-world/SKILL.md +0 -149
  31. package/templates/skills/genex-threejs-open-world/references/terrain-streaming.md +0 -215
  32. package/templates/skills/genex-threejs-precipitation-surfaces/SKILL.md +0 -59
  33. package/templates/skills/genex-threejs-precipitation-surfaces/references/precipitation-surfaces.md +0 -181
  34. package/templates/skills/genex-threejs-procedural-architecture/SKILL.md +0 -50
  35. package/templates/skills/genex-threejs-procedural-architecture/references/architecture-systems.md +0 -509
  36. package/templates/skills/genex-threejs-procedural-fields/SKILL.md +0 -61
  37. package/templates/skills/genex-threejs-procedural-fields/references/field-systems.md +0 -232
  38. package/templates/skills/genex-threejs-procedural-geometry/SKILL.md +0 -39
  39. package/templates/skills/genex-threejs-procedural-geometry/references/mesh-systems.md +0 -202
  40. package/templates/skills/genex-threejs-procedural-materials/references/material-systems.md +0 -198
  41. package/templates/skills/genex-threejs-procedural-planets/SKILL.md +0 -48
  42. package/templates/skills/genex-threejs-procedural-planets/references/planet-systems.md +0 -498
  43. package/templates/skills/genex-threejs-procedural-vegetation/SKILL.md +0 -52
  44. package/templates/skills/genex-threejs-procedural-vegetation/references/vegetation-systems.md +0 -314
  45. package/templates/skills/genex-threejs-procedural-vfx/references/vfx-systems.md +0 -218
  46. package/templates/skills/genex-threejs-raymarched-space-effects/SKILL.md +0 -37
  47. package/templates/skills/genex-threejs-raymarched-space-effects/references/space-effects.md +0 -194
  48. package/templates/skills/genex-threejs-screen-space-ambient-occlusion/SKILL.md +0 -35
  49. package/templates/skills/genex-threejs-screen-space-ambient-occlusion/references/ambient-occlusion.md +0 -441
  50. package/templates/skills/genex-threejs-spectral-ocean/SKILL.md +0 -52
  51. package/templates/skills/genex-threejs-spectral-ocean/references/spectral-ocean.md +0 -473
  52. package/templates/skills/genex-threejs-temporal-surfaces/SKILL.md +0 -41
  53. package/templates/skills/genex-threejs-temporal-surfaces/references/temporal-surfaces.md +0 -207
  54. package/templates/skills/genex-threejs-visual-validation/references/visual-validation.md +0 -427
  55. package/templates/skills/genex-threejs-volumetric-clouds/SKILL.md +0 -49
  56. package/templates/skills/genex-threejs-volumetric-clouds/references/volumetric-clouds.md +0 -579
  57. package/templates/skills/genex-threejs-water-optics/SKILL.md +0 -57
  58. package/templates/skills/genex-threejs-water-optics/references/water-optics.md +0 -195
@@ -1,48 +0,0 @@
1
- ---
2
- name: genex-threejs-procedural-planets
3
- description: Author procedural planets for Genex Three.js games. Use for spherical terrain, continents, ridges, craters, biome masks, coastlines, altitude detail, orbit-to-surface transitions, planet-relative cameras, material variation, and playable planetary bodies.
4
- ---
5
-
6
- # Genex Three.js Procedural Planets
7
-
8
- Build a planet as a coupled field system evaluated on a unit direction. The same geological causes must drive geometry, color, roughness, normal, atmosphere handoff, and distance filtering.
9
-
10
- ## Required build order
11
-
12
- 1. Establish planet-space direction, radius, sea level, and world-unit scale.
13
- 2. Build macro silhouette fields before any surface material.
14
- 3. Add named geological structures: continents, basins, ridges, craters, lava fields, or ice.
15
- 4. Derive slope, cavity, altitude, latitude, exposure, and shoreline fields.
16
- 5. Classify broad biomes from those causes.
17
- 6. Derive displacement, color, roughness, and normal from the shared field bundle.
18
- 7. Filter bands by represented mesh scale and camera altitude.
19
- 8. Couple the material to atmosphere and lighting using the same planet transform.
20
-
21
- Read [references/planet-systems.md](references/planet-systems.md) for terrain, biome, gas-giant, material, altitude-LOD, and atmosphere-handoff mechanisms, including a known CPU/GPU field-parity failure mode.
22
-
23
- ## Non-negotiable constraints
24
-
25
- - Domain-warp tangentially and renormalize; do not distort the sphere radially.
26
- - Craters need floor, wall, rim, and optional ejecta—not dark circles.
27
- - Continents and biomes must be region fields, not isolated threshold bubbles.
28
- - Geometry displacement and shader normals must describe the same height function.
29
- - Close detail may disappear with altitude; the macro silhouette may not.
30
- - Expose individual field views and a displacement exaggeration mode.
31
-
32
- ## Completion test
33
-
34
- The body must remain intentional in:
35
-
36
- - unlit silhouette;
37
- - flat albedo with no atmosphere;
38
- - grazing directional light;
39
- - orbit view;
40
- - close approach;
41
- - biome-mask and normal-only views;
42
- - at least three seeds without losing the chosen planetary identity.
43
-
44
- ## Routing boundary
45
-
46
- Use `$genex-threejs-procedural-fields` for a reusable field bundle without a complete
47
- body, and `$genex-threejs-atmosphere-aerial-perspective` for scattering independent
48
- of planet generation. This skill owns the coupled planetary surface.
@@ -1,498 +0,0 @@
1
- # Planet field and atmosphere systems
2
-
3
- Use this reference for practical planet-space field, material, LOD, biome, giant-body, and atmosphere-handoff mechanisms, including known CPU/GPU parity failure modes.
4
-
5
- ## Contents
6
-
7
- 1. Preserve undeformed sphere direction
8
- 2. Geometry terrain stack and LOD
9
- 3. Shader warp and parity debt
10
- 4. Altitude-filtered detail
11
- 5. Climate, biomes, and body-specific paths
12
- 6. Gas/ice giants and stars
13
- 7. Atmosphere handoff
14
- 8. Adaptation and diagnostics
15
-
16
- ## 1. Preserve undeformed sphere direction
17
-
18
- At geometry construction, write the normalized pre-displacement direction into
19
- a dedicated attribute:
20
-
21
- ```ts
22
- surfaceDirection[i] = normalize(originalSpherePosition)
23
- ```
24
-
25
- Use that attribute for all shader geology:
26
-
27
- ```ts
28
- const radial = attribute("surfaceDirection", "vec3").normalize()
29
- const terrainCoordinateKm = radial * radiusKm
30
- ```
31
-
32
- This prevents interpolated displaced positions from stretching noise on steep
33
- slopes. It is stronger than reconstructing direction from `positionLocal`
34
- after displacement.
35
-
36
- ## 2. Geometry terrain stack
37
-
38
- The CPU geometry path uses deterministic value noise:
39
-
40
- ```text
41
- base frequency:
42
- moon 12.5
43
- rocky 10.2
44
- other solid 8.4
45
-
46
- coordinate warp:
47
- three value-noise channels at 0.75 frequency
48
- amplitude 2.4 in local noise coordinates
49
-
50
- continental:
51
- 5 octaves, frequency multiplier 0.55,
52
- lacunarity 2.03, gain 0.50
53
-
54
- highlands:
55
- 4 octaves, frequency multiplier 1.25,
56
- lacunarity 2.15, gain 0.55
57
-
58
- ridges:
59
- 4 octaves, frequency multiplier 2.7,
60
- lacunarity 2.08, gain 0.52
61
- transformed as 1 - abs(2n - 1)
62
-
63
- crater-like depression for rocky/moon:
64
- 3 octaves at 6.8
65
- pow(1 - saturate(noise), 3.2)
66
- ```
67
-
68
- Composite:
69
-
70
- ```text
71
- height =
72
- 0.62 * continental
73
- + 0.24 * highlands
74
- + 0.34 * ridges
75
- - 0.30 * craterLike
76
- ```
77
-
78
- Terrestrial bodies add a small latitude term. Rocky bodies reinforce ridges.
79
- The result is remapped to `[-1, 1]` and multiplied by the body’s
80
- `terrainAmplitude`.
81
-
82
- This stack is effective for silhouette-scale relief, but its crater term is a
83
- noise-shaped cavity field, not a crater model with explicit bowl/rim/ejecta
84
- topology.
85
-
86
- ## 3. Geometry LOD contract
87
-
88
- Build four complete sphere meshes and switch through `THREE.LOD` with `0.16`
89
- hysteresis.
90
-
91
- Terrestrial:
92
-
93
- ```text
94
- segments: 380, 296, 228, 172
95
- altitude transitions: 2400, 5600, 7600 km
96
- ```
97
-
98
- Rocky:
99
-
100
- ```text
101
- segments: 344, 268, 206, 156
102
- altitude transitions: 2200, 5000, 5800 km
103
- ```
104
-
105
- Generic displaced solid:
106
-
107
- ```text
108
- segments: 320, 248, 192, 148
109
- altitude transitions: 1800, 4000, 5200 km
110
- ```
111
-
112
- Distances are converted through the runtime render scale:
113
-
114
- ```text
115
- distanceWorld = (radiusKm + transitionAltitudeKm) * renderScale
116
- ```
117
-
118
- The same deterministic CPU height function runs for every LOD, preserving the
119
- macro silhouette across switches.
120
-
121
- Avoid storing four full high-density spheres when a chunked
122
- quadtree/icosahedral patch system is required. Whole-sphere LOD is practical
123
- for whole-body views, not ground-scale terrain streaming.
124
-
125
- ## 4. Shader tangential warp
126
-
127
- The material path starts from radius-scaled sphere direction:
128
-
129
- ```text
130
- warp coordinate = terrainKm * 0.00115 + seeded offset
131
- warp = three independent noise channels - 0.5
132
- warpTangent = warp - radial * dot(warp, radial)
133
- warpAmplitudeKm = max(radiusKm * 0.012, 36)
134
- warpedKm =
135
- normalize(terrainKm + warpTangent * warpAmplitudeKm)
136
- * radiusKm
137
- ```
138
-
139
- This removes radial warp and reprojects to the shell, preventing region-scale
140
- coordinate dilation.
141
-
142
- Base material fields:
143
-
144
- ```text
145
- macro A frequency 0.00034, weight 0.52
146
- macro B frequency 0.00092, internal scale 0.52, composite weight 0.33
147
- ridge frequency 0.0029, weight 0.25
148
- crater-like frequency 0.0069, exponent 2.9
149
- crater weight:
150
- rocky/moon 0.34
151
- other 0.09
152
- ```
153
-
154
- The material mixes the synthesized macro field with the actual displaced
155
- radius:
156
-
157
- ```text
158
- macroHeight =
159
- mix(shaderMacroSynthesis, geometryDisplacementHeight, 0.08)
160
- ```
161
-
162
- This is a visual alignment correction, not true function parity.
163
-
164
- ## 5. Objective geometry/material mismatch
165
-
166
- The geometry path uses CPU value noise. The material path uses
167
- `mx_noise_float` with different frequencies, seed offsets, warp behavior, and
168
- body-specific fields.
169
-
170
- Consequences:
171
-
172
- ```text
173
- shader ridges can cross geometry valleys
174
- close bump normals can imply relief absent from silhouette
175
- biome altitude can disagree with actual displaced height
176
- LOD silhouette remains stable, but material causes are only approximately tied
177
- ```
178
-
179
- Mitigate this mismatch by:
180
-
181
- - preserving `surfaceDirection`;
182
- - blending 8% actual displacement into material macro height;
183
- - reducing detail by camera altitude;
184
- - keeping geometric terrain amplitude modest.
185
-
186
- The target skill should improve this when possible:
187
-
188
- 1. implement one shared deterministic field in CPU and shader forms;
189
- 2. validate sampled parity at fixed directions;
190
- 3. derive biome altitude from that shared field;
191
- 4. reserve material-only detail for sub-mesh-scale normal/roughness variation.
192
-
193
- Do not cite planet-space implementation as evidence that independent geometry/material fields are
194
- ideal.
195
-
196
- ## 6. Altitude-filtered detail
197
-
198
- Compute camera altitude from body center and radius, then clamp against an
199
- external detail-altitude uniform:
200
-
201
- ```text
202
- detailAltitude =
203
- min(cameraAltitude, surfaceDetailAltitude)
204
- ```
205
-
206
- Thresholds:
207
-
208
- ```text
209
- near = max(radius * 0.022, 6.5 world units)
210
- mid = max(radius * 0.11, 24 world units)
211
- far = max(radius * 0.50, 140 world units)
212
-
213
- nearWeight = 1 - smoothstep(near, mid, altitude)
214
- farWeight = smoothstep(mid, far, altitude)
215
- midWeight = saturate(1 - nearWeight - farWeight)
216
- ```
217
-
218
- Use these weights for:
219
-
220
- - normal perturbation;
221
- - bump height;
222
- - coastline edge width;
223
- - wave detail;
224
- - clearcoat;
225
- - material micro-variation.
226
-
227
- Do not change procedural frequency abruptly. Fade contribution strength.
228
-
229
- ## 7. Climate and biome causes
230
-
231
- The shared solid-body material derives:
232
-
233
- ```text
234
- humidity =
235
- 0.65 * broadNoise(0.0022)
236
- + 0.35 * detailNoise(0.0075)
237
-
238
- temperature =
239
- (1 - abs(latitude)^1.35) * 0.85
240
- + 0.15
241
- - macroHeight * 0.32
242
-
243
- slope =
244
- 1 - abs(dot(localNormal, radialDirection))
245
- ```
246
-
247
- Biome jitter uses a higher-frequency field at `0.018`.
248
-
249
- Generic masks:
250
-
251
- ```text
252
- snow: latitude + height + cold + small jitter
253
- arid: inverse humidity + warmth - height + jitter
254
- lush: humidity * temperature - aridity - slope + jitter
255
- rock: slope + ridges + inverse humidity + jitter magnitude
256
- ```
257
-
258
- The body-specific paths expand these causes rather than switching to arbitrary
259
- color noise.
260
-
261
- ## 8. Pelagia terrestrial path
262
-
263
- Pelagia’s definition:
264
-
265
- ```text
266
- radius 12000 km
267
- terrain amplitude 0.018
268
- atmosphere height 200 km
269
- atmosphere density 1.05
270
- ```
271
-
272
- Continents use an additional low-frequency three-channel warp with a fixed
273
- `520 km` amplitude, followed by:
274
-
275
- ```text
276
- continent frequencies: 0.00022, 0.00048, 0.00095
277
- weights: 0.60, 0.28, 0.12
278
- coast jitter: 0.0024
279
- coast micro-jitter: 0.0085
280
- ```
281
-
282
- The implementation keeps two coast widths:
283
-
284
- ```text
285
- visual color edge:
286
- altitude-filtered 0.016 -> 0.004
287
-
288
- physical land/water edge:
289
- altitude-filtered 0.006 -> 0.0014
290
- ```
291
-
292
- This prevents orbit-view aliasing while keeping water material classification
293
- sharper.
294
-
295
- Terrain causes include:
296
-
297
- - ridged tectonic chains and foothills;
298
- - altitude lapse-rate cooling;
299
- - subtropical aridity bands;
300
- - forest coverage fields;
301
- - tropical, temperate, boreal, desert, tundra, ice, rock, snow, and beach
302
- weights;
303
- - depth-graded ocean color;
304
- - water currents and animated wave detail;
305
- - wetness-driven roughness/specular/clearcoat.
306
-
307
- This path is useful because land color, roughness, normal, snow, wetness, and
308
- water identity share causes.
309
-
310
- ## 9. Astra rocky path
311
-
312
- Astra’s definition:
313
-
314
- ```text
315
- radius 5600 km
316
- terrain amplitude 0.008
317
- thin 45 km atmosphere
318
- ```
319
-
320
- Its material adds:
321
-
322
- ```text
323
- basin-scale crater-like field at 0.00028
324
- regional crater-like field at 0.0018
325
- micro fields at 0.012 and 0.035
326
- intercrater plains
327
- bright ejecta-like ridges
328
- lobate scarp-like ridges
329
- volatile-loss hollow masks
330
- three-band surface detail
331
- ```
332
-
333
- Crater rims are estimated from offset-noise gradient magnitudes. Ejecta rays
334
- are ridged noise correlated with the regional crater field.
335
-
336
- This produces a rich Mercury-like material, but the “craters” remain
337
- field-shaped rather than explicit geodesic crater stamps. Treat it as a
338
- multi-scale material-causality pattern, not as a final crater geometry
339
- algorithm.
340
-
341
- ## 10. Verdance rocky path
342
-
343
- Verdance’s definition:
344
-
345
- ```text
346
- radius 13600 km
347
- terrain amplitude 0.02
348
- 200 km dusty atmosphere
349
- ```
350
-
351
- Its Mars-like identity layers:
352
-
353
- - hemispheric dichotomy with warped boundary;
354
- - broad volcanic province and caldera mask;
355
- - ridged equatorial canyon system;
356
- - degraded highland and lowland crater fields;
357
- - wind-aligned dunes;
358
- - global dust mantling;
359
- - dark slope streaks;
360
- - limited basalt exposure;
361
- - polar CO2 ice and layered polar terrain.
362
-
363
- Wind-aligned dune coordinates are built from a fixed wind basis:
364
-
365
- ```text
366
- u = dot(position, windDirection)
367
- v = dot(position, perpendicularWindDirection)
368
- ```
369
-
370
- Macro and meso ridge fields are filtered with derivatives to reduce aliasing.
371
-
372
- ## 11. Gas and ice giants
373
-
374
- Avoid longitude seams by representing longitude on a unit circle:
375
-
376
- ```text
377
- longitude = atan(z, x)
378
- advectedLongitude = longitude + time * jetSpeed(latitude)
379
- longitudeVector = [cos(advectedLongitude), sin(advectedLongitude)]
380
- ```
381
-
382
- Build the procedural coordinate from:
383
-
384
- ```text
385
- [longitudeVector.x, longitudeVector.y, latitude01]
386
- ```
387
-
388
- The band system combines:
389
-
390
- - latitude-dependent advection;
391
- - low-frequency warp;
392
- - 20 gas-giant or 16 ice-giant bands;
393
- - band noise;
394
- - turbulent ridges;
395
- - sparse storm masks and internal swirl;
396
- - soft terminator;
397
- - limb darkening and limb haze;
398
- - wrapped diffuse illumination that keeps thick cloud decks faintly luminous
399
- into the night-side edge.
400
-
401
- This is a separate representation from solid terrain. Do not route gas giants
402
- through the rocky biome stack.
403
-
404
- ## 12. Procedural bump and specular anti-aliasing
405
-
406
- Derive a screen-space bump normal from height derivatives:
407
-
408
- ```text
409
- sigmaX = normalize(dFdx(positionView))
410
- sigmaY = normalize(dFdy(positionView))
411
- dH = [dFdx(height), dFdy(height)] * bumpScale
412
-
413
- r1 = cross(sigmaY, normalView)
414
- r2 = cross(normalView, sigmaX)
415
- det = dot(sigmaX, r1)
416
-
417
- bumpNormal =
418
- normalize(max(abs(det), epsilon) * normalView
419
- - sign(det) * (dH.x * r1 + dH.y * r2))
420
- ```
421
-
422
- Blend this with the broader perturbed normal using altitude weights.
423
-
424
- Then increase roughness from normal variance:
425
-
426
- ```text
427
- sigma² = max(dot(dFdx(N), dFdx(N)), dot(dFdy(N), dFdy(N)))
428
- kernelRoughness = min(scale * sigma², 1)
429
- filteredRoughness =
430
- sqrt(baseRoughness² + kernelRoughness)
431
- ```
432
-
433
- This is a directly reusable anti-sparkle contract for procedural planets.
434
-
435
- ## 13. Atmosphere handoff and limb clipping
436
-
437
- The material applies distance-gated limb clipping for displaced atmospheric
438
- bodies. It tests whether the camera ray to the fragment misses the base sphere
439
- using an angular discriminant, avoiding catastrophic precision loss at large
440
- distances.
441
-
442
- Clip strength grows with:
443
-
444
- ```text
445
- atmosphere visual height fraction
446
- body radius fraction
447
- minimum world-space fade range
448
- camera detail altitude
449
- ```
450
-
451
- Pelagia and Verdance disable the clip beyond about `10000 km` altitude with a
452
- `1200 km` fade range.
453
-
454
- Atmosphere rendering uses one model across shell and post paths, with
455
- front/back shell opacity blended as the camera crosses the atmosphere. Preserve
456
- that handoff; do not independently tune shell and post colors.
457
-
458
- ## 14. Refactor guidance
459
-
460
- A visually rich all-body material can become very large and body-ID
461
- conditional. Split it into atomic layers:
462
-
463
- ```text
464
- shared planet coordinates and altitude LOD
465
- shared climate/biome causes
466
- solid-body material assembly
467
- gas/ice giant band system
468
- rocky cratered identity
469
- terrestrial continent/ocean identity
470
- dusty Mars identity
471
- procedural bump + specular AA
472
- atmosphere limb handoff
473
- ```
474
-
475
- Keep body presets as data where possible. Use specialized code only when the
476
- representation changes, such as gas giant bands versus solid terrain.
477
-
478
- ## 15. Required diagnostics
479
-
480
- Expose:
481
-
482
- ```text
483
- CPU geometry height
484
- shader macro height
485
- their absolute difference
486
- tangential warp magnitude
487
- near/mid/far detail weights
488
- continent field and coast widths
489
- climate humidity/temperature
490
- biome masks
491
- rock/snow/wetness
492
- water depth classification
493
- body-specific geological fields
494
- procedural bump height
495
- normal variance roughness
496
- limb clip mask
497
- shell/post atmosphere blend
498
- ```
@@ -1,52 +0,0 @@
1
- ---
2
- name: genex-threejs-procedural-vegetation
3
- description: Generate procedural vegetation for Genex Three.js games. Use for trees, trunks, roots, recursive branches, canopies, leaf cards, stylized meadow grass, GPU-computed grass fields, grass clumps, species presets, deterministic variation, growth forces, rooted blade and leaf wind, wind deformation, and vegetation that supports navigation or scene readability.
4
- ---
5
-
6
- # Genex Three.js Procedural Vegetation
7
-
8
- Represent a plant as a growth hierarchy plus rendering adaptations. Do not model it as randomly scattered cylinders.
9
-
10
- ## Build sequence
11
-
12
- 1. Define a per-level species table: length, radius, taper, child count, emergence range, angle, twist, gnarliness, sections, radial segments.
13
- 2. Grow branches iteratively from a queue so recursion depth and budgets remain inspectable.
14
- 3. Emit each branch as oriented rings with an intentional UV seam.
15
- 4. Update section orientation from:
16
- - inherited direction;
17
- - stochastic curvature;
18
- - tropism or external force;
19
- - optional attraction constraints.
20
- 5. Spawn children with stratified longitudinal slots and independently permuted angular slots.
21
- 6. Generate leaves only after branch topology is stable.
22
- 7. Build foliage normals from both card orientation and local crown volume.
23
- 8. Choose wind scope explicitly. Leaf-root deformation, branch hierarchy deformation, and whole-tree sway are separate systems.
24
-
25
- Read [references/vegetation-systems.md](references/vegetation-systems.md) and preserve its preset, continuation, child-placement, leaf, material, wind, and composition contracts before tuning.
26
-
27
- ## Grass fields
28
-
29
- Grass is either instanced blade clusters (per-instance origin, facing, and
30
- height, with circular-arc rooted wind that bends blades from the ground up) or
31
- GPU-generated blade fields (blades written in render targets with Voronoi clump
32
- variation, folded blade curvature, and distance-based density falloff). Both
33
- keep terrain height and clump identity as shared causes; scattering blades with
34
- uniform randomness produces lawn noise, not a meadow.
35
-
36
- ## Visual failure conditions
37
-
38
- - branches form visible helices;
39
- - every child emerges at the same relative height;
40
- - dense grass ignores terrain height or clump-level variation;
41
- - bark texture scale changes with branch radius;
42
- - leaves reveal flat card normals under rotation;
43
- - leaf wind moves card roots instead of remaining anchored;
44
- - branch wind is claimed to match a reference whose branches are static;
45
- - different seeds change species identity rather than controlled variation;
46
- - geometry cost grows without a per-level budget.
47
-
48
- ## Routing boundary
49
-
50
- Use `$genex-threejs-procedural-geometry` for generic branch-ring emission without a
51
- growth model. This skill owns species tables, topology, child placement,
52
- foliage, grass fields, roots, and hierarchical/rooted wind.