@genex-ai/cli-demo 0.93.0-dev.247 → 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.
- package/dist/index.js +25 -4
- package/package.json +1 -1
- package/templates/skills/genex-ai-model/SKILL.md +3 -2
- package/templates/skills/genex-ai-skybox/SKILL.md +3 -3
- package/templates/skills/genex-game-director/SKILL.md +321 -411
- package/templates/skills/genex-game-director/references/design-contract.md +130 -179
- package/templates/skills/genex-game-director/references/routing-map.md +242 -362
- package/templates/skills/genex-threejs-exposure-color-grading/SKILL.md +3 -7
- package/templates/skills/genex-threejs-procedural-assets/SKILL.md +112 -0
- package/templates/skills/genex-threejs-procedural-materials/SKILL.md +3 -7
- package/templates/skills/genex-threejs-procedural-vfx/SKILL.md +6 -11
- package/templates/skills/genex-threejs-shadow-systems/SKILL.md +2 -3
- package/templates/skills/genex-threejs-visual-validation/SKILL.md +0 -4
- package/templates/skills/genex-threejs-atmosphere-aerial-perspective/SKILL.md +0 -46
- package/templates/skills/genex-threejs-atmosphere-aerial-perspective/references/atmosphere.md +0 -213
- package/templates/skills/genex-threejs-bloom/SKILL.md +0 -44
- package/templates/skills/genex-threejs-bloom/references/bloom.md +0 -187
- package/templates/skills/genex-threejs-exposure-color-grading/references/exposure-grading.md +0 -205
- package/templates/skills/genex-threejs-game-content/SKILL.md +0 -198
- package/templates/skills/genex-threejs-game-content/references/content-tables.md +0 -269
- package/templates/skills/genex-threejs-image-pipeline/SKILL.md +0 -56
- package/templates/skills/genex-threejs-image-pipeline/references/image-pipeline.md +0 -197
- package/templates/skills/genex-threejs-lighting-design/SKILL.md +0 -144
- package/templates/skills/genex-threejs-lighting-design/references/light-recipes.md +0 -137
- package/templates/skills/genex-threejs-open-world/SKILL.md +0 -149
- package/templates/skills/genex-threejs-open-world/references/terrain-streaming.md +0 -215
- package/templates/skills/genex-threejs-precipitation-surfaces/SKILL.md +0 -59
- package/templates/skills/genex-threejs-precipitation-surfaces/references/precipitation-surfaces.md +0 -181
- package/templates/skills/genex-threejs-procedural-architecture/SKILL.md +0 -50
- package/templates/skills/genex-threejs-procedural-architecture/references/architecture-systems.md +0 -509
- package/templates/skills/genex-threejs-procedural-fields/SKILL.md +0 -61
- package/templates/skills/genex-threejs-procedural-fields/references/field-systems.md +0 -232
- package/templates/skills/genex-threejs-procedural-geometry/SKILL.md +0 -39
- package/templates/skills/genex-threejs-procedural-geometry/references/mesh-systems.md +0 -202
- package/templates/skills/genex-threejs-procedural-materials/references/material-systems.md +0 -198
- package/templates/skills/genex-threejs-procedural-planets/SKILL.md +0 -48
- package/templates/skills/genex-threejs-procedural-planets/references/planet-systems.md +0 -498
- package/templates/skills/genex-threejs-procedural-vegetation/SKILL.md +0 -52
- package/templates/skills/genex-threejs-procedural-vegetation/references/vegetation-systems.md +0 -314
- package/templates/skills/genex-threejs-procedural-vfx/references/vfx-systems.md +0 -218
- package/templates/skills/genex-threejs-raymarched-space-effects/SKILL.md +0 -37
- package/templates/skills/genex-threejs-raymarched-space-effects/references/space-effects.md +0 -194
- package/templates/skills/genex-threejs-screen-space-ambient-occlusion/SKILL.md +0 -35
- package/templates/skills/genex-threejs-screen-space-ambient-occlusion/references/ambient-occlusion.md +0 -441
- package/templates/skills/genex-threejs-spectral-ocean/SKILL.md +0 -52
- package/templates/skills/genex-threejs-spectral-ocean/references/spectral-ocean.md +0 -473
- package/templates/skills/genex-threejs-temporal-surfaces/SKILL.md +0 -41
- package/templates/skills/genex-threejs-temporal-surfaces/references/temporal-surfaces.md +0 -207
- package/templates/skills/genex-threejs-visual-validation/references/visual-validation.md +0 -427
- package/templates/skills/genex-threejs-volumetric-clouds/SKILL.md +0 -49
- package/templates/skills/genex-threejs-volumetric-clouds/references/volumetric-clouds.md +0 -579
- package/templates/skills/genex-threejs-water-optics/SKILL.md +0 -57
- package/templates/skills/genex-threejs-water-optics/references/water-optics.md +0 -195
package/templates/skills/genex-threejs-procedural-vegetation/references/vegetation-systems.md
DELETED
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
# Structured Ash growth system
|
|
2
|
-
|
|
3
|
-
Use this reference when the target is a natural deciduous Ash with a stable species identity. Preserve the species table, continuation model, branch geometry, foliage, rooted wind, and composition contracts before tuning.
|
|
4
|
-
|
|
5
|
-
## Contents
|
|
6
|
-
|
|
7
|
-
1. Species table
|
|
8
|
-
2. Continuation and child placement
|
|
9
|
-
3. Branch growth and geometry
|
|
10
|
-
4. Leaves and wind
|
|
11
|
-
5. Bark, meadow, and scene composition
|
|
12
|
-
6. Budgets, divergences, and diagnostics
|
|
13
|
-
|
|
14
|
-
## 1. Preserve the exact species table before tuning
|
|
15
|
-
|
|
16
|
-
The Ash Medium species contract is:
|
|
17
|
-
|
|
18
|
-
| Level | Length | Base radius factor | Sections | Radial segments | Child angle | Children | Child start | Gnarliness | Twist |
|
|
19
|
-
| ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
20
|
-
| 0 trunk | 43.47 | 2.00 | 12 | 12 | — | 7 | — | 0.03 | 0.09 |
|
|
21
|
-
| 1 primary | 27.14 | 0.63 | 8 | 6 | 48° | 4 | 0.23 | 0.25 | -0.07 |
|
|
22
|
-
| 2 secondary | 9.51 | 0.76 | 6 | 4 | 75° | 3 | 0.33 | 0.20 | 0 |
|
|
23
|
-
| 3 terminal | 4.60 | 0.70 | 4 | 3 | 60° | 0 | 0 | 0.09 | 0 |
|
|
24
|
-
|
|
25
|
-
All levels use taper `0.7`. Growth force points up with strength `0.01`.
|
|
26
|
-
|
|
27
|
-
Leaves:
|
|
28
|
-
|
|
29
|
-
```text
|
|
30
|
-
type: ash
|
|
31
|
-
count per terminal branch: 16
|
|
32
|
-
start: 0
|
|
33
|
-
angle: 55°
|
|
34
|
-
double perpendicular cards
|
|
35
|
-
size: 2.67
|
|
36
|
-
size variance: ±0.72
|
|
37
|
-
alpha test: 0.5
|
|
38
|
-
rounded normals: enabled
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Do not replace this table with guessed “tree-like” ranges before the contract
|
|
42
|
-
is reproduced. Species identity is encoded in the uneven angles, lengths,
|
|
43
|
-
starts, and child counts.
|
|
44
|
-
|
|
45
|
-
## 2. Match the branch continuation model
|
|
46
|
-
|
|
47
|
-
The generator creates two types of descendants:
|
|
48
|
-
|
|
49
|
-
1. stratified lateral children along the parent;
|
|
50
|
-
2. one terminal continuation branch from the parent tip for every deciduous level until the final level.
|
|
51
|
-
|
|
52
|
-
That continuation is essential to the sparse, irregular crown. A generator that creates only lateral children produces a candelabra or clipped crown.
|
|
53
|
-
|
|
54
|
-
The terminal continuation inherits:
|
|
55
|
-
|
|
56
|
-
```text
|
|
57
|
-
origin = final parent section origin
|
|
58
|
-
orientation = final parent section orientation
|
|
59
|
-
radius = final parent section radius
|
|
60
|
-
level = parent level + 1
|
|
61
|
-
sections and radial segments = parent values
|
|
62
|
-
length = next-level species length
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
The inherited section/segment counts differ from ordinary lateral children, which use the next level's table values.
|
|
66
|
-
|
|
67
|
-
## 3. Match section evolution
|
|
68
|
-
|
|
69
|
-
The implementation contains:
|
|
70
|
-
|
|
71
|
-
```text
|
|
72
|
-
sectionLength =
|
|
73
|
-
branchLength
|
|
74
|
-
/ sectionCount
|
|
75
|
-
/ (branchLevels - 1)
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
but guards the divisor with a comparison against the string `'Deciduous'`.
|
|
79
|
-
The preset stores `'deciduous'`, so this build does **not** take that
|
|
80
|
-
branch. Effective runtime behavior is:
|
|
81
|
-
|
|
82
|
-
```text
|
|
83
|
-
sectionLength = branchLength / sectionCount
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
For Ash Medium this doubles the height relative to the apparent intent. The
|
|
87
|
-
complete build produces branch bounds reaching roughly `y=80.30` and leaf
|
|
88
|
-
bounds reaching `y=83.69`. Preserve the actual runtime behavior.
|
|
89
|
-
Do not infer behavior from one line without executing the complete growth path.
|
|
90
|
-
|
|
91
|
-
At every section:
|
|
92
|
-
|
|
93
|
-
1. emit an XZ ring through the current Euler orientation;
|
|
94
|
-
2. store origin, orientation, and radius;
|
|
95
|
-
3. advance along rotated local +Y;
|
|
96
|
-
4. perturb Euler X/Z by seeded gnarliness;
|
|
97
|
-
5. apply level twist around local Y;
|
|
98
|
-
6. rotate the section toward world growth force.
|
|
99
|
-
|
|
100
|
-
Gnarliness amplification:
|
|
101
|
-
|
|
102
|
-
```text
|
|
103
|
-
effectiveGnarliness =
|
|
104
|
-
max(1, 1 / sqrt(sectionRadius))
|
|
105
|
-
* levelGnarliness
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
The force angular step is:
|
|
109
|
-
|
|
110
|
-
```text
|
|
111
|
-
forceStrength / sectionRadius
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
clamped to the full angle between current local up and the target direction. Thin branches therefore respond more strongly than the trunk.
|
|
115
|
-
|
|
116
|
-
## 4. Match taper and child radius semantics
|
|
117
|
-
|
|
118
|
-
Deciduous taper:
|
|
119
|
-
|
|
120
|
-
```text
|
|
121
|
-
sectionRadius =
|
|
122
|
-
branchStartRadius
|
|
123
|
-
* (1 - levelTaper * sectionIndex / sectionCount)
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
The final section of the final level collapses to a near-zero radius.
|
|
127
|
-
|
|
128
|
-
Lateral child radius is not simply the species radius:
|
|
129
|
-
|
|
130
|
-
```text
|
|
131
|
-
childRadius =
|
|
132
|
-
levelRadiusFactor
|
|
133
|
-
* interpolatedParentSectionRadius
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
This couples the child thickness to emergence height and parent taper.
|
|
137
|
-
|
|
138
|
-
## 5. Match stratification and interpolation
|
|
139
|
-
|
|
140
|
-
For both lateral children and leaves:
|
|
141
|
-
|
|
142
|
-
```text
|
|
143
|
-
along =
|
|
144
|
-
start
|
|
145
|
-
+ (slotIndex + seededJitter)
|
|
146
|
-
* ((1 - start) / count)
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Independently shuffle angular slot IDs with the same seeded RNG:
|
|
150
|
-
|
|
151
|
-
```text
|
|
152
|
-
azimuth =
|
|
153
|
-
2π
|
|
154
|
-
* (radialOffset + (permutedSlot + jitter[-0.5, 0.5]) / count)
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Interpolate between adjacent stored sections:
|
|
158
|
-
|
|
159
|
-
- origin: linear interpolation;
|
|
160
|
-
- radius: linear interpolation;
|
|
161
|
-
- orientation: interpolation starts from section B and slerps toward
|
|
162
|
-
section A by `alpha`, reversing the usual A→B expectation.
|
|
163
|
-
|
|
164
|
-
Then compose:
|
|
165
|
-
|
|
166
|
-
```text
|
|
167
|
-
parent orientation
|
|
168
|
-
× azimuth around local Y
|
|
169
|
-
× emergence angle around local X
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Do not derive child orientation from a newly constructed tangent frame; that changes the characteristic branch roll and twist.
|
|
173
|
-
|
|
174
|
-
## 6. Match ring and bark UV construction
|
|
175
|
-
|
|
176
|
-
Each section emits `radialSegments + 1` vertices by duplicating the first radial vertex at the seam.
|
|
177
|
-
|
|
178
|
-
Choose one integer circumference wrap count for the entire branch:
|
|
179
|
-
|
|
180
|
-
```text
|
|
181
|
-
wrapsX = max(1, round(branchStartRadius * barkTextureScaleX))
|
|
182
|
-
u = radialIndex / radialSegments * wrapsX
|
|
183
|
-
v = sectionIndex is even ? 0 : 1
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
The texture's runtime Y repeat is `1 / barkTextureScaleY`.
|
|
187
|
-
|
|
188
|
-
This is not a real-distance longitudinal UV. If adapting the visual exactly, retain the alternating ring V pattern. If improving it, record the change as an intentional divergence and re-evaluate bark scale across trunk and twigs.
|
|
189
|
-
|
|
190
|
-
## 7. Match leaf placement, card geometry, and normals
|
|
191
|
-
|
|
192
|
-
Leaves are emitted along every final-level branch, not in synthetic clusters at branch tips.
|
|
193
|
-
|
|
194
|
-
Each leaf is a square card extending from local base `y=0` to tip `y=L`, with width `W`. The double-card mode emits a second card rotated 90° around local Y.
|
|
195
|
-
|
|
196
|
-
Rounded vertex normal:
|
|
197
|
-
|
|
198
|
-
```text
|
|
199
|
-
normalize(cardNormal + (vertexPosition - leafOrigin))
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
Use the same unrotated card normal for both perpendicular cards before adding
|
|
203
|
-
the vertex direction. Preserve that quirk when reproducing the contract. A
|
|
204
|
-
corrected per-card normal is a legitimate extension but changes canopy
|
|
205
|
-
lighting and must be documented.
|
|
206
|
-
|
|
207
|
-
Use the bundled `ash.png` alpha silhouette. Replacing it with an ellipse or
|
|
208
|
-
analytic lozenge changes crown porosity and edge frequency enough to invalidate
|
|
209
|
-
visual comparison.
|
|
210
|
-
|
|
211
|
-
## 8. Match material and wind behavior accurately
|
|
212
|
-
|
|
213
|
-
The complete scene uses:
|
|
214
|
-
|
|
215
|
-
- textured `MeshPhongMaterial` for bark;
|
|
216
|
-
- double-sided alpha-tested `MeshPhongMaterial` for leaves;
|
|
217
|
-
- Neutral tone mapping with exposure `2`;
|
|
218
|
-
- PCF shadows;
|
|
219
|
-
- fog color `0x94b9f8`, density `0.0015`;
|
|
220
|
-
- a daylight sky gradient and directional sun.
|
|
221
|
-
|
|
222
|
-
The wind shader deforms leaf vertices only:
|
|
223
|
-
|
|
224
|
-
```text
|
|
225
|
-
windPhase = simplex3(position / 70)
|
|
226
|
-
wind =
|
|
227
|
-
0.5 * sin(t * 0.5 + phase)
|
|
228
|
-
+ 0.3 * sin(2t * 0.5 + 1.3phase)
|
|
229
|
-
+ 0.2 * sin(5t * 0.5 + 1.5phase)
|
|
230
|
-
displacement = leafUvY * windStrength * wind
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
`leafUvY` roots the card base and moves the tip. The demonstrated branch
|
|
234
|
-
geometry is static; do not describe this mechanism as hierarchy-weighted
|
|
235
|
-
trunk/branch wind.
|
|
236
|
-
|
|
237
|
-
If extending it with branch motion:
|
|
238
|
-
|
|
239
|
-
1. keep the leaf-root weighting;
|
|
240
|
-
2. add branch-level attributes separately;
|
|
241
|
-
3. deform color and shadow geometry consistently;
|
|
242
|
-
4. label the result as an extension to the contract.
|
|
243
|
-
|
|
244
|
-
## 9. Match composition before judging the generator
|
|
245
|
-
|
|
246
|
-
Present the tree in a complete environment:
|
|
247
|
-
|
|
248
|
-
```text
|
|
249
|
-
startup camera: (100, 20, 0)
|
|
250
|
-
target: (0, 25, 0)
|
|
251
|
-
horizontal camera constraint near the horizon
|
|
252
|
-
foreground tree at origin
|
|
253
|
-
100 background trees using radius = 175 + random * 500 (effective 175–675)
|
|
254
|
-
procedural grass/dirt ground
|
|
255
|
-
5,000 visible grass instances
|
|
256
|
-
flowers and rocks
|
|
257
|
-
blue atmospheric fog
|
|
258
|
-
daylight sky and sun
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
The exact startup camera clips the leaf bound slightly because its
|
|
262
|
-
upper vertical coverage is approximately `y=82.7` while the leaf maximum is
|
|
263
|
-
approximately `y=83.69`. For a fixed 3:2 evaluation frame, move the camera
|
|
264
|
-
along the same target ray to approximately `x=115`; do not alter the tree to
|
|
265
|
-
solve a framing problem.
|
|
266
|
-
|
|
267
|
-
A black-background isolated tree is not a valid quality test. It removes
|
|
268
|
-
foliage edge contrast, atmospheric depth, ground contact, and scale cues.
|
|
269
|
-
|
|
270
|
-
## 10. Required contract diagnostics
|
|
271
|
-
|
|
272
|
-
Capture:
|
|
273
|
-
|
|
274
|
-
```text
|
|
275
|
-
final composition
|
|
276
|
-
branch-level colors
|
|
277
|
-
lateral children versus terminal continuations
|
|
278
|
-
child longitudinal slot IDs
|
|
279
|
-
child angular slot IDs
|
|
280
|
-
leaf origins along final branches
|
|
281
|
-
card normals versus rounded normals
|
|
282
|
-
bark UV checker
|
|
283
|
-
wind displacement magnitude
|
|
284
|
-
foreground bounds and camera frustum
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
Report:
|
|
288
|
-
|
|
289
|
-
```text
|
|
290
|
-
branch jobs by level
|
|
291
|
-
terminal continuations by level
|
|
292
|
-
lateral children by level
|
|
293
|
-
leaf cards
|
|
294
|
-
vertices and triangles
|
|
295
|
-
seed
|
|
296
|
-
preset name
|
|
297
|
-
intentional divergences from the growth contract
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
## 11. Numeric contract gate
|
|
301
|
-
|
|
302
|
-
For the Ash Medium contract, assert:
|
|
303
|
-
|
|
304
|
-
```text
|
|
305
|
-
branch vertices: 6,639
|
|
306
|
-
branch triangles: 9,120
|
|
307
|
-
leaf vertices: 21,760
|
|
308
|
-
leaf triangles: 10,880
|
|
309
|
-
branch bounds max Y: approximately 80.2981
|
|
310
|
-
leaf bounds max Y: approximately 83.6902
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
Matching only counts is insufficient; the earlier half-height implementation
|
|
314
|
-
matched all counts while violating runtime section-length behavior.
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
# Layered procedural VFX systems
|
|
2
|
-
|
|
3
|
-
Use this reference for ship-conforming reentry plasma, generated wakes, instanced analytic sparks, dissolving debris, dense-swap pools, and scene-relative HDR contribution.
|
|
4
|
-
|
|
5
|
-
## Contents
|
|
6
|
-
|
|
7
|
-
- Reentry representation
|
|
8
|
-
- Reentry shell shading
|
|
9
|
-
- Wake construction
|
|
10
|
-
- Instanced spark contract
|
|
11
|
-
- Debris dissolve and pool ownership
|
|
12
|
-
- HDR contribution
|
|
13
|
-
- Observed limitations
|
|
14
|
-
- Diagnostics
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## Reentry representation
|
|
18
|
-
|
|
19
|
-
planet-space implementation does not model reentry as one particle emitter. It composes:
|
|
20
|
-
|
|
21
|
-
```text
|
|
22
|
-
ship-shaped front shell
|
|
23
|
-
+ expanding capsule core wake
|
|
24
|
-
+ larger low-opacity haze wake
|
|
25
|
-
+ two asymmetric side shear lobes
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
The shell is a clone of the actual ship mesh, scaled by `1.005`. This is the
|
|
29
|
-
key silhouette decision: plasma follows authored hull topology instead of a
|
|
30
|
-
generic sphere or cone.
|
|
31
|
-
|
|
32
|
-
The wake origin is found from sampled ship vertices. For the current local fall
|
|
33
|
-
direction, select the support point with the greatest dot product. Build an
|
|
34
|
-
orthonormal wake frame by projecting local up away from the fall direction,
|
|
35
|
-
falling back to local right when nearly parallel.
|
|
36
|
-
|
|
37
|
-
```text
|
|
38
|
-
wake forward = normalized fall direction
|
|
39
|
-
wake up = projected local up
|
|
40
|
-
wake right = cross(up, forward)
|
|
41
|
-
wake origin = hull support point along fall direction
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Reentry shell shading
|
|
45
|
-
|
|
46
|
-
The shell mask uses actual flow-facing geometry:
|
|
47
|
-
|
|
48
|
-
```text
|
|
49
|
-
facing = saturate(dot(normalWorld, -fallDirectionWorld))
|
|
50
|
-
facing mask = smoothstep(0.18, 0.96, facing)
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Two world-space noise bands move along fall direction:
|
|
54
|
-
|
|
55
|
-
```text
|
|
56
|
-
coarse frequency = 3.6
|
|
57
|
-
fine frequency = 11.2
|
|
58
|
-
coarse/fine mix = 0.62 / 0.38
|
|
59
|
-
fine filament exponent = 3.1
|
|
60
|
-
flow speed basis = time * 5.4 + external flow * 0.08
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
The shell shader separates:
|
|
64
|
-
|
|
65
|
-
- core heat from flow-facing area;
|
|
66
|
-
- Fresnel envelope around silhouette;
|
|
67
|
-
- a shock band requiring high facing, rim response, and filaments.
|
|
68
|
-
|
|
69
|
-
Color hierarchy is explicit:
|
|
70
|
-
|
|
71
|
-
```text
|
|
72
|
-
hot core: orange -> near white
|
|
73
|
-
ion envelope: magenta -> violet
|
|
74
|
-
outer sheath: violet -> cyan
|
|
75
|
-
shock: white -> blue
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
The final shell uses additive blending, no depth write, depth test on, double
|
|
79
|
-
sided, and negative polygon offset. Treat the additive multiplier as part of
|
|
80
|
-
the scene’s HDR calibration, not a portable physical unit.
|
|
81
|
-
|
|
82
|
-
## Wake construction
|
|
83
|
-
|
|
84
|
-
Each wake is a generated capsule-profile tube. Along normalized length `t`:
|
|
85
|
-
|
|
86
|
-
```text
|
|
87
|
-
z = -trailLength * t
|
|
88
|
-
radial spread = 1 + t^1.24 * expansion
|
|
89
|
-
axial spread = 1 + 0.1 * t
|
|
90
|
-
profile turbulence = 1 + sin(theta * 3.3 + t * 8.7) * 0.1 * t
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Dimensions relative to ship length:
|
|
94
|
-
|
|
95
|
-
```text
|
|
96
|
-
profile length = 0.74
|
|
97
|
-
profile radius = 0.068
|
|
98
|
-
trail length = 1.55
|
|
99
|
-
|
|
100
|
-
core: 52 radial x 26 longitudinal, expansion 1.9
|
|
101
|
-
haze: 40 x 20, radius 1.2x, length 1.05x, opacity 0.28
|
|
102
|
-
lobes: 28 x 14, half profile, length 0.88x, opacity 0.34
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Wake shading uses elliptical profile distance, a front gate, tail fade,
|
|
106
|
-
coarse/fine longitudinal noise, Fresnel, and separate core/envelope/filament
|
|
107
|
-
colors. The core and haze use different scales and speeds instead of one mesh
|
|
108
|
-
with changed opacity.
|
|
109
|
-
|
|
110
|
-
## Instanced spark contract
|
|
111
|
-
|
|
112
|
-
pooled VFX system preallocates a sprite pool of `12000`. Every instance stores:
|
|
113
|
-
|
|
114
|
-
```text
|
|
115
|
-
startPosition vec3
|
|
116
|
-
startVelocity vec3
|
|
117
|
-
acceleration vec3
|
|
118
|
-
spawnTimeSeconds float
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Lifetime is `1.3 s`; velocity decay rate is `16`. Spark size falls linearly to
|
|
122
|
-
zero:
|
|
123
|
-
|
|
124
|
-
```text
|
|
125
|
-
scale = max((1.3 - age) * 0.4 / 1.3, 0)
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
The fragment is a circular sprite with radius `0.4`. HDR color interpolates
|
|
129
|
-
from `(1, 0.5, 0) * 80` toward dark red. Spawn adds random X/Z velocity in
|
|
130
|
-
`[-2, 2]`.
|
|
131
|
-
|
|
132
|
-
The pool is fixed-capacity and material attributes are per instance. No entity
|
|
133
|
-
owns an individual mesh.
|
|
134
|
-
|
|
135
|
-
## Debris dissolve and pool ownership
|
|
136
|
-
|
|
137
|
-
Debris spheres use:
|
|
138
|
-
|
|
139
|
-
```text
|
|
140
|
-
radius = 0.45
|
|
141
|
-
lifetime = random 2 -> 4 seconds
|
|
142
|
-
mass = 0.1
|
|
143
|
-
friction = 0.4
|
|
144
|
-
restitution = 0.8
|
|
145
|
-
gravity scale = 1.2
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Per-instance material data:
|
|
149
|
-
|
|
150
|
-
```text
|
|
151
|
-
isOrange
|
|
152
|
-
removalTimeSeconds
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
Geometry-space noise creates a spatial dissolve against remaining lifetime.
|
|
156
|
-
The material also adds a Fresnel-shaped color response, a directional fake-AO
|
|
157
|
-
tint, and a low environment term of `0.05`.
|
|
158
|
-
|
|
159
|
-
When an instance is removed, the render system swaps the last live instance
|
|
160
|
-
into the vacant slot and copies:
|
|
161
|
-
|
|
162
|
-
- the 4x4 instance matrix;
|
|
163
|
-
- every custom attribute slice;
|
|
164
|
-
- the entity-to-index mapping.
|
|
165
|
-
|
|
166
|
-
This dense-swap invariant is the reusable pooling mechanism. Updating only
|
|
167
|
-
`mesh.count` without copying custom attributes would attach old effect state to
|
|
168
|
-
the moved instance.
|
|
169
|
-
|
|
170
|
-
## HDR contribution
|
|
171
|
-
|
|
172
|
-
The compact signals are intentionally bright before bloom:
|
|
173
|
-
|
|
174
|
-
```text
|
|
175
|
-
spark core multiplier: 80
|
|
176
|
-
homing projectile multiplier: 30
|
|
177
|
-
laser multiplier: 10
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
These values are evidence of relative hierarchy inside that scene, not
|
|
181
|
-
universal exposure-independent constants. Preserve the relationship:
|
|
182
|
-
|
|
183
|
-
```text
|
|
184
|
-
spark flash > projectile > laser > ordinary surface
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Validate all three in the raw HDR buffer and with bloom disabled.
|
|
188
|
-
|
|
189
|
-
## Observed limitations
|
|
190
|
-
|
|
191
|
-
- Spark position multiplies an already integrated decayed velocity by elapsed
|
|
192
|
-
time again. This is dimensionally inconsistent but visually deliberate.
|
|
193
|
-
Preserve it only when that trajectory is explicitly required.
|
|
194
|
-
- Acceleration uses `a * t^2` rather than `0.5 * a * t^2`, also an artistic
|
|
195
|
-
choice.
|
|
196
|
-
- Spark randomization uses `Math.random`, so captures are not deterministic.
|
|
197
|
-
Replace it with a seeded generator for regression work.
|
|
198
|
-
- The reentry wake disables depth test. This avoids hull intersections but can
|
|
199
|
-
draw through unrelated geometry. Validate camera and occluder assumptions.
|
|
200
|
-
- The shell and wakes are analytic procedural meshes, not fluid simulation.
|
|
201
|
-
Do not describe them as physically simulated plasma.
|
|
202
|
-
|
|
203
|
-
## Diagnostics
|
|
204
|
-
|
|
205
|
-
Expose:
|
|
206
|
-
|
|
207
|
-
```text
|
|
208
|
-
fall direction and support point
|
|
209
|
-
shell facing/core/envelope/shock masks
|
|
210
|
-
coarse and fine wake noise
|
|
211
|
-
wake profile distance and tail fade
|
|
212
|
-
raw HDR emission by layer
|
|
213
|
-
bloom contribution by layer
|
|
214
|
-
spark age, velocity, and pool occupancy
|
|
215
|
-
debris remaining time and dissolve threshold
|
|
216
|
-
instance index/entity mapping
|
|
217
|
-
overdraw and depth-test modes
|
|
218
|
-
```
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: genex-threejs-raymarched-space-effects
|
|
3
|
-
description: Build raymarched space effects for Genex Three.js games. Use for black holes, accretion disks, wormholes, curved-ray distortion, procedural star fields, bounded volumetric structures, relativistic-looking effects, and GPU effects needing numerical integration.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Genex Three.js Raymarched Space Effects
|
|
7
|
-
|
|
8
|
-
Treat these effects as numerical renderers with explicit integration state. The visual character depends on coordinate choice, step policy, and how rays interact with emissive structures.
|
|
9
|
-
|
|
10
|
-
## Workflow
|
|
11
|
-
|
|
12
|
-
1. Define the effect-space transform and camera ray.
|
|
13
|
-
2. Choose a physical, physically inspired, or purely artistic bending model.
|
|
14
|
-
3. Bound the integration domain.
|
|
15
|
-
4. Track ray position, direction, throughput, and accumulated radiance.
|
|
16
|
-
5. Detect crossings with disks, shells, throats, or event boundaries.
|
|
17
|
-
6. Sample the background only after integration terminates.
|
|
18
|
-
7. Add diagnostics for trajectory, step count, and termination reason.
|
|
19
|
-
|
|
20
|
-
Read [references/space-effects.md](references/space-effects.md)
|
|
21
|
-
for the RK4 wormhole, artistic curved-ray accretion integrator, disk
|
|
22
|
-
composition, and implementation defects.
|
|
23
|
-
|
|
24
|
-
## Constraints
|
|
25
|
-
|
|
26
|
-
- Do not call a UV swirl “gravitational lensing.”
|
|
27
|
-
- Cap iterations and provide early termination.
|
|
28
|
-
- Use continuous crossing tests for thin structures.
|
|
29
|
-
- Keep numerical stability independent from frame rate.
|
|
30
|
-
- Separate the integrator from shading of the accretion disk or wormhole interior.
|
|
31
|
-
- Provide a cheaper approximation for non-hero views.
|
|
32
|
-
|
|
33
|
-
## Routing boundary
|
|
34
|
-
|
|
35
|
-
Use `$genex-threejs-procedural-vfx` for ordinary particles, trails, plasma, and event
|
|
36
|
-
effects. This skill is for per-pixel numerical ray integration through curved
|
|
37
|
-
or bounded space-effect domains.
|