@genex-ai/cli-demo 0.6.0 → 0.6.2

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 (45) hide show
  1. package/dist/index.js +5 -0
  2. package/package.json +1 -1
  3. package/templates/skills/genex-threejs-atmosphere-aerial-perspective/SKILL.md +30 -18
  4. package/templates/skills/genex-threejs-atmosphere-aerial-perspective/references/atmosphere.md +204 -20
  5. package/templates/skills/genex-threejs-bloom/SKILL.md +29 -18
  6. package/templates/skills/genex-threejs-bloom/references/bloom.md +176 -20
  7. package/templates/skills/genex-threejs-camera-direction/SKILL.md +38 -26
  8. package/templates/skills/genex-threejs-camera-direction/references/camera-rigs.md +359 -27
  9. package/templates/skills/genex-threejs-exposure-color-grading/SKILL.md +27 -18
  10. package/templates/skills/genex-threejs-exposure-color-grading/references/exposure-grading.md +196 -21
  11. package/templates/skills/genex-threejs-image-pipeline/SKILL.md +38 -17
  12. package/templates/skills/genex-threejs-image-pipeline/references/image-pipeline.md +185 -29
  13. package/templates/skills/genex-threejs-procedural-animation/SKILL.md +34 -21
  14. package/templates/skills/genex-threejs-procedural-animation/references/procedural-motion.md +353 -24
  15. package/templates/skills/genex-threejs-procedural-architecture/SKILL.md +36 -17
  16. package/templates/skills/genex-threejs-procedural-architecture/references/architecture-systems.md +500 -22
  17. package/templates/skills/genex-threejs-procedural-fields/SKILL.md +59 -24
  18. package/templates/skills/genex-threejs-procedural-fields/references/field-systems.md +222 -25
  19. package/templates/skills/genex-threejs-procedural-geometry/SKILL.md +34 -20
  20. package/templates/skills/genex-threejs-procedural-geometry/references/mesh-systems.md +192 -26
  21. package/templates/skills/genex-threejs-procedural-materials/SKILL.md +55 -18
  22. package/templates/skills/genex-threejs-procedural-materials/references/material-systems.md +189 -22
  23. package/templates/skills/genex-threejs-procedural-planets/SKILL.md +36 -18
  24. package/templates/skills/genex-threejs-procedural-planets/references/planet-systems.md +489 -21
  25. package/templates/skills/genex-threejs-procedural-vegetation/SKILL.md +35 -25
  26. package/templates/skills/genex-threejs-procedural-vegetation/references/vegetation-systems.md +304 -27
  27. package/templates/skills/genex-threejs-procedural-vfx/SKILL.md +26 -18
  28. package/templates/skills/genex-threejs-procedural-vfx/references/vfx-systems.md +208 -20
  29. package/templates/skills/genex-threejs-raymarched-space-effects/SKILL.md +25 -18
  30. package/templates/skills/genex-threejs-raymarched-space-effects/references/space-effects.md +185 -21
  31. package/templates/skills/genex-threejs-screen-space-ambient-occlusion/SKILL.md +23 -17
  32. package/templates/skills/genex-threejs-screen-space-ambient-occlusion/references/ambient-occlusion.md +430 -20
  33. package/templates/skills/genex-threejs-shadow-systems/SKILL.md +29 -18
  34. package/templates/skills/genex-threejs-shadow-systems/references/shadow-systems.md +420 -21
  35. package/templates/skills/genex-threejs-skill-router/SKILL.md +21 -21
  36. package/templates/skills/genex-threejs-spectral-ocean/SKILL.md +30 -20
  37. package/templates/skills/genex-threejs-spectral-ocean/references/spectral-ocean.md +462 -22
  38. package/templates/skills/genex-threejs-temporal-surfaces/SKILL.md +26 -17
  39. package/templates/skills/genex-threejs-temporal-surfaces/references/temporal-surfaces.md +198 -20
  40. package/templates/skills/genex-threejs-visual-validation/SKILL.md +34 -18
  41. package/templates/skills/genex-threejs-visual-validation/references/visual-validation.md +396 -32
  42. package/templates/skills/genex-threejs-volumetric-clouds/SKILL.md +33 -17
  43. package/templates/skills/genex-threejs-volumetric-clouds/references/volumetric-clouds.md +570 -21
  44. package/templates/skills/genex-threejs-water-optics/SKILL.md +33 -18
  45. package/templates/skills/genex-threejs-water-optics/references/water-optics.md +184 -20
