@genex-ai/cli-demo 0.6.1 → 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 (44) hide show
  1. package/package.json +1 -1
  2. package/templates/skills/genex-threejs-atmosphere-aerial-perspective/SKILL.md +30 -18
  3. package/templates/skills/genex-threejs-atmosphere-aerial-perspective/references/atmosphere.md +204 -20
  4. package/templates/skills/genex-threejs-bloom/SKILL.md +29 -18
  5. package/templates/skills/genex-threejs-bloom/references/bloom.md +176 -20
  6. package/templates/skills/genex-threejs-camera-direction/SKILL.md +38 -26
  7. package/templates/skills/genex-threejs-camera-direction/references/camera-rigs.md +359 -27
  8. package/templates/skills/genex-threejs-exposure-color-grading/SKILL.md +27 -18
  9. package/templates/skills/genex-threejs-exposure-color-grading/references/exposure-grading.md +196 -21
  10. package/templates/skills/genex-threejs-image-pipeline/SKILL.md +38 -17
  11. package/templates/skills/genex-threejs-image-pipeline/references/image-pipeline.md +185 -29
  12. package/templates/skills/genex-threejs-procedural-animation/SKILL.md +34 -21
  13. package/templates/skills/genex-threejs-procedural-animation/references/procedural-motion.md +353 -24
  14. package/templates/skills/genex-threejs-procedural-architecture/SKILL.md +36 -17
  15. package/templates/skills/genex-threejs-procedural-architecture/references/architecture-systems.md +500 -22
  16. package/templates/skills/genex-threejs-procedural-fields/SKILL.md +59 -24
  17. package/templates/skills/genex-threejs-procedural-fields/references/field-systems.md +222 -25
  18. package/templates/skills/genex-threejs-procedural-geometry/SKILL.md +34 -20
  19. package/templates/skills/genex-threejs-procedural-geometry/references/mesh-systems.md +192 -26
  20. package/templates/skills/genex-threejs-procedural-materials/SKILL.md +55 -18
  21. package/templates/skills/genex-threejs-procedural-materials/references/material-systems.md +189 -22
  22. package/templates/skills/genex-threejs-procedural-planets/SKILL.md +36 -18
  23. package/templates/skills/genex-threejs-procedural-planets/references/planet-systems.md +489 -21
  24. package/templates/skills/genex-threejs-procedural-vegetation/SKILL.md +35 -25
  25. package/templates/skills/genex-threejs-procedural-vegetation/references/vegetation-systems.md +304 -27
  26. package/templates/skills/genex-threejs-procedural-vfx/SKILL.md +26 -18
  27. package/templates/skills/genex-threejs-procedural-vfx/references/vfx-systems.md +208 -20
  28. package/templates/skills/genex-threejs-raymarched-space-effects/SKILL.md +25 -18
  29. package/templates/skills/genex-threejs-raymarched-space-effects/references/space-effects.md +185 -21
  30. package/templates/skills/genex-threejs-screen-space-ambient-occlusion/SKILL.md +23 -17
  31. package/templates/skills/genex-threejs-screen-space-ambient-occlusion/references/ambient-occlusion.md +430 -20
  32. package/templates/skills/genex-threejs-shadow-systems/SKILL.md +29 -18
  33. package/templates/skills/genex-threejs-shadow-systems/references/shadow-systems.md +420 -21
  34. package/templates/skills/genex-threejs-skill-router/SKILL.md +21 -21
  35. package/templates/skills/genex-threejs-spectral-ocean/SKILL.md +30 -20
  36. package/templates/skills/genex-threejs-spectral-ocean/references/spectral-ocean.md +462 -22
  37. package/templates/skills/genex-threejs-temporal-surfaces/SKILL.md +26 -17
  38. package/templates/skills/genex-threejs-temporal-surfaces/references/temporal-surfaces.md +198 -20
  39. package/templates/skills/genex-threejs-visual-validation/SKILL.md +34 -18
  40. package/templates/skills/genex-threejs-visual-validation/references/visual-validation.md +396 -32
  41. package/templates/skills/genex-threejs-volumetric-clouds/SKILL.md +33 -17
  42. package/templates/skills/genex-threejs-volumetric-clouds/references/volumetric-clouds.md +570 -21
  43. package/templates/skills/genex-threejs-water-optics/SKILL.md +33 -18
  44. package/templates/skills/genex-threejs-water-optics/references/water-optics.md +184 -20
@@ -1,30 +1,194 @@
1
- # Space Effects
1
+ # Curved-ray numerical integrators
2
2
 
3
- Use this reference for black holes, wormholes, and other space phenomena.
3
+ Use this reference for an RK4 wormhole integrator and an artistic inverse-square curved-ray accretion volume, including state reduction, disk accumulation, background lensing, and numerical diagnostics.
4
4
 
5
- ## Curved rays
5
+ ## Contents
6
6
 
