@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,29 +1,193 @@
1
- # Water Optics
1
+ # Analytic water surface system
2
2
 
3
- Use this reference for local water surfaces in Genex games.
3
+ Use this reference for bounded or analytic water with shared displacement and normals, derivative-filtered detail, analytic reflection, heuristic refraction, absorption, and crest foam. Use `$genex-threejs-spectral-ocean` for stochastic FFT seas.
4
4
 
5
- ## Wave bands
5
+ ## Contents
6
6
 
7
- - Primary waves define visible surface movement.
8
- - Secondary waves add directional complexity.
9
- - Micro normals add sparkle but must fade with distance.
10
- - Interaction ripples should be event-driven and decay over time.
7
+ - cinematic implementation displaced ocean
8
+ - Shared displacement/normal contract
9
+ - cinematic implementation optical hierarchy
10
+ - atlas-based renderer normal-only wave bundle
11
+ - atlas-based renderer refraction and absorption
12
+ - Foam and distance response
13
+ - Objective limits
14
+ - Diagnostics
11
15
 
12
- ## Refraction
13
16
 
14
- - Sample the scene color only when the render pipeline supports it.
15
- - Clamp offsets at silhouettes.
16
- - Provide a non-refraction fallback using color absorption and reflection.
17
- - Keep edge artifacts visible in diagnostics.
17
+ ## cinematic implementation displaced ocean
18
18
 
19
- ## Absorption and depth
19
+ The Miller’s Planet scene uses five authored Gerstner-style components:
20
20
 
21
- - Use depth or an approximate path length to tint deeper water.
22
- - Keep shallow water readable around gameplay-relevant surfaces.
23
- - Expose depth and absorption debug views.
21
+ | Direction X/Z | Amplitude | Wavelength | Steepness |
22
+ | --- | ---: | ---: | ---: |
23
+ | `0.94, 0.32` | 0.38 | 28.0 | 0.50 |
24
+ | `-0.42, 0.91` | 0.24 | 18.0 | 0.46 |
25
+ | `0.78, -0.52` | 0.16 | 12.0 | 0.42 |
26
+ | `-0.35, -0.78` | 0.10 | 10.0 | 0.35 |
27
+ | `0.55, 0.62` | 0.06 | 9.5 | 0.28 |
24
28
 
25
- ## Foam
29
+ For every wave:
26
30
 