@@ -1,31 +1,198 @@
1
- # Material Systems
1
+ # Procedural PBR material systems
2
2
 
3
- Use this reference when building procedural materials for Genex games.
3
+ Use this reference for atlas filtering, shared shadow and light causes, planet-space material fields, wetness, per-instance dissolve, and authored physical-material identities.
4
4
 
5
- ## PBR roles
5
+ ## Contents
6
6
 
7
- - Base color carries identity and broad variation.
8
- - Roughness controls highlight size and material age.
9
- - Metalness should usually be binary or near-binary by surface type.
10
- - Normals add shape detail but should not replace silhouette.
11
- - Emission should have a scene-relative intensity hierarchy.
7
+ - atlas-based renderer block material
8
+ - Atlas and minification response
9
+ - Shared shadow/light causes
10
+ - planet-space implementation planetary material
11
+ - pooled VFX system terrain and debris
12
+ - selective gallery pipeline authored PBR identities
13
+ - Selection rules and limitations
14
+ - Diagnostics
12
15
 
13
- ## Filtering
14
16
 
15
- - Fade micro normals with distance.
16
- - Use mip-aware texture sampling for generated atlases.
17
- - Reduce specular aliasing on tiny bright details.
18
- - Avoid unbounded high-frequency noise in motion.
17
+ ## atlas-based renderer block material
19
18
 
20
- ## Common masks
19
+ The block material is a complete custom shader whose inputs include:
21
20
 
22
- - Wetness: driven by water height, splash, or exposed low points.
23
- - Wear: driven by edges, contact, pathing, or gameplay interaction.
24
- - Heat: driven by event timelines and cooling curves.
25
- - Dissolve: driven by a stable object-space or authored field.
26
- - Biome: driven by altitude, slope, latitude, moisture, or gameplay zones.
21
+ ```text
22
+ atlas albedo and optional normal
23
+ per-vertex AO/skylight/tint color
24
+ sun direction/color
25
+ four custom shadow cascades
26
+ projected procedural cloud shadow
27
+ environment cube
28
+ roughness/metalness
29
+ daylight and starlight factors
30
+ ```
27
31
 
28
- ## Debug views
32
+ Its useful material mechanisms are:
29
33
 
