@dopaminefx/effect-aurora 0.1.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/aurora-shader.d.ts +45 -0
- package/dist/aurora-shader.d.ts.map +1 -0
- package/dist/aurora-shader.js +277 -0
- package/dist/aurora-shader.js.map +1 -0
- package/dist/aurora.dope.json +417 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
- package/src/aurora-shader.ts +287 -0
- package/src/aurora.dope.json +417 -0
- package/src/index.ts +55 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aurora — a calm success / ambient effect rendered through the generic
|
|
3
|
+
* fullscreen pass runner.
|
|
4
|
+
*
|
|
5
|
+
* Hanging CURTAINS of polar light drape across the upper field, sway and sweep
|
|
6
|
+
* sideways, then gently brighten and fade. It is DIRECTIONAL/curtain — a
|
|
7
|
+
* horizontal band of vertical light ribbons with soft vertical striations —
|
|
8
|
+
* deliberately NOT a radial bloom (it composes across the whole upper surface,
|
|
9
|
+
* so it ignores the anchor: no origin).
|
|
10
|
+
*
|
|
11
|
+
* FULLY DATA-DRIVEN (P2): everything that isn't the GLSL lives in
|
|
12
|
+
* aurora.dope.json — the mood→params mapping + palette (the loader), AND the
|
|
13
|
+
* per-frame logic: `tempo.frame` (the envelope amp + the accumulated sideways
|
|
14
|
+
* sweep), `render.shadowHeightFrac`, `render.consts`, `render.config` and the
|
|
15
|
+
* uniform `binding` contract. `registerDopeEffect` interprets that data through
|
|
16
|
+
* the generic pass runner; this module is just the shader + the registration
|
|
17
|
+
* call.
|
|
18
|
+
*
|
|
19
|
+
* Feeling mapping:
|
|
20
|
+
* - mood → palette + baselines: serene = cool green/teal/blue,
|
|
21
|
+
* celebratory = balanced multi-hue, electric = vivid magenta/teal.
|
|
22
|
+
* - intensity→ brightness (uExposure) + curtain coverage/height (uCoverage,
|
|
23
|
+
* uBandHeight, ribbon count) + drift (uSway) + overshoot.
|
|
24
|
+
* - whimsy → uStyle: photoreal soft volumetric curtains (0) → stylized hard
|
|
25
|
+
* cel / posterized ribbons (1); the pass runner also snaps the
|
|
26
|
+
* clock "on twos" as style rises.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { AURORA_FRAGMENT_SRC, AURORA_VERTEX_SRC } from "./aurora-shader.js";
|
|
30
|
+
import { parseDope, registerDopeEffect, type EffectFactory, type PassParams } from "@dopaminefx/core";
|
|
31
|
+
import doc from "./aurora.dope.json";
|
|
32
|
+
|
|
33
|
+
const DOPE = parseDope(doc as object);
|
|
34
|
+
|
|
35
|
+
/** Resolved aurora params: the loader output + the named scatter seed. */
|
|
36
|
+
export interface AuroraParams extends PassParams {
|
|
37
|
+
exposure: number;
|
|
38
|
+
overshoot: number;
|
|
39
|
+
coverage: number;
|
|
40
|
+
bandY: number;
|
|
41
|
+
bandHeight: number;
|
|
42
|
+
sway: number;
|
|
43
|
+
striation: number;
|
|
44
|
+
rays: number;
|
|
45
|
+
auroraSeed: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// The whole factory (resolve / create / reducedMotion / program registration)
|
|
49
|
+
// is data: aurora.dope.json interpreted by the core backbone.
|
|
50
|
+
export const aurora = registerDopeEffect(DOPE, {
|
|
51
|
+
vertex: AURORA_VERTEX_SRC,
|
|
52
|
+
fragment: AURORA_FRAGMENT_SRC,
|
|
53
|
+
}) as EffectFactory<PassParams> as EffectFactory<AuroraParams>;
|
|
54
|
+
|
|
55
|
+
export default aurora;
|