27
- - Crest foam follows wave slope or height thresholds.
28
- - Shoreline foam follows terrain or water-edge masks.
29
- - Impact foam follows gameplay events and decays deterministically.
31
+ ```text
32
+ k = / wavelength
33
+ omega = sqrt(9.81 * k)
34
+ phase = k * dot(direction, xz) - omega * time
35
+ horizontal offset = direction * steepness * amplitude * cos(phase)
36
+ vertical offset = amplitude * sin(phase)
37
+ ```
38
+
39
+ The ocean is a `1200 x 1200` plane with `256 x 256` segments. A CPU height
40
+ function evaluates the same five vertical sine terms for camera clearance.
41
+
42
+ ## Shared displacement/normal contract
43
+
44
+ The TSL normal function evaluates the same directions, amplitudes,
45
+ wavelengths, and phases as displacement:
46
+
47
+ ```text
48
+ Nx += direction.x * k * amplitude * sin(phase)
49
+ Ny += steepness * k * amplitude * cos(phase)
50
+ Nz += direction.y * k * amplitude * sin(phase)
51
+ normal = normalize((-Nx, 1 - Ny, -Nz))
52
+ ```
53
+
54
+ This exact parameter sharing is the defining mechanism. If a wave changes,
55
+ both geometry and normal evaluation change together.
56
+
57
+ ## cinematic implementation optical hierarchy
58
+
59
+ The surface adds four smaller sinusoidal normal bands after the displaced
60
+ normal, with spatial scales `0.44`, `0.8`, `1.55`, and `2.8` and decreasing
61
+ strength.
62
+
63
+ Water response:
64
+
65
+ ```text
66
+ F0 = 0.02
67
+ F = F0 + (1 - F0) * (1 - NdotV)^5
68
+ ```
69
+
70
+ Reflection samples the same analytic sky used by the sky dome. Sun response:
71
+
72
+ ```text
73
+ reflection disc = dot(reflection, sun)^2500 * 22
74
+ reflection halo = dot(reflection, sun)^14 * 1.5
75
+ surface specular = dot(normal, halfVector)^1200 * 22
76
+ ```
77
+
78
+ The transmitted body is a deep/shallow blue mix. A forward-scatter term uses
79
+ `dot(view, -sun)^4`, scaled by `0.42 * (1 - Fresnel)`. Crest foam derives from
80
+ `(1 - normal.y)`, and distance haze uses:
81
+
82
+ ```text
83
+ 1 - exp(-distance * 0.0026)
84
+ ```
85
+
86
+ ## atlas-based renderer normal-only wave bundle
87
+
88
+ atlas-based renderer’s water mesh is not displaced by the material. It computes a normal
89
+ and crest from six world-XZ wave bands:
90
+
91
+ ```text
92
+ wavelengths = 12, 6, 2.5, 5.25, 3.0, 1.5
93
+ relative amplitudes = 1, 0.55, 0.22, 0.12, 0.08, 0.05
94
+ directions = wind, cross-wind, 45°, +30°, -30°, +60°
95
+ dispersion = sqrt(9.8 * k)
96
+ ```
97
+
98
+ High-frequency bands are attenuated from screen derivatives:
99
+
100
+ ```text
101
+ aa3 = 1 - smoothstep(0, 2.0, footprint * k3)
102
+ aa4 = 1 - smoothstep(0, 1.5, footprint * k4)
103
+ aa5 = 1 - smoothstep(0, 1.0, footprint * k5)
104
+ ```
105
+
106
+ Two low-amplitude noise gradients add wind-aligned micro-turbulence. The crest
107
+ metric combines slope with phase alignment from all six waves.
108
+
109
+ Use this only when normal-only water is appropriate. Do not claim geometry and
110
+ normal parity because the geometry remains flat.
111
+
112
+ ## atlas-based renderer refraction and absorption
113
+
114
+ Defaults:
115
+
116
+ ```text
117
+ air/water eta = 1 / 1.333
118
+ extra Fresnel bias = 0.035
119
+ absorption = (0.20, 0.06, 0.02) per meter
120
+ fallback depth = 4 m
121
+ refraction strength = 0.18
122
+ roughness control = 0.35
123
+ ```
124
+
125
+ The shader is side-aware:
126
+
127
+ ```text
128
+ above water: eta = air / water
129
+ underwater: eta = water / air
130
+ F0 = ((1 - eta) / (1 + eta))^2 + artistic bias
131
+ ```
132
+
133
+ When scene color exists, it samples two clamped screen offsets from the
134
+ refracted direction and procedural noise. When scene depth is absent, path
135
+ length is approximated from fallback thickness and the refracted vertical
136
+ component:
137
+
138
+ ```text
139
+ path = fallbackDepth / abs(refractedDirection.y)
140
+ transmittance = exp(-absorption * path)
141
+ ```
142
+
143
+ This produces depth-dependent color but not actual object thickness.
144
+
145
+ ## Foam and distance response
146
+
147
+ atlas-based renderer foam:
148
+
149
+ ```text
150
+ foamSeed = noise(xz * 0.9 + wind * time * foamDrift)
151
+ foam = smoothstep(
152
+ threshold,
153
+ 1,
154
+ crest * noisy modulation
155
+ )
156
+ ```
157
+
158
+ It is causally attached to the crest output, then broken up by noise.
159
+
160
+ The material also increases opacity over a configured distance range
161
+ (`25–140` world units) and treats underwater alpha separately. This helps a
162
+ bounded transparent surface meet a far-ocean horizon.
163
+
164
+ ## Objective limits
165
+
166
+ - cinematic implementation uses an authored five-wave sea, not a directional spectrum.
167
+ - atlas-based renderer is normal-only and cannot produce crest silhouette or geometric
168
+ parallax.
169
+ - atlas-based renderer refraction has no depth rejection and can sample foreground objects.
170
+ - Its thickness is a fallback estimate, not reconstructed scene thickness.
171
+ - The demonstrated paths use artistic sky reflection rather than environment
172
+ prefiltering or planar reflection.
173
+ - Crest foam is instantaneous and lacks persistent build/decay.
174
+ - Route to `$genex-threejs-spectral-ocean` when the target is implementation-level
175
+ spectral open water rather than a bounded authored-wave surface.
176
+
177
+ ## Diagnostics
178
+
179
+ Expose:
180
+
181
+ ```text
182
+ each authored wave band
183
+ displaced position and analytic normal
184
+ normal-only versus displaced comparison
185
+ derivative attenuation per micro band
186
+ crest metric before noise
187
+ Fresnel and side classification
188
+ raw refraction UV and validity
189
+ fallback path length and transmittance
190
+ reflection, body scatter, glint, and foam separately
191
+ distance haze/opacity
192
+ CPU versus GPU surface height at camera position
193
+ ```