30
- Provide direct views of base color, roughness, normals, mask values, emission,
31
- and final lit material before post-processing.
34
+ 1. world position and view-space depth remain available for cascade choice;
35
+ 2. world-space shadow texel width scales bias and filter radius;
36
+ 3. cloud shadow projects a receiver point to a cloud plane along sun direction;
37
+ 4. normal derivatives increase effective roughness;
38
+ 5. atlas sampling clamps to the current tile interior;
39
+ 6. anisotropic minification chooses a major-axis multi-tap filter.
40
+
41
+ Specular antialiasing:
42
+
43
+ ```text
44
+ variance =
45
+ max(dot(dFdx(N), dFdx(N)),
46
+ dot(dFdy(N), dFdy(N)))
47
+
48
+ filteredRoughness =
49
+ clamp(sqrt(roughness^2 + variance), 0, 1)
50
+ ```
51
+
52
+ This is a practical filtering mechanism. It should still be compared against the
53
+ renderer’s current physical-material and normal-filtering behavior before
54
+ replacing built-in shading.
55
+
56
+ ## Atlas and minification response
57
+
58
+ For an atlas with `atlasSize` tiles across and `tileSize` texels per tile:
59
+
60
+ ```text
61
+ tile width = 1 / atlasSize
62
+ horizontal inset = 0.5 / (atlasSize * tileSize)
63
+ vertical inset = 0.5 / tileSize
64
+ ```
65
+
66
+ Estimate the `dFdx/dFdy` footprint in texels. When minification grows, blend
67
+ away from the base sample. If anisotropy exceeds `2`, sample `7` or `9` taps
68
+ along the major axis.
69
+
70
+ This avoids adjacent-tile bleed for direct taps, but shader clamping cannot fix
71
+ atlas mip levels that were generated without duplicated tile borders. Require
72
+ offline mip-safe padding when adopting this mechanism.
73
+
74
+ ## Shared shadow/light causes
75
+
76
+ atlas-based renderer’s cloud shadow uses the same conceptual field as its visible cloud
77
+ layer:
78
+
79
+ ```text
80
+ project receiver to cloud altitude along sun direction
81
+ advect by shared wind and time scale
82
+ evaluate the same five-octave cloud field
83
+ apply coverage and density shaping
84
+ attenuate direct sunlight
85
+ ```
86
+
87
+ The material does not darken emission or all ambient response with this term.
88
+ Keep projected environmental shadows attached to direct-light ownership.
89
+
90
+ ## planet-space implementation planetary material
91
+
92
+ planet-space implementation’s solid planets preserve an undeformed radial attribute and use it for
93
+ all geological sampling. Camera-altitude weights reduce high-frequency bump
94
+ and optical detail.
95
+
96
+ For gas and ice giants, seam-free longitude is represented as:
97
+
98
+ ```text
99
+ longitude = atan(z, x)
100
+ longitude circle = (cos(longitude + advection), sin(longitude + advection))
101
+ coordinate = (circle.x, circle.y, latitude01)
102
+ ```
103
+
104
+ Latitude bands, seeded warp, turbulence, and storm masks share this coordinate.
105
+ Roughness responds to the same final mask. Limb haze and wrapped diffuse
106
+ lighting are added separately.
107
+
108
+ For solid bodies, procedural bump normal is derived from screen derivatives of
109
+ the height node and view position. This keeps the renderer’s material lighting
110
+ path while changing only the normal input.
111
+
112
+ The known debt is geometry/material field mismatch; see the planet and field
113
+ references. Do not infer that close bump can substitute for silhouette parity.
114
+
115
+ ## pooled VFX system terrain and debris
116
+
117
+ Terrain identity:
118
+
119
+ ```text
120
+ grassness = smoothstep(0.01, 1, normalWorld.y^1.6)
121
+ color = mix(shared-noise soil, shared-noise grass, grassness)
122
+ roughness = blend(soil response, grass response, grassness) - wetness
123
+ metalness = 0.2
124
+ ```
125
+
126
+ Wetness comes from world height near the water plane and the broad noise field.
127
+ It changes roughness and color together.
128
+
129
+ Debris uses per-instance `isOrange` and `removalTimeSeconds`. Geometry-space
130
+ noise controls discard as lifetime expires. Its color is reinforced at the rim
131
+ through Fresnel and receives a small environment term of `0.05`.
132
+
133
+ The reusable pattern is per-instance material state, not one cloned material
134
+ per object.
135
+
136
+ ## selective gallery pipeline authored PBR identities
137
+
138
+ The gallery defines distinct frame surfaces with real texture and response
139
+ bundles:
140
+
141
+ | Surface | Roughness | Metalness | Clearcoat | Clearcoat roughness | Bump |
142
+ | --- | ---: | ---: | ---: | ---: | ---: |
143
+ | walnut | 0.42 | 0.04 | 0.62 | 0.28 | 0.022 |
144
+ | antique gold | 0.24 | 0.78 | 0.24 | 0.20 | 0.012 |
145
+ | ebony | 0.40 | 0.03 | 0.70 | 0.24 | 0.018 |
146
+
147
+ Wall plaster stays near roughness `0.94–0.96`, floor `0.92`, and mat board
148
+ `0.92`. These ranges preserve material separation before bloom.
149
+
150
+ Chandelier bloom meshes intentionally use `MeshBasicMaterial`, with bulb and
151
+ filament materials marked `toneMapped = false`. That is contribution ownership
152
+ for a stylized light source, not a physically based metal recipe.
153
+
154
+ ## Selection rules and limitations
155
+
156
+ Use the material mechanisms according to representation:
157
+
158
+ ```text
159
+ atlas voxel surface -> atlas-based renderer filtering and custom shadow hooks
160
+ planet surface -> planet-space implementation radial fields and altitude filtering
161
+ terrain/wetness -> pooled VFX system world-height causal blend
162
+ authored luxury material -> selective gallery pipeline response bundle
163
+ pooled effect debris -> pooled VFX system per-instance attributes
164
+ ```
165
+
166
+ Do not combine every mechanism into one universal material.
167
+
168
+ Exact node/material extension hooks are version-sensitive. Inspect the
169
+ installed renderer before porting atlas-based renderer's full custom shader or adapting
170
+ planet-space implementation's node-material normal and emissive inputs.
171
+
172
+ Observed limits:
173
+
174
+ - atlas-based renderer replaces the full physical shader, increasing maintenance and making
175
+ backend migration harder.
176
+ - Its custom lighting must be checked for energy consistency and environment
177
+ parity.
178
+ - selective gallery pipeline’s chandelier basic materials rely on selective bloom and are not a
179
+ substitute for lit metal in non-emissive views.
180
+ - pooled VFX system uses undefined reversed-edge `smoothstep` in wetness expressions; write
181
+ portable equivalent logic.
182
+ - planet-space implementation has approximate rather than exact geometry/material field parity.
183
+
184
+ ## Diagnostics
185
+
186
+ Expose:
187
+
188
+ ```text
189
+ atlas tile and sample footprint
190
+ roughness before/after specular AA
191
+ cloud shadow field
192
+ shadow cascade and world texel size
193
+ planet coordinate, altitude weights, and material masks
194
+ terrain grassness and wetness
195
+ debris instance attributes and dissolve threshold
196
+ base frame material without post
197
+ raw emissive contribution for bloom-only materials
198
+ ```
@@ -5,26 +5,44 @@ description: Author procedural planets for Genex Three.js games. Use for spheric
5
5
 
