@dopaminefx/core 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/engine/color.d.ts +71 -0
- package/dist/engine/color.d.ts.map +1 -0
- package/dist/engine/color.js +107 -0
- package/dist/engine/color.js.map +1 -0
- package/dist/engine/context.d.ts +54 -0
- package/dist/engine/context.d.ts.map +1 -0
- package/dist/engine/context.js +0 -0
- package/dist/engine/context.js.map +1 -0
- package/dist/engine/gl.d.ts +9 -0
- package/dist/engine/gl.d.ts.map +1 -0
- package/dist/engine/gl.js +39 -0
- package/dist/engine/gl.js.map +1 -0
- package/dist/engine/look/glsl.d.ts +95 -0
- package/dist/engine/look/glsl.d.ts.map +1 -0
- package/dist/engine/look/glsl.js +171 -0
- package/dist/engine/look/glsl.js.map +1 -0
- package/dist/engine/look/particles.glsl.d.ts +21 -0
- package/dist/engine/look/particles.glsl.d.ts.map +1 -0
- package/dist/engine/look/particles.glsl.js +44 -0
- package/dist/engine/look/particles.glsl.js.map +1 -0
- package/dist/engine/sdf.d.ts +77 -0
- package/dist/engine/sdf.d.ts.map +1 -0
- package/dist/engine/sdf.js +255 -0
- package/dist/engine/sdf.js.map +1 -0
- package/dist/engine/seed.d.ts +10 -0
- package/dist/engine/seed.d.ts.map +1 -0
- package/dist/engine/seed.js +20 -0
- package/dist/engine/seed.js.map +1 -0
- package/dist/engine/shadow.d.ts +41 -0
- package/dist/engine/shadow.d.ts.map +1 -0
- package/dist/engine/shadow.js +39 -0
- package/dist/engine/shadow.js.map +1 -0
- package/dist/engine/tempo.d.ts +33 -0
- package/dist/engine/tempo.d.ts.map +1 -0
- package/dist/engine/tempo.js +51 -0
- package/dist/engine/tempo.js.map +1 -0
- package/dist/framework/conductor.d.ts +100 -0
- package/dist/framework/conductor.d.ts.map +1 -0
- package/dist/framework/conductor.js +493 -0
- package/dist/framework/conductor.js.map +1 -0
- package/dist/framework/content.d.ts +67 -0
- package/dist/framework/content.d.ts.map +1 -0
- package/dist/framework/content.js +72 -0
- package/dist/framework/content.js.map +1 -0
- package/dist/framework/dope-pass.d.ts +131 -0
- package/dist/framework/dope-pass.d.ts.map +1 -0
- package/dist/framework/dope-pass.js +346 -0
- package/dist/framework/dope-pass.js.map +1 -0
- package/dist/framework/dope-zip.d.ts +22 -0
- package/dist/framework/dope-zip.d.ts.map +1 -0
- package/dist/framework/dope-zip.js +116 -0
- package/dist/framework/dope-zip.js.map +1 -0
- package/dist/framework/effect.d.ts +128 -0
- package/dist/framework/effect.d.ts.map +1 -0
- package/dist/framework/effect.js +19 -0
- package/dist/framework/effect.js.map +1 -0
- package/dist/framework/frame-expr.d.ts +124 -0
- package/dist/framework/frame-expr.d.ts.map +1 -0
- package/dist/framework/frame-expr.js +135 -0
- package/dist/framework/frame-expr.js.map +1 -0
- package/dist/framework/load-effect.d.ts +77 -0
- package/dist/framework/load-effect.d.ts.map +1 -0
- package/dist/framework/load-effect.js +135 -0
- package/dist/framework/load-effect.js.map +1 -0
- package/dist/framework/loader.d.ts +309 -0
- package/dist/framework/loader.d.ts.map +1 -0
- package/dist/framework/loader.js +266 -0
- package/dist/framework/loader.js.map +1 -0
- package/dist/framework/mood-registry.d.ts +58 -0
- package/dist/framework/mood-registry.d.ts.map +1 -0
- package/dist/framework/mood-registry.js +58 -0
- package/dist/framework/mood-registry.js.map +1 -0
- package/dist/framework/panel-runner.d.ts +96 -0
- package/dist/framework/panel-runner.d.ts.map +1 -0
- package/dist/framework/panel-runner.js +137 -0
- package/dist/framework/panel-runner.js.map +1 -0
- package/dist/framework/pass-common.d.ts +97 -0
- package/dist/framework/pass-common.d.ts.map +1 -0
- package/dist/framework/pass-common.js +178 -0
- package/dist/framework/pass-common.js.map +1 -0
- package/dist/framework/pass-runner.d.ts +183 -0
- package/dist/framework/pass-runner.d.ts.map +1 -0
- package/dist/framework/pass-runner.js +212 -0
- package/dist/framework/pass-runner.js.map +1 -0
- package/dist/framework/programs.d.ts +54 -0
- package/dist/framework/programs.d.ts.map +1 -0
- package/dist/framework/programs.js +33 -0
- package/dist/framework/programs.js.map +1 -0
- package/dist/framework/registry.d.ts +29 -0
- package/dist/framework/registry.d.ts.map +1 -0
- package/dist/framework/registry.js +38 -0
- package/dist/framework/registry.js.map +1 -0
- package/dist/framework/runtime.d.ts +19 -0
- package/dist/framework/runtime.d.ts.map +1 -0
- package/dist/framework/runtime.js +37 -0
- package/dist/framework/runtime.js.map +1 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +126 -0
- package/dist/index.js.map +1 -0
- package/dist/overlay.d.ts +46 -0
- package/dist/overlay.d.ts.map +1 -0
- package/dist/overlay.js +79 -0
- package/dist/overlay.js.map +1 -0
- package/dist/types.d.ts +68 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +37 -0
- package/src/engine/color.ts +154 -0
- package/src/engine/context.ts +0 -0
- package/src/engine/gl.ts +46 -0
- package/src/engine/look/glsl.ts +183 -0
- package/src/engine/look/particles.glsl.ts +44 -0
- package/src/engine/sdf.ts +298 -0
- package/src/engine/seed.ts +23 -0
- package/src/engine/shadow.ts +66 -0
- package/src/engine/tempo.ts +54 -0
- package/src/framework/conductor.ts +604 -0
- package/src/framework/content.ts +113 -0
- package/src/framework/dope-pass.ts +432 -0
- package/src/framework/dope-zip.ts +125 -0
- package/src/framework/effect.ts +127 -0
- package/src/framework/frame-expr.ts +217 -0
- package/src/framework/load-effect.ts +204 -0
- package/src/framework/loader.ts +502 -0
- package/src/framework/mood-registry.ts +87 -0
- package/src/framework/panel-runner.ts +233 -0
- package/src/framework/pass-common.ts +222 -0
- package/src/framework/pass-runner.ts +391 -0
- package/src/framework/programs.ts +62 -0
- package/src/framework/registry.ts +44 -0
- package/src/framework/runtime.ts +38 -0
- package/src/index.ts +227 -0
- package/src/overlay.ts +109 -0
- package/src/types.ts +63 -0
|
@@ -0,0 +1 @@
|
|
|
1
|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AM,EAAE,CAAC;YACzC,MAAM,IAAI,GAAmB,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;YAC1E,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACjD,uEAAuE;YACvE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YACnD,IAAI,GAAG,CAAC,MAAM,IAAI,SAAS;gBAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;YACxF,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,QAAS,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO;YACL,IAAI,QAAQ;gBAAE,OAAO;YACrB,QAAQ,GAAG,IAAI,CAAC;YAChB,IAAI,QAAQ;gBAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACnD,IAAI,SAAS,IAAI,GAAG,CAAC,MAAM;gBAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QACtE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared plumbing for the two generic effect runners (pass-runner + panel-runner).
|
|
3
|
+
*
|
|
4
|
+
* The pure-shader runner (a full-screen triangle) and the Canvas2D-panel runner
|
|
5
|
+
* (an uploaded panel texture, then the same triangle) differ only in WHAT they
|
|
6
|
+
* upload/sample and one standard uniform (`uOrigin` vs `uCenter`). Everything
|
|
7
|
+
* else — the `name → u<Name>` scalar auto-binding, the palette + life/time/style
|
|
8
|
+
* standard uniforms, the per-frame uniform application, the shadow-pass geometry
|
|
9
|
+
* uniforms, and a linear/edge-clamped texture allocator — is identical glue and
|
|
10
|
+
* lives here ONCE so the two runners can't drift.
|
|
11
|
+
*
|
|
12
|
+
* The functions are deliberately tiny imperative helpers over a resolved uniform
|
|
13
|
+
* map (`u`) so the call order in each runner stays explicit and the emitted GL
|
|
14
|
+
* uniform writes remain byte-identical to the bespoke renderers these replaced.
|
|
15
|
+
*/
|
|
16
|
+
import type { RGB } from "../engine/color.js";
|
|
17
|
+
import type { CachedProgram, GLContext } from "../engine/context.js";
|
|
18
|
+
/**
|
|
19
|
+
* Rewrite a light fragment for the BACKDROP-aware (premultiplied source-over)
|
|
20
|
+
* path: swap the opaque `fragColor = vec4(col, 1.0)` / `vec4(max(col,0.0),1.0)`
|
|
21
|
+
* emit for `fragColor = dopLightOut(col)` (alpha = brightness) and inject the
|
|
22
|
+
* `dopLightOut` helper. This is the same emit swap the Android build applies
|
|
23
|
+
* (`tools/dopamine/src/android-shader.mjs`), so the web backdrop path and the
|
|
24
|
+
* native overlays share one premultiplied-light convention.
|
|
25
|
+
*
|
|
26
|
+
* The replace is global on purpose: a hybrid's shader has a SHADOW branch with
|
|
27
|
+
* its own opaque emit, but the light pass runs with `uShadow == 0` so that
|
|
28
|
+
* branch is dead code here — rewriting it is harmless, and it guarantees the
|
|
29
|
+
* LIVE light-path emit (wherever it sits in the source) is the premultiplied
|
|
30
|
+
* one. The shadow CONTEXT keeps the original, untouched fragment.
|
|
31
|
+
*/
|
|
32
|
+
export declare function compositeLightFragment(fragment: string): string;
|
|
33
|
+
/** A resolved uniform-location map (the output of `CachedProgram.uniforms`). */
|
|
34
|
+
export type UniformMap = Record<string, WebGLUniformLocation | null>;
|
|
35
|
+
/** `bloomRadius → uBloomRadius` — the auto-binding name convention. */
|
|
36
|
+
export declare const cap: (s: string) => string;
|
|
37
|
+
/**
|
|
38
|
+
* The numeric `render.params` that auto-bind to a uniform: each `name → u<Name>`
|
|
39
|
+
* unless an explicit `bindings` entry overrides the uniform name (or maps it to
|
|
40
|
+
* `null` to skip — for a param the shader ignores, e.g. a scatter seed). The
|
|
41
|
+
* tempo `durationMs` is never a shader uniform.
|
|
42
|
+
*/
|
|
43
|
+
export declare function computeScalarBinds(params: Record<string, unknown>, bindings: Record<string, string | null>): Array<[string, string]>;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the program + uniform map for one pass and bind the program + the
|
|
46
|
+
* shared empty VAO. Returns both so the caller can finish binding.
|
|
47
|
+
*/
|
|
48
|
+
export declare function beginProgram(glc: GLContext, vertex: string, fragment: string, allUniforms: readonly string[]): {
|
|
49
|
+
prog: CachedProgram;
|
|
50
|
+
u: UniformMap;
|
|
51
|
+
};
|
|
52
|
+
/** Set a float uniform iff the shader actually declares it. */
|
|
53
|
+
export declare function setF(gl: WebGL2RenderingContext, u: UniformMap, name: string, v: number): void;
|
|
54
|
+
/** Apply a `{ name → float }` map, skipping uniforms the shader doesn't declare. */
|
|
55
|
+
export declare function applyFloatMap(gl: WebGL2RenderingContext, u: UniformMap, map: Record<string, number> | undefined): void;
|
|
56
|
+
/** Bind the three palette stops (uC0/uC1/uC2). */
|
|
57
|
+
export declare function bindPalette(gl: WebGL2RenderingContext, u: UniformMap, pal: RGB[]): void;
|
|
58
|
+
/** Bind the auto-bound scalar params (`name → uniform`). */
|
|
59
|
+
export declare function bindScalars(gl: WebGL2RenderingContext, u: UniformMap, params: Record<string, unknown>, scalarBinds: ReadonlyArray<readonly [string, string]>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Apply the per-frame uniform map from an effect's `frame()` hook. The
|
|
62
|
+
* well-known key `amp` maps to `uAmp`; every other key is its own uniform name.
|
|
63
|
+
*/
|
|
64
|
+
export declare function bindFrameUniforms(gl: WebGL2RenderingContext, u: UniformMap, frameUniforms: Record<string, number>): void;
|
|
65
|
+
/**
|
|
66
|
+
* Set the shadow-pass uniforms (offset/soft/strength) from {@link shadowGeometry}.
|
|
67
|
+
* Call only on the shadow pass; the caller already set `uShadow = 1`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function bindShadowGeometry(gl: WebGL2RenderingContext, u: UniformMap, canvas: HTMLCanvasElement, heightFrac: number, amp: number, style: number): void;
|
|
70
|
+
/** Allocate a linear/edge-clamped texture (pixels uploaded later by the caller). */
|
|
71
|
+
export declare function allocTexture(glc: GLContext): WebGLTexture;
|
|
72
|
+
/** The standard uniforms common to BOTH runners (excludes uOrigin/uCenter). */
|
|
73
|
+
export declare const STANDARD_COMMON: readonly ["uResolution", "uTarget", "uLife", "uTimeS", "uLoopS", "uPhase", "uStyle", "uAmp", "uC0", "uC1", "uC2", "uShadow", "uShadowOffset", "uShadowSoft", "uShadowStrength"];
|
|
74
|
+
/**
|
|
75
|
+
* The targeted element's box in DEVICE px, falling back to the full canvas
|
|
76
|
+
* when no element box was supplied (so untargeted fires are unchanged). The
|
|
77
|
+
* single formula behind the `uTarget` standard uniform AND the `render.pass`
|
|
78
|
+
* `targetMinDimPx` input — one fallback rule, never two.
|
|
79
|
+
*/
|
|
80
|
+
export declare function resolveTargetPx(c: HTMLCanvasElement, targetSize: {
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
} | undefined, dpr: number): {
|
|
84
|
+
width: number;
|
|
85
|
+
height: number;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Bind `uTarget` — the targeted element's size (device px) the centrepiece is
|
|
89
|
+
* sized to — falling back to the full canvas when no element box was supplied
|
|
90
|
+
* (so untargeted fires are unchanged). Shared by both runners; a no-op for
|
|
91
|
+
* shaders that don't declare it.
|
|
92
|
+
*/
|
|
93
|
+
export declare function bindTarget(gl: WebGL2RenderingContext, u: Record<string, WebGLUniformLocation | null>, c: HTMLCanvasElement, targetSize: {
|
|
94
|
+
width: number;
|
|
95
|
+
height: number;
|
|
96
|
+
} | undefined, dpr: number): void;
|
|
97
|
+
//# sourceMappingURL=pass-common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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M,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC,EAC9C,CAAC,EAAE,iBAAiB,EACpB,UAAU,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EACzD,GAAG,EAAE,MAAM,GACV,IAAI,CAIN"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared plumbing for the two generic effect runners (pass-runner + panel-runner).
|
|
3
|
+
*
|
|
4
|
+
* The pure-shader runner (a full-screen triangle) and the Canvas2D-panel runner
|
|
5
|
+
* (an uploaded panel texture, then the same triangle) differ only in WHAT they
|
|
6
|
+
* upload/sample and one standard uniform (`uOrigin` vs `uCenter`). Everything
|
|
7
|
+
* else — the `name → u<Name>` scalar auto-binding, the palette + life/time/style
|
|
8
|
+
* standard uniforms, the per-frame uniform application, the shadow-pass geometry
|
|
9
|
+
* uniforms, and a linear/edge-clamped texture allocator — is identical glue and
|
|
10
|
+
* lives here ONCE so the two runners can't drift.
|
|
11
|
+
*
|
|
12
|
+
* The functions are deliberately tiny imperative helpers over a resolved uniform
|
|
13
|
+
* map (`u`) so the call order in each runner stays explicit and the emitted GL
|
|
14
|
+
* uniform writes remain byte-identical to the bespoke renderers these replaced.
|
|
15
|
+
*/
|
|
16
|
+
import { shadowGeometry } from "../engine/shadow.js";
|
|
17
|
+
import { GLSL_LIGHT_OUT } from "../engine/look/glsl.js";
|
|
18
|
+
// Cache the (idempotent) source transform by input string so repeated fires of
|
|
19
|
+
// the same effect don't re-run the regex; the GLContext program cache keys on
|
|
20
|
+
// the transformed source, so a backdrop-mode fire links its own variant once.
|
|
21
|
+
const compositeFragCache = new Map();
|
|
22
|
+
/**
|
|
23
|
+
* Rewrite a light fragment for the BACKDROP-aware (premultiplied source-over)
|
|
24
|
+
* path: swap the opaque `fragColor = vec4(col, 1.0)` / `vec4(max(col,0.0),1.0)`
|
|
25
|
+
* emit for `fragColor = dopLightOut(col)` (alpha = brightness) and inject the
|
|
26
|
+
* `dopLightOut` helper. This is the same emit swap the Android build applies
|
|
27
|
+
* (`tools/dopamine/src/android-shader.mjs`), so the web backdrop path and the
|
|
28
|
+
* native overlays share one premultiplied-light convention.
|
|
29
|
+
*
|
|
30
|
+
* The replace is global on purpose: a hybrid's shader has a SHADOW branch with
|
|
31
|
+
* its own opaque emit, but the light pass runs with `uShadow == 0` so that
|
|
32
|
+
* branch is dead code here — rewriting it is harmless, and it guarantees the
|
|
33
|
+
* LIVE light-path emit (wherever it sits in the source) is the premultiplied
|
|
34
|
+
* one. The shadow CONTEXT keeps the original, untouched fragment.
|
|
35
|
+
*/
|
|
36
|
+
export function compositeLightFragment(fragment) {
|
|
37
|
+
const cached = compositeFragCache.get(fragment);
|
|
38
|
+
if (cached)
|
|
39
|
+
return cached;
|
|
40
|
+
let out = fragment
|
|
41
|
+
.replace(/fragColor\s*=\s*vec4\(\s*max\(\s*(\w+)\s*,\s*0\.0\s*\)\s*,\s*1\.0\s*\)\s*;/g, "fragColor = dopLightOut($1);")
|
|
42
|
+
.replace(/fragColor\s*=\s*vec4\(\s*(\w+)\s*,\s*1\.0\s*\)\s*;/g, "fragColor = dopLightOut($1);");
|
|
43
|
+
// Only inject the helper if we actually swapped an emit (an effect that
|
|
44
|
+
// already emits premultiplied light — e.g. a `vec4(col, brightness)` — is
|
|
45
|
+
// left exactly as-is and needs no helper).
|
|
46
|
+
if (out !== fragment)
|
|
47
|
+
out = out.replace(/\nvoid main\s*\(/, "\n" + GLSL_LIGHT_OUT + "\nvoid main(");
|
|
48
|
+
compositeFragCache.set(fragment, out);
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
/** `bloomRadius → uBloomRadius` — the auto-binding name convention. */
|
|
52
|
+
export const cap = (s) => `u${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
|
53
|
+
/**
|
|
54
|
+
* The numeric `render.params` that auto-bind to a uniform: each `name → u<Name>`
|
|
55
|
+
* unless an explicit `bindings` entry overrides the uniform name (or maps it to
|
|
56
|
+
* `null` to skip — for a param the shader ignores, e.g. a scatter seed). The
|
|
57
|
+
* tempo `durationMs` is never a shader uniform.
|
|
58
|
+
*/
|
|
59
|
+
export function computeScalarBinds(params, bindings) {
|
|
60
|
+
const out = [];
|
|
61
|
+
for (const [name, value] of Object.entries(params)) {
|
|
62
|
+
if (typeof value !== "number")
|
|
63
|
+
continue;
|
|
64
|
+
if (name === "durationMs")
|
|
65
|
+
continue; // tempo, not a shader uniform
|
|
66
|
+
const override = bindings[name];
|
|
67
|
+
if (override === null)
|
|
68
|
+
continue; // explicitly not a uniform
|
|
69
|
+
out.push([name, override ?? cap(name)]);
|
|
70
|
+
}
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolve the program + uniform map for one pass and bind the program + the
|
|
75
|
+
* shared empty VAO. Returns both so the caller can finish binding.
|
|
76
|
+
*/
|
|
77
|
+
export function beginProgram(glc, vertex, fragment, allUniforms) {
|
|
78
|
+
const { gl } = glc;
|
|
79
|
+
const prog = glc.program(vertex, fragment);
|
|
80
|
+
const u = prog.uniforms(allUniforms);
|
|
81
|
+
gl.useProgram(prog.program);
|
|
82
|
+
gl.bindVertexArray(glc.vao);
|
|
83
|
+
return { prog, u };
|
|
84
|
+
}
|
|
85
|
+
/** Set a float uniform iff the shader actually declares it. */
|
|
86
|
+
export function setF(gl, u, name, v) {
|
|
87
|
+
const loc = u[name];
|
|
88
|
+
if (loc)
|
|
89
|
+
gl.uniform1f(loc, v);
|
|
90
|
+
}
|
|
91
|
+
/** Apply a `{ name → float }` map, skipping uniforms the shader doesn't declare. */
|
|
92
|
+
export function applyFloatMap(gl, u, map) {
|
|
93
|
+
if (!map)
|
|
94
|
+
return;
|
|
95
|
+
for (const [n, v] of Object.entries(map))
|
|
96
|
+
setF(gl, u, n, v);
|
|
97
|
+
}
|
|
98
|
+
/** Bind the three palette stops (uC0/uC1/uC2). */
|
|
99
|
+
export function bindPalette(gl, u, pal) {
|
|
100
|
+
const [c0, c1, c2] = pal;
|
|
101
|
+
if (c0)
|
|
102
|
+
gl.uniform3f(u.uC0, c0.r, c0.g, c0.b);
|
|
103
|
+
if (c1)
|
|
104
|
+
gl.uniform3f(u.uC1, c1.r, c1.g, c1.b);
|
|
105
|
+
if (c2)
|
|
106
|
+
gl.uniform3f(u.uC2, c2.r, c2.g, c2.b);
|
|
107
|
+
}
|
|
108
|
+
/** Bind the auto-bound scalar params (`name → uniform`). */
|
|
109
|
+
export function bindScalars(gl, u, params, scalarBinds) {
|
|
110
|
+
for (const [name, uniformName] of scalarBinds) {
|
|
111
|
+
const loc = u[uniformName];
|
|
112
|
+
if (loc)
|
|
113
|
+
gl.uniform1f(loc, params[name]);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Apply the per-frame uniform map from an effect's `frame()` hook. The
|
|
118
|
+
* well-known key `amp` maps to `uAmp`; every other key is its own uniform name.
|
|
119
|
+
*/
|
|
120
|
+
export function bindFrameUniforms(gl, u, frameUniforms) {
|
|
121
|
+
for (const [n, v] of Object.entries(frameUniforms)) {
|
|
122
|
+
const loc = u[n === "amp" ? "uAmp" : n];
|
|
123
|
+
if (loc)
|
|
124
|
+
gl.uniform1f(loc, v);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Set the shadow-pass uniforms (offset/soft/strength) from {@link shadowGeometry}.
|
|
129
|
+
* Call only on the shadow pass; the caller already set `uShadow = 1`.
|
|
130
|
+
*/
|
|
131
|
+
export function bindShadowGeometry(gl, u, canvas, heightFrac, amp, style) {
|
|
132
|
+
const minDim = Math.min(canvas.width, canvas.height);
|
|
133
|
+
const sg = shadowGeometry({ minDim, heightFrac, amp, style });
|
|
134
|
+
gl.uniform2f(u.uShadowOffset, sg.offsetX, sg.offsetY);
|
|
135
|
+
gl.uniform1f(u.uShadowSoft, sg.soft);
|
|
136
|
+
gl.uniform1f(u.uShadowStrength, sg.strength);
|
|
137
|
+
}
|
|
138
|
+
/** Allocate a linear/edge-clamped texture (pixels uploaded later by the caller). */
|
|
139
|
+
export function allocTexture(glc) {
|
|
140
|
+
const { gl } = glc;
|
|
141
|
+
const tex = gl.createTexture();
|
|
142
|
+
gl.bindTexture(gl.TEXTURE_2D, tex);
|
|
143
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
144
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
145
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
146
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
147
|
+
return tex;
|
|
148
|
+
}
|
|
149
|
+
/** The standard uniforms common to BOTH runners (excludes uOrigin/uCenter). */
|
|
150
|
+
export const STANDARD_COMMON = [
|
|
151
|
+
"uResolution", "uTarget", "uLife", "uTimeS", "uLoopS", "uPhase", "uStyle", "uAmp",
|
|
152
|
+
"uC0", "uC1", "uC2", "uShadow", "uShadowOffset", "uShadowSoft", "uShadowStrength",
|
|
153
|
+
];
|
|
154
|
+
/**
|
|
155
|
+
* The targeted element's box in DEVICE px, falling back to the full canvas
|
|
156
|
+
* when no element box was supplied (so untargeted fires are unchanged). The
|
|
157
|
+
* single formula behind the `uTarget` standard uniform AND the `render.pass`
|
|
158
|
+
* `targetMinDimPx` input — one fallback rule, never two.
|
|
159
|
+
*/
|
|
160
|
+
export function resolveTargetPx(c, targetSize, dpr) {
|
|
161
|
+
return {
|
|
162
|
+
width: targetSize ? targetSize.width * dpr : c.width,
|
|
163
|
+
height: targetSize ? targetSize.height * dpr : c.height,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Bind `uTarget` — the targeted element's size (device px) the centrepiece is
|
|
168
|
+
* sized to — falling back to the full canvas when no element box was supplied
|
|
169
|
+
* (so untargeted fires are unchanged). Shared by both runners; a no-op for
|
|
170
|
+
* shaders that don't declare it.
|
|
171
|
+
*/
|
|
172
|
+
export function bindTarget(gl, u, c, targetSize, dpr) {
|
|
173
|
+
if (!u.uTarget)
|
|
174
|
+
return;
|
|
175
|
+
const { width, height } = resolveTargetPx(c, targetSize, dpr);
|
|
176
|
+
gl.uniform2f(u.uTarget, width, height);
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=pass-common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pass-common.js","sourceRoot":"","sources":["../../src/framework/pass-common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,IAAI,GAAG,GAAG,QAAQ;SACf,OAAO,CAAC,6EAA6E,EAAE,8BAA8B,CAAC;SACtH,OAAO,CAAC,qDAAqD,EAAE,8BAA8B,CAAC,CAAC;IAClG,wEAAwE;IACxE,0EAA0E;IAC1E,2CAA2C;IAC3C,IAAI,GAAG,KAAK,QAAQ;QAAE,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,IAAI,GAAG,cAAc,GAAG,cAAc,CAAC,CAAC;IACpG,kBAAkB,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACtC,OAAO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AAC,CAAC,UAAU,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM;KACxD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,EAA0B,EAC1B,CAA8C,EAC9C,CAAoB,EACpB,UAAyD,EACzD,GAAW;IAEX,IAAI,CAAC,CAAC,CAAC,OAAO;QAAE,OAAO;IACvB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IAC9D,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic fullscreen-pass runner — the shared backbone for PURE-SHADER effects.
|
|
3
|
+
*
|
|
4
|
+
* A pure-shader effect (Solarbloom, Calligraphic Verdict, the Fail stamp) is a
|
|
5
|
+
* full-screen triangle that runs a fragment shader twice — once into the light
|
|
6
|
+
* (screen) context and, when present, once into the shadow (multiply) context.
|
|
7
|
+
* Before this runner, each effect hand-wired the SAME plumbing: link/bind the
|
|
8
|
+
* program + VAO, set the standard uniforms (resolution, origin, time, life,
|
|
9
|
+
* envelope amp, palette, style, the shadow-pass uniforms), upload + bind any aux
|
|
10
|
+
* textures (a baked SDF icon) into BOTH contexts, run the two passes, and free
|
|
11
|
+
* the per-fire GPU resources. That ~120 lines of identical glue is now here,
|
|
12
|
+
* once.
|
|
13
|
+
*
|
|
14
|
+
* What stays per-effect (the honest boundary): the GLSL itself, and a tiny
|
|
15
|
+
* `frame()` hook that computes the genuinely effect-specific TIME-VARYING values
|
|
16
|
+
* (which envelope, which confirm/draw/stamp progress, any shake) into named
|
|
17
|
+
* uniforms. Everything else — standard uniforms, scalar `render.params` →
|
|
18
|
+
* `u<Name>` auto-binding, aux-texture upload/bind, the light+shadow loop, the
|
|
19
|
+
* "animate on twos" stepping, dispose — is generic and data-driven from a small
|
|
20
|
+
* config object.
|
|
21
|
+
*
|
|
22
|
+
* The output is byte-identical to the bespoke renderers it replaces: it sets the
|
|
23
|
+
* same uniforms, in a superset that the shader samples by name, and uses the same
|
|
24
|
+
* `shadowGeometry` / envelope / progress math (supplied by the config).
|
|
25
|
+
*/
|
|
26
|
+
import type { DecodedSdf } from "../engine/sdf.js";
|
|
27
|
+
import type { RGB } from "../engine/color.js";
|
|
28
|
+
import type { EffectContext, EffectInstance } from "./effect.js";
|
|
29
|
+
/** A resolved param bag (the loader's output + any composed fields). */
|
|
30
|
+
export type PassParams = Record<string, unknown> & {
|
|
31
|
+
durationMs: number;
|
|
32
|
+
palette: [RGB, RGB, RGB] | RGB[];
|
|
33
|
+
style: number;
|
|
34
|
+
};
|
|
35
|
+
/** Per-frame timing context handed to a config's `frame()` hook. */
|
|
36
|
+
export interface FrameInfo {
|
|
37
|
+
/** The "on twos"-snapped animation clock in ms (stepping already applied). */
|
|
38
|
+
animMs: number;
|
|
39
|
+
/** Normalized life 0..1 (animMs / durationMs, clamped). */
|
|
40
|
+
life: number;
|
|
41
|
+
/**
|
|
42
|
+
* The REAL un-stepped wall clock in ms (the raw `renderAt` argument, before
|
|
43
|
+
* the "on twos" snap). Mirrors the Swift/Android runners, which hand their
|
|
44
|
+
* `frame()` hooks the same un-stepped clock for stamp/shake-style timing.
|
|
45
|
+
*/
|
|
46
|
+
elapsedMs: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* An aux texture the shader samples. Two sources fit the same model:
|
|
50
|
+
* - `kind:"sdf"` — a baked single-channel R8 distance field (an icon outline),
|
|
51
|
+
* - `kind:"canvas"` — an RGBA Canvas2D source (a rasterized glyph, a panel).
|
|
52
|
+
* The runner uploads it into BOTH the light and shadow contexts (canvas sources
|
|
53
|
+
* upload once, on first bind, then cache), binds it on each pass, and computes
|
|
54
|
+
* per-pass derived uniforms (px ranges that depend on the live canvas size).
|
|
55
|
+
*/
|
|
56
|
+
export type AuxTextureSpec = {
|
|
57
|
+
kind: "sdf";
|
|
58
|
+
/** Texture unit to bind on (e.g. 1 for TEXTURE1). */
|
|
59
|
+
unit: number;
|
|
60
|
+
/** The decoded SDF to upload as an R8 single-channel texture. */
|
|
61
|
+
sdf: DecodedSdf;
|
|
62
|
+
/** Sampler uniform name (bound to `unit`). */
|
|
63
|
+
sampler: string;
|
|
64
|
+
/** "On" flag uniform name (set to 1 when present). */
|
|
65
|
+
onUniform?: string;
|
|
66
|
+
/** Per-pass scalar uniforms (canvas-size-dependent). */
|
|
67
|
+
uniforms?(canvas: HTMLCanvasElement, params: PassParams): Record<string, number>;
|
|
68
|
+
} | {
|
|
69
|
+
kind: "canvas";
|
|
70
|
+
unit: number;
|
|
71
|
+
/** The Canvas2D source uploaded as an RGBA texture. */
|
|
72
|
+
source: HTMLCanvasElement;
|
|
73
|
+
sampler: string;
|
|
74
|
+
onUniform?: string;
|
|
75
|
+
uniforms?(canvas: HTMLCanvasElement, params: PassParams): Record<string, number>;
|
|
76
|
+
};
|
|
77
|
+
/** Config for one pure-shader effect. The genuinely code-shaped bits live here. */
|
|
78
|
+
export interface PassConfig {
|
|
79
|
+
/** Vertex + fragment GLSL (the per-effect look — code under this boundary). */
|
|
80
|
+
vertex: string;
|
|
81
|
+
fragment: string;
|
|
82
|
+
/** Every uniform name the shader reads (for location pre-resolution). */
|
|
83
|
+
uniforms: readonly string[];
|
|
84
|
+
/**
|
|
85
|
+
* Whether the shader reads `uOrigin` (anchored radial effects do; a gesture
|
|
86
|
+
* that composes across the whole surface does not). Default false.
|
|
87
|
+
*/
|
|
88
|
+
usesOrigin?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* The seamless loop period in ms (`tempo.loop.periodMs`) for a CONTINUOUS
|
|
91
|
+
* effect. When set, the runner computes the standard periodic clock uniforms
|
|
92
|
+
* each frame from the snapped clock: `uLoopS` (seconds within the current
|
|
93
|
+
* loop) and `uPhase` (normalized [0, 1)) — so a looping shader needs no
|
|
94
|
+
* per-effect period plumbing. Absent for one-shot effects.
|
|
95
|
+
*/
|
|
96
|
+
loopPeriodMs?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Explicit `param name → uniform name` overrides for the auto scalar binding.
|
|
99
|
+
* By convention a numeric param `bloomRadius` binds to `uBloomRadius`; list an
|
|
100
|
+
* entry here only for exceptions (e.g. `inkSeed → uSeed`). Map to `null` to
|
|
101
|
+
* NOT bind a param to any uniform (e.g. a scatter seed the shader ignores).
|
|
102
|
+
*/
|
|
103
|
+
bindings?: Record<string, string | null>;
|
|
104
|
+
/** Declared aux textures (baked SDF icons), uploaded to light + shadow. */
|
|
105
|
+
auxTextures?(params: PassParams, ctx: EffectContext): AuxTextureSpec[];
|
|
106
|
+
/**
|
|
107
|
+
* Extra per-pass scalar uniforms that depend on the live canvas/target size
|
|
108
|
+
* but are NOT tied to an aux texture (e.g. an icon box size the shader uses
|
|
109
|
+
* even in its SDF-less analytic fallback). Computed once per pass.
|
|
110
|
+
* `targetPx` is the targeted element box in device px with the full-canvas
|
|
111
|
+
* fallback already applied (the same box `uTarget` binds).
|
|
112
|
+
*/
|
|
113
|
+
passUniforms?(canvas: HTMLCanvasElement, params: PassParams, targetPx: {
|
|
114
|
+
width: number;
|
|
115
|
+
height: number;
|
|
116
|
+
}, dpr: number): Record<string, number>;
|
|
117
|
+
/**
|
|
118
|
+
* The shadow occluder "height" as a fraction of min canvas dim — Solarbloom's
|
|
119
|
+
* bloom radius, Verdict's stroke scale, a constant for the Fail stamp.
|
|
120
|
+
*/
|
|
121
|
+
shadowHeightFrac: number | ((params: PassParams) => number);
|
|
122
|
+
/**
|
|
123
|
+
* Compute the genuinely effect-specific TIME-VARYING uniforms for a frame
|
|
124
|
+
* (the envelope amp, confirm/draw/stamp progress, shake, …). Returns a map of
|
|
125
|
+
* uniform name → float. `amp` is returned under a well-known key so the runner
|
|
126
|
+
* can feed it into `shadowGeometry`.
|
|
127
|
+
*/
|
|
128
|
+
frame(info: FrameInfo, params: PassParams): {
|
|
129
|
+
amp: number;
|
|
130
|
+
} & Record<string, number>;
|
|
131
|
+
/**
|
|
132
|
+
* OPTIONAL dynamic sprite panel. A full-screen pass effect whose look is mostly
|
|
133
|
+
* procedural (a bloom, a flash) but which also has a SPARSE element layer (motes,
|
|
134
|
+
* sparks) shouldn't loop those elements at every pixel — that's O(pixels ×
|
|
135
|
+
* elements). Instead it rasterizes them into an offscreen Canvas2D ONCE per frame
|
|
136
|
+
* here; the runner uploads that canvas into BOTH passes and binds it as `sampler`
|
|
137
|
+
* on `unit`, and the shader samples it. (This is the pass-runner analogue of the
|
|
138
|
+
* hybrid panel-runner, but it COMPOSES with the static aux textures above — e.g.
|
|
139
|
+
* solarbloom keeps its baked-SDF/glyph checkmark AND gains a mote panel.)
|
|
140
|
+
*/
|
|
141
|
+
panel?: {
|
|
142
|
+
/** Texture unit to bind the panel on (distinct from any auxTextures unit). */
|
|
143
|
+
unit: number;
|
|
144
|
+
/** Sampler uniform name the shader reads the panel from. */
|
|
145
|
+
sampler: string;
|
|
146
|
+
/** Draw one frame of the sprite layer into the offscreen canvas. */
|
|
147
|
+
draw(panelCtx: CanvasRenderingContext2D, width: number, height: number, params: PassParams, info: FrameInfo & {
|
|
148
|
+
centerPx: {
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
};
|
|
152
|
+
dpr: number;
|
|
153
|
+
}): void;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* OPTIONAL per-frame ARRAY uniforms (vec2/3/4 arrays). For effects that
|
|
157
|
+
* precompute geometry on the CPU each frame and feed it to the shader as a
|
|
158
|
+
* uniform array — e.g. lightning's bolt polyline, far cheaper than re-deriving
|
|
159
|
+
* it with `fbm` at every pixel. Computed ONCE per frame and bound (uniformNfv)
|
|
160
|
+
* in both passes. `geom` carries the live canvas size + the gl-coords strike
|
|
161
|
+
* origin (anchor). Each returned `name` must also appear in `uniforms`.
|
|
162
|
+
*/
|
|
163
|
+
frameArrays?(info: FrameInfo, params: PassParams, geom: {
|
|
164
|
+
width: number;
|
|
165
|
+
height: number;
|
|
166
|
+
dpr: number;
|
|
167
|
+
origin: {
|
|
168
|
+
x: number;
|
|
169
|
+
y: number;
|
|
170
|
+
};
|
|
171
|
+
}): ReadonlyArray<{
|
|
172
|
+
name: string;
|
|
173
|
+
size: 2 | 3 | 4;
|
|
174
|
+
data: Float32Array;
|
|
175
|
+
}>;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Build a drawable {@link EffectInstance} for a pure-shader effect from its
|
|
179
|
+
* config + resolved params + the runtime context. This is the `create()` an
|
|
180
|
+
* effect (or a registered program) hands to the conductor.
|
|
181
|
+
*/
|
|
182
|
+
export declare function createPassInstance(config: PassConfig, params: PassParams, ctx: EffectContext): EffectInstance;
|
|
183
|
+
//# sourceMappingURL=pass-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pass-runner.d.ts","sourceRoot":"","sources":["../../src/framework/pass-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgBjE,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oEAAoE;AACpE,MAAM,WAAW,SAAS;IACxB,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,2DA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