@genex-ai/cli-demo 0.6.1 → 0.7.0
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 +54 -15
- package/package.json +1 -1
- package/templates/skills/genex-threejs-atmosphere-aerial-perspective/SKILL.md +30 -18
- package/templates/skills/genex-threejs-atmosphere-aerial-perspective/references/atmosphere.md +204 -20
- package/templates/skills/genex-threejs-bloom/SKILL.md +29 -18
- package/templates/skills/genex-threejs-bloom/references/bloom.md +176 -20
- package/templates/skills/genex-threejs-camera-direction/SKILL.md +38 -26
- package/templates/skills/genex-threejs-camera-direction/references/camera-rigs.md +359 -27
- package/templates/skills/genex-threejs-exposure-color-grading/SKILL.md +27 -18
- package/templates/skills/genex-threejs-exposure-color-grading/references/exposure-grading.md +196 -21
- package/templates/skills/genex-threejs-image-pipeline/SKILL.md +38 -17
- package/templates/skills/genex-threejs-image-pipeline/references/image-pipeline.md +185 -29
- package/templates/skills/genex-threejs-procedural-animation/SKILL.md +34 -21
- package/templates/skills/genex-threejs-procedural-animation/references/procedural-motion.md +353 -24
- package/templates/skills/genex-threejs-procedural-architecture/SKILL.md +36 -17
- package/templates/skills/genex-threejs-procedural-architecture/references/architecture-systems.md +500 -22
- package/templates/skills/genex-threejs-procedural-fields/SKILL.md +59 -24
- package/templates/skills/genex-threejs-procedural-fields/references/field-systems.md +222 -25
- package/templates/skills/genex-threejs-procedural-geometry/SKILL.md +34 -20
- package/templates/skills/genex-threejs-procedural-geometry/references/mesh-systems.md +192 -26
- package/templates/skills/genex-threejs-procedural-materials/SKILL.md +55 -18
- package/templates/skills/genex-threejs-procedural-materials/references/material-systems.md +189 -22
- package/templates/skills/genex-threejs-procedural-planets/SKILL.md +36 -18
- package/templates/skills/genex-threejs-procedural-planets/references/planet-systems.md +489 -21
- package/templates/skills/genex-threejs-procedural-vegetation/SKILL.md +35 -25
- package/templates/skills/genex-threejs-procedural-vegetation/references/vegetation-systems.md +304 -27
- package/templates/skills/genex-threejs-procedural-vfx/SKILL.md +26 -18
- package/templates/skills/genex-threejs-procedural-vfx/references/vfx-systems.md +208 -20
- package/templates/skills/genex-threejs-raymarched-space-effects/SKILL.md +25 -18
- package/templates/skills/genex-threejs-raymarched-space-effects/references/space-effects.md +185 -21
- package/templates/skills/genex-threejs-screen-space-ambient-occlusion/SKILL.md +23 -17
- package/templates/skills/genex-threejs-screen-space-ambient-occlusion/references/ambient-occlusion.md +430 -20
- package/templates/skills/genex-threejs-shadow-systems/SKILL.md +29 -18
- package/templates/skills/genex-threejs-shadow-systems/references/shadow-systems.md +420 -21
- package/templates/skills/genex-threejs-skill-router/SKILL.md +21 -21
- package/templates/skills/genex-threejs-spectral-ocean/SKILL.md +30 -20
- package/templates/skills/genex-threejs-spectral-ocean/references/spectral-ocean.md +462 -22
- package/templates/skills/genex-threejs-temporal-surfaces/SKILL.md +26 -17
- package/templates/skills/genex-threejs-temporal-surfaces/references/temporal-surfaces.md +198 -20
- package/templates/skills/genex-threejs-visual-validation/SKILL.md +34 -18
- package/templates/skills/genex-threejs-visual-validation/references/visual-validation.md +396 -32
- package/templates/skills/genex-threejs-volumetric-clouds/SKILL.md +33 -17
- package/templates/skills/genex-threejs-volumetric-clouds/references/volumetric-clouds.md +570 -21
- package/templates/skills/genex-threejs-water-optics/SKILL.md +33 -18
- package/templates/skills/genex-threejs-water-optics/references/water-optics.md +184 -20
package/templates/skills/genex-threejs-exposure-color-grading/references/exposure-grading.md
CHANGED
|
@@ -1,30 +1,205 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Scene-referred exposure and color pipeline
|
|
2
2
|
|
|
3
|
-
Use this reference for
|
|
3
|
+
Use this reference for a measured HDR-to-display path with encoded luminance readback, asymmetric adaptation, one tone-map owner, and a generated display-domain 3D LUT.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Contents
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
-
|
|
7
|
+
- Exact pipeline order
|
|
8
|
+
- Luminance meter
|
|
9
|
+
- Exposure target and adaptation
|
|
10
|
+
- 3D LUT construction
|
|
11
|
+
- LUT placement
|
|
12
|
+
- Tone mapping ownership
|
|
13
|
+
- Observed limitations
|
|
14
|
+
- Diagnostics
|
|
12
15
|
|
|
13
|
-
## Adaptation
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
- Smooth by `deltaTime`.
|
|
17
|
-
- Reset or seed exposure intentionally on scene transitions.
|
|
17
|
+
## Exact pipeline order
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
The pipeline computes:
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
```text
|
|
22
|
+
HDR scene after AO/atmosphere
|
|
23
|
+
-> bloom added in HDR
|
|
24
|
+
-> multiply by adapted exposure
|
|
25
|
+
-> renderOutput using renderer tone mapping
|
|
26
|
+
-> saturate to LUT domain
|
|
27
|
+
-> sample 3D LUT
|
|
28
|
+
-> blend LUT intensity
|
|
29
|
+
-> optional FXAA
|
|
30
|
+
```
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
`RenderPipeline.outputColorTransform` is disabled and one output node owns the
|
|
33
|
+
final conversion. Renderer tone-mapping mode and renderer exposure are still
|
|
34
|
+
configuration inputs to `renderOutput`.
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
## Luminance meter
|
|
37
|
+
|
|
38
|
+
The implementation renders a `64 x 36` meter target using unsigned bytes. It encodes
|
|
39
|
+
unbounded luminance:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
encoded = luminance / (luminance + 1)
|
|
43
|
+
decoded = encoded / max(0.0001, 1 - encoded)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Readback occurs asynchronously every `12` frames by default. While one readback
|
|
47
|
+
is pending, another is not started.
|
|
48
|
+
|
|
49
|
+
CPU reduction uses weighted log average:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
weight = 1.0 when luminance > 0.002
|
|
53
|
+
weight = 0.15 otherwise
|
|
54
|
+
|
|
55
|
+
average =
|
|
56
|
+
exp(sum(log(max(luminance, 0.0001)) * weight) / sum(weight))
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This suppresses black-pixel dominance without requiring a histogram.
|
|
60
|
+
|
|
61
|
+
## Exposure target and adaptation
|
|
62
|
+
|
|
63
|
+
Defaults:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
minimum exposure = 0.45
|
|
67
|
+
maximum exposure = 1.85
|
|
68
|
+
middle gray = 0.18
|
|
69
|
+
compensation = 0 EV
|
|
70
|
+
speed up = 3.2
|
|
71
|
+
speed down = 1.1
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Target:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
target =
|
|
78
|
+
clamp(
|
|
79
|
+
middleGray / averageLuminance
|
|
80
|
+
* 2^exposureCompensation,
|
|
81
|
+
minExposure,
|
|
82
|
+
maxExposure
|
|
83
|
+
)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Frame-rate-independent adaptation:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
speed = target > current ? speedUp : speedDown
|
|
90
|
+
amount = 1 - exp(-max(deltaSeconds, 0) * speed)
|
|
91
|
+
current += (target - current) * amount
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
When disabled, current and target reset to `1`.
|
|
95
|
+
|
|
96
|
+
## 3D LUT construction
|
|
97
|
+
|
|
98
|
+
Build a `32^3` RGBA `Data3DTexture` with linear filtering, clamp wrapping, no
|
|
99
|
+
mipmaps, and unsigned-byte storage.
|
|
100
|
+
|
|
101
|
+
Each preset recipe owns:
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
contrast
|
|
105
|
+
saturation
|
|
106
|
+
vibrance
|
|
107
|
+
black/white point
|
|
108
|
+
per-channel gamma
|
|
109
|
+
shadow/midtone/highlight tint
|
|
110
|
+
strength for each tonal range
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Recipe order:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
normalize black/white range
|
|
117
|
+
S-curve blend, fixed amount 0.44
|
|
118
|
+
contrast around 0.5
|
|
119
|
+
shadow tint
|
|
120
|
+
midtone tint
|
|
121
|
+
highlight tint
|
|
122
|
+
per-channel gamma
|
|
123
|
+
saturation
|
|
124
|
+
vibrance
|
|
125
|
+
small highlight glow bias
|
|
126
|
+
clamp to [0, 1]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Tonal weights are calculated from pre-grade luminance:
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
shadow = 1 - smoothstep(0.12, 0.54, luma)
|
|
133
|
+
highlight = smoothstep(0.48, 0.92, luma)
|
|
134
|
+
midtone = max(0, 1 - abs(luma - 0.5) * 2)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## LUT placement
|
|
138
|
+
|
|
139
|
+
The LUT samples tone-mapped display-linear RGB after saturation:
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
uv = saturate(displayColor.rgb) * ((32 - 1) / 32) + 0.5 / 32
|
|
143
|
+
graded = texture3D(lut, uv)
|
|
144
|
+
final = mix(displayColor, graded, lutIntensity)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This means the included recipes are authored for a bounded post-tone-map
|
|
148
|
+
domain. Do not move them before tone mapping without rebuilding the recipes and
|
|
149
|
+
documenting a scene-linear or log domain.
|
|
150
|
+
|
|
151
|
+
## Tone mapping ownership
|
|
152
|
+
|
|
153
|
+
Available renderer modes include:
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
None, Linear, Reinhard, Cineon, ACES, AgX, Neutral
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Color defaults:
|
|
160
|
+
|
|
161
|
+
```text
|
|
162
|
+
tone mapping = ACES
|
|
163
|
+
renderer exposure = 0.72
|
|
164
|
+
LUT = Real Daylight
|
|
165
|
+
LUT intensity = 1
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The feature factory initially disables LUT intensity and eye adaptation until
|
|
169
|
+
enabled through settings. Distinguish configuration defaults from active
|
|
170
|
+
feature state.
|
|
171
|
+
|
|
172
|
+
## Observed limitations
|
|
173
|
+
|
|
174
|
+
- The meter has no center weighting, percentile clipping, sky mask, or UI mask.
|
|
175
|
+
- Unsigned-byte encoding loses precision near extreme luminance.
|
|
176
|
+
- Readback cadence is frame-count based, so wall-clock cadence changes with
|
|
177
|
+
frame rate.
|
|
178
|
+
- A failed readback resets target exposure to `1`, which can cause a visible
|
|
179
|
+
adaptation shift.
|
|
180
|
+
- LUT generation clamps every entry to `[0,1]`; it is display-domain grading,
|
|
181
|
+
not HDR scene-referred grading.
|
|
182
|
+
- The pipeline exposes both renderer `toneMappingExposure` and a separate
|
|
183
|
+
adapted exposure multiplier. Their combined ownership must be documented to
|
|
184
|
+
avoid accidental double exposure.
|
|
185
|
+
- FXAA is applied after grading, but dithering/gamut compression are absent.
|
|
186
|
+
|
|
187
|
+
## Diagnostics
|
|
188
|
+
|
|
189
|
+
Expose:
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
meter source
|
|
193
|
+
encoded meter target
|
|
194
|
+
decoded luminance
|
|
195
|
+
weight mask
|
|
196
|
+
measured average
|
|
197
|
+
target/current exposure over time
|
|
198
|
+
readback pending and cadence
|
|
199
|
+
HDR before exposure
|
|
200
|
+
tone-mapped before LUT
|
|
201
|
+
neutral versus selected LUT
|
|
202
|
+
per-recipe tonal weights
|
|
203
|
+
clipped/out-of-domain mask
|
|
204
|
+
final with one exposure stage disabled at a time
|
|
205
|
+
```
|
|
@@ -5,26 +5,47 @@ description: Design the final image pipeline for Genex Three.js games. Use for r
|
|
|
5
5
|
|
|
6
6
|
# Genex Three.js Image Pipeline
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
own depth, color, history, or tone mapping path.
|
|
8
|
+
Use this skill only when composing several image-space systems or defining shared buffers. For one effect, load its atomic skill instead.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
ordering, signal ownership, diagnostics, and cleanup.
|
|
10
|
+
Load:
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
- `$genex-threejs-screen-space-ambient-occlusion` for GTAO, bent normals, denoising, or AO application;
|
|
13
|
+
- `$genex-threejs-bloom` for HDR extraction and bloom;
|
|
14
|
+
- `$genex-threejs-exposure-color-grading` for metering, adaptation, tone mapping, LUTs, and output conversion.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
The pipeline must expose its signals and ordering. Do not install a pile of effects and tune the final frame blindly.
|
|
17
|
+
|
|
18
|
+
## Signal order
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
scene HDR color + depth + normals + albedo where required
|
|
22
|
+
→ lighting-related screen effects
|
|
23
|
+
→ atmosphere/transparency composition
|
|
24
|
+
→ bloom
|
|
25
|
+
→ exposure
|
|
26
|
+
→ tone mapping
|
|
27
|
+
→ grading
|
|
28
|
+
→ lens/presentation effects
|
|
29
|
+
→ output conversion
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Read [references/image-pipeline.md](references/image-pipeline.md)
|
|
33
|
+
for four production pass graphs, their buffer/resolution contracts, and the
|
|
34
|
+
ownership boundaries between whole-scene and effect-local graphs.
|
|
23
35
|
|
|
24
36
|
## Rules
|
|
25
37
|
|
|
26
|
-
-
|
|
27
|
-
- Keep
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
38
|
+
- Tone-map once.
|
|
39
|
+
- Keep HDR bloom before tone mapping.
|
|
40
|
+
- Meter exposure from a small luminance target, not the final 8-bit screen.
|
|
41
|
+
- Separate direct and indirect light before applying bent-normal ambient tint when possible.
|
|
42
|
+
- Upsample low-resolution effects with depth/normal-aware weights.
|
|
43
|
+
- Build pass toggles and effect-only views before tuning.
|
|
44
|
+
- UI rendered in the same target needs an explicit protection strategy.
|
|
45
|
+
- Do not load all atomic post skills by default. Route only the effects actually requested.
|
|
46
|
+
|
|
47
|
+
## Routing boundary
|
|
48
|
+
|
|
49
|
+
Use this skill when multiple image-space systems must share buffers, ordering,
|
|
50
|
+
or output ownership. For one isolated effect, use its atomic skill without
|
|
51
|
+
loading this coordinator.
|
|
@@ -1,39 +1,195 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Production image-pipeline contracts
|
|
2
2
|
|
|
3
|
-
Use this reference
|
|
3
|
+
Use this reference to compose shared scene buffers, lighting effects, atmosphere, bloom, exposure, tone mapping, grading, and feature-local render targets with explicit ownership.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Contents
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
- production WebGPU pipeline WebGPU graph
|
|
8
|
+
- selective gallery pipeline selective gallery graph
|
|
9
|
+
- atlas-based renderer composer graph
|
|
10
|
+
- Temporal-surface effect-local graph
|
|
11
|
+
- Buffer and ownership rules
|
|
12
|
+
- Resolution policies
|
|
13
|
+
- Failure analysis
|
|
14
|
+
- Diagnostics
|
|
14
15
|
|
|
15
|
-
## Shared signals
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
- Normals: document space and packing.
|
|
19
|
-
- Color: document linear/HDR/display state.
|
|
20
|
-
- History: document reset and reprojection rules.
|
|
21
|
-
- Masks: document semantic meaning and lifetime.
|
|
17
|
+
## production WebGPU pipeline WebGPU graph
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
When GTAO is enabled, the scene pass writes MRT:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
output HDR color
|
|
23
|
+
view-space normal
|
|
24
|
+
diffuse albedo
|
|
25
|
+
depth
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Graph:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
scene MRT
|
|
32
|
+
-> reduced GTAO + bent normal
|
|
33
|
+
-> full-resolution bilateral/lighting composite
|
|
34
|
+
-> atmosphere
|
|
35
|
+
-> bloom
|
|
36
|
+
-> adapted exposure
|
|
37
|
+
-> renderOutput / tone map
|
|
38
|
+
-> 3D LUT
|
|
39
|
+
-> FXAA
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Near/far values, environment intensity, and environment texture remain
|
|
43
|
+
updateable inputs. AO is applied through its dedicated composite rather than
|
|
44
|
+
blindly multiplying the final image.
|
|
45
|
+
|
|
46
|
+
The atmosphere pass reconstructs view/world position from depth,
|
|
47
|
+
classifies sky, and owns aerial haze, height fog, sun disc/shaft, lens flare,
|
|
48
|
+
and distance grading. Its optional post-process cloud shadow is explicitly
|
|
49
|
+
disabled in its configuration, avoiding duplicate ownership with material
|
|
50
|
+
lighting.
|
|
51
|
+
|
|
52
|
+
## selective gallery pipeline selective gallery graph
|
|
53
|
+
|
|
54
|
+
The gallery owns three composers:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
neon selective bloom
|
|
58
|
+
chandelier selective bloom
|
|
59
|
+
base + final additive composite + OutputPass
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Selective renders use layer membership plus temporary black material
|
|
63
|
+
substitution with `try/finally` restoration. CSS3D content is rendered by a
|
|
64
|
+
separate renderer after WebGL when invalidated.
|
|
65
|
+
|
|
66
|
+
Shadows use VSM and manual invalidation:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
shadowMap.autoUpdate = false
|
|
70
|
+
shadowMap.needsUpdate = true only after relevant scene/light changes
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This is a bounded-scene optimization. It depends on every moving caster and
|
|
74
|
+
light correctly invalidating the cache.
|
|
75
|
+
|
|
76
|
+
## atlas-based renderer composer graph
|
|
77
|
+
|
|
78
|
+
atlas-based renderer performs a separate depth prepass into a depth-stencil target before
|
|
79
|
+
the composer:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
depth prepass target
|
|
83
|
+
main render
|
|
84
|
+
SSAO
|
|
85
|
+
volumetric lighting
|
|
86
|
+
bloom
|
|
87
|
+
lens flare
|
|
88
|
+
fog/color grading
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The depth target uses nearest filtering and a
|
|
92
|
+
`DepthStencilFormat`/`UnsignedInt248Type` depth texture. Every depth consumer
|
|
93
|
+
receives that same texture.
|
|
94
|
+
|
|
95
|
+
The composer recalculates effective pixel dimensions from renderer pixel ratio
|
|
96
|
+
and resizes the depth target and all passes together.
|
|
97
|
+
|
|
98
|
+
The composer can exist alongside another application post path. Verify the
|
|
99
|
+
actual render-loop call path before claiming that this graph owns runtime
|
|
100
|
+
output.
|
|
24
101
|
|
|
25
|
-
|
|
102
|
+
## Temporal-surface effect-local graph
|
|
103
|
+
|
|
104
|
+
The temporal frost graph is not a whole-scene post stack. It is a
|
|
105
|
+
self-contained material effect:
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
scene at full resolution
|
|
109
|
+
-> vertical blur at 0.4 DPR
|
|
110
|
+
-> horizontal blur at 0.4 DPR
|
|
111
|
+
-> frost composite at full resolution
|
|
112
|
+
-> pointer history write/swap at full resolution
|
|
113
|
+
-> final normal/refraction output
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Three static procedural texture targets render once. This is a feature-local
|
|
117
|
+
example of mixing persistent, static, low-resolution, and full-resolution
|
|
118
|
+
signals in one feature.
|
|
119
|
+
|
|
120
|
+
## Buffer and ownership rules
|
|
121
|
+
|
|
122
|
+
Before implementation, write:
|
|
123
|
+
|
|
124
|
+
| Signal | Producer | Consumers | Space/format | Resolution | History |
|
|
125
|
+
| --- | --- | --- | --- | --- | --- |
|
|
126
|
+
| HDR scene | scene pass | AO/atmosphere/bloom | linear HDR | full | no |
|
|
127
|
+
| depth | scene or prepass | AO/fog/flare | renderer-defined | full | no |
|
|
128
|
+
| normal | MRT/geometry | AO composite | view space | full | no |
|
|
129
|
+
| albedo | MRT | indirect composite | linear | full | no |
|
|
130
|
+
| bloom contributions | selective passes | final composite | HDR | full/pyramid | no |
|
|
131
|
+
| exposure | meter | final color | scalar | 64x36 source | adapted |
|
|
132
|
+
| interaction | ping-pong pass | frost/output | half-float | full | yes |
|
|
133
|
+
|
|
134
|
+
Every signal has one producer. If a scene pass already owns depth and normal,
|
|
135
|
+
do not add an uncoordinated duplicate prepass without measuring the reason.
|
|
136
|
+
|
|
137
|
+
## Resolution policies
|
|
138
|
+
|
|
139
|
+
selective gallery pipeline caps DPR from both device and pixel budget:
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
mobile budget = 1,000,000 pixels, max DPR 1.25
|
|
143
|
+
desktop budget = 1,650,000 pixels, max DPR 1.5
|
|
144
|
+
minimum DPR = 1
|
|
145
|
+
budget DPR = sqrt(pixelBudget / CSS pixel count)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
All composers receive the same selected DPR and CSS size.
|
|
149
|
+
|
|
150
|
+
The temporal frost graph instead gives individual passes fixed roles:
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
blur and coarse noise = 0.4 DPR
|
|
154
|
+
composite, history, output = display DPR
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Choose global DPR budgeting for scene cost and per-pass scaling for effect
|
|
158
|
+
bandwidth. They solve different problems.
|
|
159
|
+
|
|
160
|
+
## Failure analysis
|
|
161
|
+
|
|
162
|
+
- production WebGPU pipeline API names are version-sensitive; `PostProcessing` was renamed
|
|
163
|
+
and deprecated in favor of `RenderPipeline` in current Three.js history.
|
|
164
|
+
- selective gallery pipeline selective bloom renders the scene multiple times.
|
|
165
|
+
- selective gallery pipeline manual shadow invalidation can freeze unregistered motion.
|
|
166
|
+
- atlas-based renderer depth prepass renders regular scene materials, not an explicit depth
|
|
167
|
+
override; verify transparent and alpha-tested behavior.
|
|
168
|
+
- atlas-based renderer composer may not be the active runtime path.
|
|
169
|
+
- The frost blur has a zero-weight division risk and pointer decay is frame
|
|
170
|
+
based.
|
|
171
|
+
- None of these graphs provides a complete velocity/motion-vector
|
|
172
|
+
contract for general temporal effects.
|
|
173
|
+
- Do not advertise velocity ownership or TAA merely because a generic pipeline
|
|
174
|
+
could include them.
|
|
175
|
+
|
|
176
|
+
## Diagnostics
|
|
26
177
|
|
|
27
|
-
|
|
28
|
-
- depth;
|
|
29
|
-
- normals;
|
|
30
|
-
- masks;
|
|
31
|
-
- AO;
|
|
32
|
-
- bloom source and result;
|
|
33
|
-
- exposure;
|
|
34
|
-
- final output.
|
|
178
|
+
Expose a graph inspector or equivalent stable views:
|
|
35
179
|
|
|
36
|
-
|
|
180
|
+
```text
|
|
181
|
+
scene HDR
|
|
182
|
+
depth raw and reconstructed
|
|
183
|
+
normal/albedo MRT
|
|
184
|
+
GTAO and bent normal
|
|
185
|
+
atmosphere only
|
|
186
|
+
each selective bloom contribution
|
|
187
|
+
exposure meter and current exposure
|
|
188
|
+
pre/post tone map and LUT
|
|
189
|
+
frost static/history/composite targets
|
|
190
|
+
pass resolution, format, memory, and GPU time
|
|
191
|
+
manual invalidation state
|
|
192
|
+
```
|
|
37
193
|
|
|
38
|
-
|
|
39
|
-
|
|
194
|
+
The pipeline is accepted only when every enabled pass has a named input,
|
|
195
|
+
output, owner, resolution, and disable path.
|
|
@@ -5,27 +5,40 @@ description: Build procedural animation systems for Genex Three.js games. Use fo
|
|
|
5
5
|
|
|
6
6
|
# Genex Three.js Procedural Animation
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Read [references/procedural-motion.md](references/procedural-motion.md) for
|
|
12
|
-
timeline, spring, rotating-frame, and debris patterns.
|
|
8
|
+
Animate semantic state, not unrelated transform curves. Define phases,
|
|
9
|
+
coordinate frames, velocities, and ownership before writing per-frame updates.
|
|
13
10
|
|
|
14
11
|
## Build order
|
|
15
12
|
|
|
16
|
-
1. Define the
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
5.
|
|
23
|
-
6.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
13
|
+
1. Define the timeline phases and event boundaries.
|
|
14
|
+
2. Choose the frame for each motion: world, subject local, orbital radial,
|
|
15
|
+
docking axis, or camera shot.
|
|
16
|
+
3. Derive target position/orientation from that frame.
|
|
17
|
+
4. Use analytic kinematics for authored travel and springs for responsive
|
|
18
|
+
convergence.
|
|
19
|
+
5. Preserve world transforms when detaching children from a hierarchy.
|
|
20
|
+
6. Separate translation, alignment, spin, and secondary debris state.
|
|
21
|
+
7. Clamp integration delta and reset every state variable on replay/disposal.
|
|
22
|
+
|
|
23
|
+
Read [references/procedural-motion.md](references/procedural-motion.md)
|
|
24
|
+
for the launch, staging, docking, debris, spring, quaternion, and
|
|
25
|
+
frame-rate-independent response implementations.
|
|
26
|
+
|
|
27
|
+
## Non-negotiable rules
|
|
28
|
+
|
|
29
|
+
- Use elapsed seconds and `deltaSeconds`; do not make motion frame-count based.
|
|
30
|
+
- Derive orientation from direction/frame, then apply roll or spin as a
|
|
31
|
+
separate quaternion.
|
|
32
|
+
- Decompose docking error into axial and radial components.
|
|
33
|
+
- Switch from spring convergence to an exact terminal pose at the end of a
|
|
34
|
+
sequence.
|
|
35
|
+
- When reparenting an animated object, capture world position, quaternion, and
|
|
36
|
+
scale before removal.
|
|
37
|
+
- Use seeded randomness when motion must be reproducible.
|
|
38
|
+
- Keep visual shake in a bounded envelope and separate it from trajectory.
|
|
39
|
+
|
|
40
|
+
## Routing boundary
|
|
41
|
+
|
|
42
|
+
Use `$genex-threejs-camera-direction` for shot composition and camera handoffs.
|
|
43
|
+
Use `$genex-threejs-procedural-vfx` when the deliverable is primarily plasma, sparks,
|
|
44
|
+
or effect pooling rather than object transform motion.
|