6
6
  # Genex Three.js Procedural Planets
7
7
 
8
- Planets must hold up across extreme scale changes. Build shared terrain,
9
- material, atmosphere, and camera rules around one planet contract.
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.
10
9
 
11
- Read [references/planet-systems.md](references/planet-systems.md) for terrain
12
- fields, LOD, materials, and orbit-to-surface checks.
10
+ ## Required build order
13
11
 
14
- ## Build order
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.
15
20
 
16
- 1. Define radius, gravity/up convention, playable altitude range, camera envelope,
17
- and target quality tiers.
18
- 2. Build low-frequency continent and elevation fields.
19
- 3. Add ridges, craters, erosion bands, biome masks, and coastline rules.
20
- 4. Derive normals, material masks, and gameplay zones from the same fields.
21
- 5. Add atmosphere and clouds only after terrain readability is stable.
22
- 6. Expose debug views for elevation, slope, biome, coast, normal, and LOD.
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.
23
22
 
24
- ## Rules
23
+ ## Non-negotiable constraints
25
24
 
26
- - Use planet-relative up vectors for cameras, actors, and placement.
27
- - Keep procedural detail stable between orbit and close approach.
28
- - Filter altitude detail by camera distance and surface scale.
29
- - Avoid unrelated noise layers that break geological cause.
30
- - Make spawn points, traversal zones, and hazards serializable by seed.
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.