7
- - Start with a straight-ray environment lookup.
8
- - Add a bounded steering function.
9
- - Limit step count and maximum bend.
10
- - Record whether the ray hit, escaped, or exceeded bounds.
7
+ - Wormhole state reduction
8
+ - Wormhole RK4 integration
9
+ - Universe selection
10
+ - accretion volume screen-volume integration
11
+ - Disk density and color
12
+ - Background lensing
13
+ - Observed defects and boundaries
14
+ - Diagnostics
11
15
 
12
- ## Accretion disks
13
16
 
14
- - Use radial density and temperature bands.
15
- - Add noise only as structured turbulence.
16
- - Keep disk emission bounded relative to scene exposure.
17
- - Allow the disk to be disabled for diagnostics.
17
+ ## Wormhole state reduction
18
18
 
19
- ## Wormholes and portals
19
+ The wormhole renderer uses a spherically symmetric throat model. It reduces
20
+ each 3D ray to a two-dimensional integration state:
20
21
 
21
- - Define entry and exit transforms clearly.
22
- - Separate playable teleport state from visual distortion.
23
- - Provide edge masks and depth rules for compositing.
22
+ ```text
23
+ y.x = signed radial coordinate l
24
+ y.y = radial momentum pL
25
+ impact parameter b = length(cross(rayOrigin, rayDirection))
26
+ throat radius Rth = 1.2
27
+ ```
24
28
 
25
- ## Validation
29
+ It constructs an orbital plane:
26
30
 
27
- - Capture near, design, and far distances.
28
- - Check fast camera rotation.
29
- - Inspect low-quality fallback.
30
- - Confirm the rest of the game remains readable around the effect.
31
+ ```text
32
+ normal = normalize(cross(origin, direction))
33
+ u = normalize(origin)
34
+ v = cross(normal, u)
35
+ ```
36
+
37
+ Near-radial rays use fallback axes to avoid a zero cross product.
38
+
39
+ Initial signed coordinate:
40
+
41
+ ```text
42
+ l = sqrt(max(length(origin)^2 - Rth^2, 0.001))
43
+ pL = dot(normalize(origin), direction)
44
+ ```
45
+
46
+ ## Wormhole RK4 integration
47
+
48
+ The derivative is:
49
+
50
+ ```text
51
+ r2 = l^2 + Rth^2
52
+ dl/ds = r2 * pL
53
+ dpL/ds = b^2 * l / r2
54
+ ```
55
+
56
+ The shader runs fourth-order Runge–Kutta with:
57
+
58
+ ```text
59
+ maximum iterations = 920
60
+ base step = 0.0042
61
+ per-ray step jitter = +/- 0.00045
62
+ escape distance = abs(l) > 40
63
+ azimuth accumulation = step * b
64
+ ```
65
+
66
+ On escape:
67
+
68
+ ```text
69
+ finalDirection =
70
+ normalize(u * cos(phi) + v * sin(phi))
71
+ ```
72
+
73
+ The sign of final `l` selects which exterior universe is visible. Failure to
74
+ escape renders a bright fallback color, making iteration-cap pixels observable.
75
+
76
+ This is materially stronger than a UV swirl because the final environment
77
+ direction comes from numerical integration.
78
+
79
+ ## Universe selection
80
+
81
+ The two exterior universes are independent procedural directional fields. Both
82
+ use five-octave FBM, animated coordinate drift, broad/fine structure, and
83
+ different plane orientation.
84
+
85
+ Sample those fields only after integration. Lensing must change the lookup
86
+ direction rather than distort an already rendered screen image.
87
+
88
+ A small direction-hashed grain of amplitude `0.01` reduces visible gradient
89
+ banding.
90
+
91
+ ## accretion volume screen-volume integration
92
+
93
+ The black-hole effect is evaluated on a sphere surrounding the effect. Defaults:
94
+
95
+ ```text
96
+ iterations = 128
97
+ step = 0.0071
98
+ ray jitter = 0.01
99
+ bending power = 0.3
100
+ core radius = 0.13
101
+ disk half-width = 0.03
102
+ ```
103
+
104
+ Per step:
105
+
106
+ ```text
107
+ r = length(rayPosition)
108
+ steerMagnitude = step * power / r^2
109
+ steerRange = remapClamped(r, 1 -> 0.5, 0 -> 1)
110
+ newDirection = normalize(direction - radial * steerMagnitude * steerRange)
111
+ ```
112
+
113
+ The ray direction is bent toward the center only inside the configured range.
114
+ Unlike the wormhole, this is an artistic inverse-square steering field, not a
115
+ validated metric geodesic.
116
+
117
+ ## Disk density and color
118
+
119
+ Disk coordinates rotate around the local Z axis with radius and time:
120
+
121
+ ```text
122
+ rotation phase = radialDistance * 4.27 - time * 0.1
123
+ noise UV = rotatedPosition * 2
124
+ ```
125
+
126
+ A repeated deep-noise texture is multiplied by a quadratic band across
127
+ `[-width, 0, +width]`. Radial distance, noise value, and a nearby noise sample
128
+ produce a ramp coordinate.
129
+
130
+ The three-point color ramp is:
131
+
132
+ ```text
133
+ white-hot at 0.06
134
+ gold at 0.33
135
+ dark amber at 1.0
136
+ emission scale 1.95
137
+ additional emission color (1.0, 0.72, 0.26)
138
+ ```
139
+
140
+ The central sphere below `originRadius` is black. Disk opacity accumulates
141
+ front-to-back into `alphaAcc`; color accumulates using remaining transmittance.
142
+
143
+ ## Background lensing
144
+
145
+ After the fixed loop, the final bent direction samples a deterministic
146
+ equirectangular star texture generated from `5200` seeded stars on a sphere.
147
+
148
+ ```text
149
+ final = accumulated disk color
150
+ + remaining transmittance * star environment
151
+ ```
152
+
153
+ The deterministic star field is important: lensing motion can be compared
154
+ without random stars moving between runs.
155
+
156
+ ## Observed defects and boundaries
157
+
158
+ - The demonstrated accretion-volume loop advances `rayPosition` twice per
159
+ iteration while its steering magnitude uses a single `step`. Treat the
160
+ effective distance step as `2 * step`, or remove the duplicate advance and
161
+ retune the complete density-and-bending system explicitly.
162
+ - accretion volume has no early exit and no termination IDs; every pixel pays the full
163
+ iteration count.
164
+ - Its disk is detected by local band density at samples, not by a continuous
165
+ plane-crossing test. A large step can skip a thin disk.
166
+ - The artistic inverse-square steering must not be described as general
167
+ relativity.
168
+ - The wormhole uses a fixed high iteration cap and per-ray step jitter but has
169
+ no CPU reference-ray tests.
170
+ - Both effects render on bounded proxy geometry; coordinate transforms must be
171
+ verified if the proxy is nonuniformly scaled or moved far from the origin.
172
+ - The star texture is finite-resolution and can alias under extreme
173
+ magnification.
174
+
175
+ ## Diagnostics
176
+
177
+ Expose:
178
+
179
+ ```text
180
+ wormhole l and pL
181
+ impact parameter and orbital-plane basis
182
+ RK4 step count and escaped/capped state
183
+ final exterior side and environment direction
184
+ accretion volume radius and steering magnitude
185
+ effective traveled distance
186
+ disk band, noise, ramp coordinate, and local alpha
187
+ accumulated alpha and remaining transmittance
188
+ core-hit mask
189
+ final bent background direction
190
+ NaN/invalid-state mask
191
+ ```
192
+
193
+ Add CPU reference rays for the wormhole before claiming physical parity, and a
194
+ continuous disk-crossing variant before increasing accretion volume’s step size.
@@ -5,25 +5,31 @@ description: Implement screen-space ambient occlusion for Genex Three.js games.
5
5
 
6
6
  # Genex Three.js Screen-Space Ambient Occlusion
7
7
 
8
- Use AO to ground form, not to darken the whole image. It should be measurable,
9
- diagnosable, and easy to disable.
8
+ AO estimates missing ambient visibility. It must modulate indirect lighting, not repaint all scene color with a dark multiply.
10
9
 
11
- Read [references/ambient-occlusion.md](references/ambient-occlusion.md) for
12
- sampling, reconstruction, filtering, and failure checks.
10
+ ## Workflow
13
11
 
14
- ## Build order
12
+ 1. Verify linear depth and view-space normals.
13
+ 2. Reconstruct view position consistently.
14
+ 3. Sample horizon visibility in a controlled radius.
15
+ 4. Estimate AO and optional bent normal.
16
+ 5. Denoise with depth/normal-aware filters.
17
+ 6. Apply to indirect diffuse and environment response.
15
18
 
16
- 1. Confirm the render pipeline owns depth and normal signals.
17
- 2. Choose AO resolution, sample count, radius, falloff, and quality tiers.
18
- 3. Reconstruct view-space position consistently.
19
- 4. Generate occlusion and optional bent-normal direction.
20
- 5. Filter with depth/normal-aware reconstruction.
21
- 6. Expose debug views for depth, normals, raw AO, filtered AO, and final apply.
19
+ Read [references/ambient-occlusion.md](references/ambient-occlusion.md).
22
20
 
23
- ## Rules
21
+ ## Failure conditions
24
22
 
25
- - Keep AO radius tied to scene scale.
26
- - Avoid halos around silhouettes and thin geometry.
27
- - Do not apply AO twice through materials and post-processing.
28
- - Keep dynamic resolution and DPR changes safe.
29
- - Validate no-AO, raw-AO, and final-AO captures.
23
+ - direct light and emission are darkened;
24
+ - radius is specified only in pixels;
25
+ - foreground silhouettes cast thick screen-space halos;
26
+ - depth discontinuities are blurred together;
27
+ - AO remains strong at distances where its world radius is subpixel;
28
+ - bent normals are treated as ordinary geometric normals;
29
+ - the implementation claims temporal accumulation even though this path has none.
30
+
31
+ ## Routing boundary
32
+
33
+ This skill owns GTAO gathering, bent normals, denoising, and AO application.
34
+ Use `$genex-threejs-image-pipeline` only when its depth/normal buffers or pass order
35
+ must be coordinated with other image-space systems.