@flare-engine/postfx 0.4.11 → 0.4.13

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.d.mts CHANGED
@@ -34,7 +34,15 @@ interface PostFxRuntime {
34
34
  compile(kind: EffectKind): CompiledShader | null;
35
35
  /** Pack an effect's uniforms into a Float32Array in the order the shader declares. */
36
36
  packUniforms(effect: Effect, width: number, height: number): Float32Array;
37
- /** Build a list of compiled pass descriptors in chain order for enabled effects. */
37
+ /**
38
+ * Build a list of compiled pass descriptors in chain order for enabled effects.
39
+ *
40
+ * The returned array, its pass objects and their `uniforms` buffers belong to
41
+ * the runtime and are rewritten by the next `buildPass` call on it, whichever
42
+ * chain that call is given; copy what must outlive the call. A `uniforms`
43
+ * buffer is replaced only when its slot needs a different length, and a
44
+ * `children` array is replaced, never written into, when its contents change.
45
+ */
38
46
  buildPass(chain: EffectChain, width: number, height: number): CompiledPass[];
39
47
  /** Drop all cached compiled shaders. */
40
48
  reset(): void;
@@ -284,11 +292,11 @@ export declare const CHROMATIC_ABERRATION_SKSL = "\nuniform shader src;\nuniform
284
292
  export declare const CRT_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float scanlineIntensity;\nuniform float curvature;\n\nhalf4 main(float2 coord) {\n float2 uv = coord / resolution;\n float2 centered = uv - 0.5;\n float2 warp = centered * (1.0 + dot(centered, centered) * curvature);\n float2 warpedUv = warp + 0.5;\n if (warpedUv.x < 0.0 || warpedUv.x > 1.0 || warpedUv.y < 0.0 || warpedUv.y > 1.0) {\n return half4(0.0, 0.0, 0.0, 1.0);\n }\n half4 c = src.eval(warpedUv * resolution);\n float scan = 0.5 + 0.5 * sin(warpedUv.y * resolution.y * 3.14159);\n float dim = mix(1.0, scan, scanlineIntensity);\n return half4(c.rgb * dim, c.a);\n}\n";
285
293
  export declare const BLOOM_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float threshold;\nuniform float intensity;\n\nhalf4 main(float2 coord) {\n half4 c = src.eval(coord);\n float luma = dot(c.rgb, half3(0.299, 0.587, 0.114));\n float mask = smoothstep(threshold, 1.0, luma);\n half3 boost = c.rgb * mask * intensity;\n return half4(c.rgb + boost, c.a);\n}\n";
286
294
  export declare const COLOR_GRADING_LUT_SKSL = "\nuniform shader src;\nuniform shader lut;\nuniform float intensity;\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n\n float r = float(scene.r) * 63.0;\n float g = float(scene.g) * 63.0;\n float b = float(scene.b) * 63.0;\n\n float bFloor = floor(b);\n float bCeil = min(bFloor + 1.0, 63.0);\n float bFrac = b - bFloor;\n\n float2 uvFloor = float2((bFloor * 64.0 + r + 0.5) / 4096.0,\n (g + 0.5) / 64.0);\n float2 uvCeil = float2((bCeil * 64.0 + r + 0.5) / 4096.0,\n (g + 0.5) / 64.0);\n\n half3 lutFloor = lut.eval(uvFloor * float2(4096.0, 64.0)).rgb;\n half3 lutCeil = lut.eval(uvCeil * float2(4096.0, 64.0)).rgb;\n\n half3 graded = mix(lutFloor, lutCeil, half(bFrac));\n half3 result = mix(scene.rgb, graded, half(intensity));\n\n return half4(result, scene.a);\n}\n";
287
- export declare const WEATHER_RAIN_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float intensity;\nuniform float direction;\nuniform float scrollOffsetY;\nuniform float3 color;\nuniform float density;\nuniform float streakLen;\n\n// scrollOffsetY is a normalized fall phase in [0,1). Increase it each tick\n// by (speed * dt / screenHeight) and wrap with fract() on the game side.\n\nfloat hash(float2 p) { return fract(sin(dot(p, float2(127.1, 311.7))) * 43758.5453); }\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n float2 uv = coord / resolution;\n float aspect = resolution.x / resolution.y;\n float rad = direction * 3.14159 / 180.0;\n float sinA = sin(rad);\n float cosA = cos(rad);\n // aspect-corrected rotated axes: fallAxis along drop travel, perpAxis across\n float perpAxis = (cosA * uv.x - sinA * uv.y) * aspect;\n float fallAxis = sinA * uv.x + cosA * uv.y;\n\n float coverage = 0.0;\n\n // near layer — COLS=45, tiling=6, brightness=1.0\n {\n float COLS = 45.0;\n float tiling = 6.0;\n float brightness = 1.0;\n float cid = floor(perpAxis * COLS);\n float colHash = hash(float2(cid, 0.0));\n if (colHash < density) {\n float phase = hash(float2(cid, 1.0));\n float colBright = brightness * (0.6 + hash(float2(cid, 2.0)) * 0.4);\n float center = 0.5 + (hash(float2(cid, 3.0)) - 0.5) * 0.4;\n float seg = fract(fallAxis * tiling - scrollOffsetY + phase);\n float coverageY = smoothstep(streakLen, 0.0, seg);\n float width = 0.04;\n float xMask = smoothstep(width, 0.0, abs(fract(perpAxis * COLS) - center));\n coverage = max(coverage, coverageY * xMask * colBright);\n }\n }\n\n // far layer — COLS=85, tiling=11, brightness=0.5\n {\n float COLS = 85.0;\n float tiling = 11.0;\n float brightness = 0.5;\n float cid = floor(perpAxis * COLS);\n float colHash = hash(float2(cid, 10.0));\n if (colHash < density) {\n float phase = hash(float2(cid, 11.0));\n float colBright = brightness * (0.6 + hash(float2(cid, 12.0)) * 0.4);\n float center = 0.5 + (hash(float2(cid, 13.0)) - 0.5) * 0.4;\n float seg = fract(fallAxis * tiling - scrollOffsetY + phase);\n float coverageY = smoothstep(streakLen, 0.0, seg);\n float width = 0.03;\n float xMask = smoothstep(width, 0.0, abs(fract(perpAxis * COLS) - center));\n coverage = max(coverage, coverageY * xMask * colBright);\n }\n }\n\n half3 mixed = mix(scene.rgb, half3(color), half(coverage * intensity));\n return half4(mixed, scene.a);\n}\n";
288
- export declare const WEATHER_SUN_SHAFT_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float intensity;\nuniform float direction;\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n float2 uv = coord / resolution;\n float rad = direction * 3.14159 / 180.0;\n float2 src_point = float2(0.5 + sin(rad) * 0.3, -0.05);\n float2 toFrag = uv - src_point;\n float angle = atan(toFrag.x, toFrag.y);\n float shafts = 0.5 + 0.5 * sin(angle * 8.0);\n float dist = length(toFrag);\n float falloff = 1.0 - smoothstep(0.0, 1.2, dist);\n half shaft = half(shafts * falloff * intensity * 0.35);\n return half4(scene.rgb + half3(shaft * 0.95, shaft * 0.9, shaft * 0.6), scene.a);\n}\n";
289
- export declare const WEATHER_DARK_VIGNETTE_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float intensity;\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n float2 uv = coord / resolution - 0.5;\n float d = length(uv);\n float v = smoothstep(0.3, 0.85, d);\n half dark = half(v * intensity);\n return half4(scene.rgb * (1.0 - dark), scene.a);\n}\n";
290
- export declare const WEATHER_CLOUDS_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float intensity;\nuniform float scrollOffsetX;\nuniform float direction;\n\nfloat hash(float2 p) { return fract(sin(dot(p, float2(127.1, 311.7))) * 43758.5453); }\nfloat vnoise(float2 p) {\n float2 i = floor(p); float2 f = fract(p);\n float2 u = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + float2(1.0, 0.0)), u.x),\n mix(hash(i + float2(0.0, 1.0)), hash(i + float2(1.0, 1.0)), u.x), u.y);\n}\nfloat fbm(float2 p) { return vnoise(p) * 0.6 + vnoise(p * 2.3) * 0.4; }\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n float2 uv = coord / resolution;\n // direction=0 → pure horizontal scroll (cos=1, sin=0), matching the pre-direction default.\n float rad = direction * 3.14159 / 180.0;\n float2 scrollDir = float2(cos(rad), sin(rad));\n float2 cloudUv = float2(\n uv.x + scrollOffsetX * scrollDir.x / resolution.x,\n uv.y * 0.5 + scrollOffsetX * scrollDir.y / resolution.y\n );\n float cloud = fbm(cloudUv * 3.0);\n float heightFade = smoothstep(0.6, 0.2, uv.y);\n float alpha = cloud * heightFade * intensity * 0.5;\n half3 cloudColor = half3(0.9, 0.9, 0.95);\n return half4(mix(scene.rgb, cloudColor, half(alpha)), scene.a);\n}\n";
291
- export declare const COMPOSITE_SKSL = "\nuniform shader src;\n\nuniform float2 resolution;\nuniform float vignetteIntensity;\nuniform float vignetteRadius;\nuniform float3 vignetteColor;\nuniform float bloomThreshold;\nuniform float bloomIntensity;\nuniform float flashIntensity;\nuniform float chromaAmount;\nuniform float crtScanlineIntensity;\nuniform float crtCurvature;\nuniform float crtEnabled;\nuniform float weatherKind;\nuniform float weatherIntensity;\nuniform float weatherDirection;\nuniform float weatherScrollX;\nuniform float weatherScrollY;\nuniform float3 weatherColor;\nuniform float weatherDensity;\nuniform float weatherStreakLen;\n\nfloat hash(float2 p) { return fract(sin(dot(p, float2(127.1, 311.7))) * 43758.5453); }\nfloat vnoise(float2 p) {\n float2 i = floor(p); float2 f = fract(p);\n float2 u = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + float2(1.0, 0.0)), u.x),\n mix(hash(i + float2(0.0, 1.0)), hash(i + float2(1.0, 1.0)), u.x), u.y);\n}\nfloat fbm(float2 p) { return vnoise(p) * 0.6 + vnoise(p * 2.3) * 0.4; }\n\nhalf4 main(float2 coord) {\n // --- chromatic aberration ---\n float2 uv = coord / resolution;\n float2 chromaOffset = (uv - 0.5) * chromaAmount;\n half r = src.eval((uv - chromaOffset) * resolution).r;\n half g = src.eval(coord).g;\n half b = src.eval((uv + chromaOffset) * resolution).b;\n half3 c = half3(r, g, b);\n\n // --- CRT ---\n float2 crtCentered = uv - 0.5;\n float2 crtWarp = crtCentered * (1.0 + dot(crtCentered, crtCentered) * crtCurvature);\n float2 crtUv = crtWarp + 0.5;\n float crtMask = float(crtUv.x >= 0.0 && crtUv.x <= 1.0 && crtUv.y >= 0.0 && crtUv.y <= 1.0);\n {\n float2 chromaOffsetCrt = (crtUv - 0.5) * chromaAmount;\n half rCrt = src.eval((crtUv - chromaOffsetCrt) * resolution).r;\n half gCrt = src.eval(crtUv * resolution).g;\n half bCrt = src.eval((crtUv + chromaOffsetCrt) * resolution).b;\n half3 crtColor = half3(rCrt, gCrt, bCrt);\n float scan = 0.5 + 0.5 * sin(crtUv.y * resolution.y * 3.14159);\n float dim = mix(1.0, scan, crtScanlineIntensity);\n half3 crtResult = crtColor * half(dim);\n c = mix(c, mix(half3(0.0), crtResult, half(crtMask)), half(crtEnabled));\n }\n\n // --- bloom ---\n float luma = dot(c, half3(0.299, 0.587, 0.114));\n float bloomMask = smoothstep(bloomThreshold, 1.0, luma);\n c = c + c * half(bloomMask * bloomIntensity);\n\n // --- weather ---\n {\n float wk = weatherKind;\n if (wk >= 0.5 && wk < 1.5) {\n // rain — falling sawtooth streaks, 2 parallax layers, alpha-over blend\n // weatherScrollY is normalized [0,1) fall phase (increment speed*dt/screenH each tick)\n float rad = weatherDirection * 3.14159 / 180.0;\n float sinA = sin(rad);\n float cosA = cos(rad);\n float aspect = resolution.x / resolution.y;\n float perpAxis = (cosA * uv.x - sinA * uv.y) * aspect;\n float fallAxis = sinA * uv.x + cosA * uv.y;\n\n float coverage = 0.0;\n\n // near layer — COLS=45, tiling=6, brightness=1.0\n {\n float COLS = 45.0;\n float tiling = 6.0;\n float brightness = 1.0;\n float cid = floor(perpAxis * COLS);\n float colHash = hash(float2(cid, 0.0));\n if (colHash < weatherDensity) {\n float phase = hash(float2(cid, 1.0));\n float colBright = brightness * (0.6 + hash(float2(cid, 2.0)) * 0.4);\n float center = 0.5 + (hash(float2(cid, 3.0)) - 0.5) * 0.4;\n float seg = fract(fallAxis * tiling - weatherScrollY + phase);\n float coverageY = smoothstep(weatherStreakLen, 0.0, seg);\n float width = 0.04;\n float xMask = smoothstep(width, 0.0, abs(fract(perpAxis * COLS) - center));\n coverage = max(coverage, coverageY * xMask * colBright);\n }\n }\n\n // far layer — COLS=85, tiling=11, brightness=0.5\n {\n float COLS = 85.0;\n float tiling = 11.0;\n float brightness = 0.5;\n float cid = floor(perpAxis * COLS);\n float colHash = hash(float2(cid, 10.0));\n if (colHash < weatherDensity) {\n float phase = hash(float2(cid, 11.0));\n float colBright = brightness * (0.6 + hash(float2(cid, 12.0)) * 0.4);\n float center = 0.5 + (hash(float2(cid, 13.0)) - 0.5) * 0.4;\n float seg = fract(fallAxis * tiling - weatherScrollY + phase);\n float coverageY = smoothstep(weatherStreakLen, 0.0, seg);\n float width = 0.03;\n float xMask = smoothstep(width, 0.0, abs(fract(perpAxis * COLS) - center));\n coverage = max(coverage, coverageY * xMask * colBright);\n }\n }\n\n c = mix(c, half3(weatherColor), half(coverage * weatherIntensity));\n } else if (wk >= 1.5 && wk < 2.5) {\n // sun-shaft\n float rad = weatherDirection * 3.14159 / 180.0;\n float2 srcPoint = float2(0.5 + sin(rad) * 0.3, -0.05);\n float2 toFrag = uv - srcPoint;\n float angle = atan(toFrag.x, toFrag.y);\n float shafts = 0.5 + 0.5 * sin(angle * 8.0);\n float dist = length(toFrag);\n float falloff = 1.0 - smoothstep(0.0, 1.2, dist);\n half shaft = half(shafts * falloff * weatherIntensity * 0.35);\n c = c + half3(shaft * 0.95, shaft * 0.9, shaft * 0.6);\n } else if (wk >= 2.5 && wk < 3.5) {\n // dark-vignette\n float2 uvShift = uv - 0.5;\n float d2 = length(uvShift);\n float vd = smoothstep(0.3, 0.85, d2);\n half dark = half(vd * weatherIntensity);\n c = c * (1.0 - dark);\n } else if (wk >= 3.5) {\n // clouds — rotated scroll, mirrored from WEATHER_CLOUDS_SKSL (direction=0 → horizontal)\n float rad = weatherDirection * 3.14159 / 180.0;\n float2 scrollDir = float2(cos(rad), sin(rad));\n float2 cloudUv = float2(\n uv.x + weatherScrollX * scrollDir.x / resolution.x,\n uv.y * 0.5 + weatherScrollX * scrollDir.y / resolution.y\n );\n float cloud = fbm(cloudUv * 3.0);\n float heightFade = smoothstep(0.6, 0.2, uv.y);\n float alpha = cloud * heightFade * weatherIntensity * 0.5;\n half3 cloudColor = half3(0.9, 0.9, 0.95);\n c = mix(c, cloudColor, half(alpha));\n }\n }\n\n // --- grayscale flash ---\n float lumaFlash = dot(c, half3(0.299, 0.587, 0.114));\n half3 gray = half3(lumaFlash);\n c = mix(c, gray, half(flashIntensity));\n\n // --- vignette ---\n float2 vigCentered = uv - 0.5;\n float vigD = length(vigCentered);\n float vigV = smoothstep(vignetteRadius, vignetteRadius * 0.5, vigD);\n c = mix(half3(vignetteColor), c, half(mix(1.0 - vignetteIntensity, 1.0, vigV)));\n\n return half4(c, 1.0);\n}\n";
295
+ export declare const WEATHER_RAIN_SKSL: string;
296
+ export declare const WEATHER_SUN_SHAFT_SKSL: string;
297
+ export declare const WEATHER_DARK_VIGNETTE_SKSL: string;
298
+ export declare const WEATHER_CLOUDS_SKSL: string;
299
+ export declare const COMPOSITE_SKSL: string;
292
300
  export declare const GOD_RAYS_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float2 u_lightPos;\nuniform float3 u_color;\nuniform float u_intensity;\nuniform float u_decay;\nuniform float u_density;\nuniform float u_weight;\nuniform float u_samples;\n\nconst int MAX_SAMPLES = 64;\n\nhalf4 main(float2 coord) {\n float2 uv = coord / resolution;\n float2 delta = (u_lightPos - uv) * u_density / float(MAX_SAMPLES);\n float2 sampleUv = uv;\n float illuminationDecay = 1.0;\n half3 accumulated = half3(0.0);\n\n for (int i = 0; i < MAX_SAMPLES; i++) {\n if (float(i) >= u_samples) break;\n sampleUv += delta;\n half3 s = src.eval(sampleUv * resolution).rgb;\n accumulated += s * half(illuminationDecay) * half(u_weight);\n illuminationDecay *= u_decay;\n }\n\n half4 orig = src.eval(coord);\n half3 rays = accumulated * half3(u_color) * half(u_weight) * half(u_intensity);\n return half4(orig.rgb + rays, orig.a);\n}\n";
293
301
  export type { BloomUniforms, ChromaticAberrationUniforms, ColorGradingLutUniforms, CompiledPass, CompiledShader, CompositeUniforms, CrtUniforms, Effect, EffectKind, EffectUniforms, GodRaysUniforms, GrayscaleFlashUniforms, PostFxController, PostFxControllerOptions, PostFxFlashConfig, PostFxRuntime, SkImageLike, SkiaPostFxModuleLike, SkiaRuntimeEffectFactory, SkiaRuntimeEffectLike, VignetteUniforms, WeatherCloudsUniforms, WeatherDarkVignetteUniforms, WeatherRainUniforms, WeatherSunShaftUniforms };
294
302
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/runtime.ts","../src/effect.ts","../src/chain.ts","../src/controller.ts","../src/lut.ts","../src/shaders.ts"],"mappings":";;;;;;;;;;;UA6BiB;WACN;;UAMM;EACf,uBAAuB,UAAU,yBAAyB;;EAE1D;;UAGe;EACf,KAAK,eAAe;;UAGL;EACf,eAAe;;UAGA;EACf,MAAM;EACN,QAAQ;;UAGO;;WAEN;;EAET,QAAQ,MAAM,aAAa;;EAE3B,aAAa,QAAQ,QAAQ,eAAe,iBAAiB;;EAE7D,UAAU,OAAO,aAAa,eAAe,iBAAiB;;EAE9D;;UAGe;EACf;EACA,MAAM;EACN,QAAQ;EACR,UAAU;;;;;;;;;;;;;EAaV,mBAAmB;;;;;;;wBAuBL,oBACd,MAAM,6BACN;EAAS;IACR;KCrGS;UAcK;EACf;EACA;EACA;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,KAAK;EACL;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EACL;IAAqB;EACrB;IAA4B;EAC5B;IAAiC;EACjC;IAAgB;EAChB;IAAkB;EAClB;IAAqB;EACrB;IAA8B;EAC9B;IAAyB;EACzB;IAA8B;EAC9B;IAAkC;EAClC;IAA2B;EAC3B;IAAsB;UAEZ;EACf;EACA;EACA,UAAU;;wBAGI,eAAe,aAAiB,WAAU,QAAQ,oBAAyB;wBAa3E,qBACd,aACA,WAAU,QAAQ,0BACjB;wBAQa,0BACd,aACA,WAAU,QAAQ,+BACjB;wBAQa,UAAU,aAAY,WAAU,QAAQ,eAAoB;wBAY5D,YAAY,aAAc,WAAU,QAAQ,iBAAsB;wBAYlE,cAAc,aAAiB,WAAU,QAAQ,mBAAwB;wBAkBzE,sBACd,YACA;EAAY,KAAK;EAAa;IAC7B;wBAYa,kBACd,aACA,WAAU,QAAQ,uBACjB;wBAgBa,sBACd,aACA,WAAU,QAAQ,2BACjB;wBAYa,0BACd,aACA,WAAU,QAAQ,+BACjB;wBAWa,oBACd,aACA,WAAU,QAAQ,yBACjB;wBAaa,sBACd,aACA,WAAU,QAAQ,qBACjB;;;;;qBC1RU;UACH;UACA;MAEJ;;;;;;;;;;;;;;;;;;MAqBA;MAIA,gBAAgB;;EAKpB,mBAAmB;;EAKnB,gBAAgB;;EAKhB,IAAI,QAAQ;;EAQZ,OAAO,eAAe,QAAQ;EAQ9B,OAAO;EAOP,IAAI,aAAa;EAIjB,WAAW,YAAY;;EAMvB,YAAY,YAAY,UAAU;EAWlC,KAAK,YAAY;EASjB;;EAKC,WAAW,iBAAiB;;UC5Fd;;WAEN;;WAEA;;UAGM;;WAEN,kBAAkB;;WAElB,OAAO;;WAEP,QAAQ;;UAGF;WACN,OAAO;WACP,SAAS;;EAElB;;;;;;;EAOA,aAAa,kBAAkB;;EAE/B,OAAO;;EAEP,UAAU,eAAe,0BAA0B;;;;;EAKnD,eAAe;;wBAKD,uBAAuB,SAAS,0BAA0B;wBCvD1D,yBAAyB;;;;;;;;;;;qBCS5B;qBAiBA;qBAaA;qBAgBA;qBAqBA;qBAiBA;qBA+BA;qBAuEA;qBAqBA;qBAeA;qBA8DA;qBA0KA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/runtime.ts","../src/effect.ts","../src/chain.ts","../src/controller.ts","../src/lut.ts","../src/shaders.ts"],"mappings":";;;;;;;;;;;UA6BiB;WACN;;UAMM;EACf,uBAAuB,UAAU,yBAAyB;;EAE1D;;UAGe;EACf,KAAK,eAAe;;UA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QAAQ,+BACjB;wBAWa,oBACd,aACA,WAAU,QAAQ,yBACjB;wBAaa,sBACd,aACA,WAAU,QAAQ,qBACjB;;;;;qBC1RU;UACH;UACA;MAEJ;;;;;;;;;;;;;;;;;;MAqBA;MAIA,gBAAgB;;EAKpB,mBAAmB;;EAKnB,gBAAgB;;EAKhB,IAAI,QAAQ;;EAQZ,OAAO,eAAe,QAAQ;EAQ9B,OAAO;EAOP,IAAI,aAAa;EASjB,WAAW,YAAY;;EAMvB,YAAY,YAAY,UAAU;EAWlC,KAAK,YAAY;EASjB;;EAKC,WAAW,iBAAiB;;UCjGd;;WAEN;;WAEA;;UAGM;;WAEN,kBAAkB;;WAElB,OAAO;;WAEP,QAAQ;;UAGF;WACN,OAAO;WACP,SAAS;;EAElB;;;;;;;EAOA,aAAa,kBAAkB;;EAE/B,OAAO;;EAEP,UAAU,eAAe,0BAA0B;;;;;EAKnD,eAAe;;wBAKD,uBAAuB,SAAS,0BAA0B;wBCvD1D,yBAAyB;;;;;;;;;;;qBCS5B;qBAiBA;qBAaA;qBAgBA;qBAqBA;qBAiBA;qBAsLA;qBAyBA;qBAcA;qBAYA;qBA8CA;qBAoGA"}
package/dist/index.d.ts CHANGED
@@ -34,7 +34,15 @@ interface PostFxRuntime {
34
34
  compile(kind: EffectKind): CompiledShader | null;
35
35
  /** Pack an effect's uniforms into a Float32Array in the order the shader declares. */
36
36
  packUniforms(effect: Effect, width: number, height: number): Float32Array;
37
- /** Build a list of compiled pass descriptors in chain order for enabled effects. */
37
+ /**
38
+ * Build a list of compiled pass descriptors in chain order for enabled effects.
39
+ *
40
+ * The returned array, its pass objects and their `uniforms` buffers belong to
41
+ * the runtime and are rewritten by the next `buildPass` call on it, whichever
42
+ * chain that call is given; copy what must outlive the call. A `uniforms`
43
+ * buffer is replaced only when its slot needs a different length, and a
44
+ * `children` array is replaced, never written into, when its contents change.
45
+ */
38
46
  buildPass(chain: EffectChain, width: number, height: number): CompiledPass[];
39
47
  /** Drop all cached compiled shaders. */
40
48
  reset(): void;
@@ -284,11 +292,11 @@ export declare const CHROMATIC_ABERRATION_SKSL = "\nuniform shader src;\nuniform
284
292
  export declare const CRT_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float scanlineIntensity;\nuniform float curvature;\n\nhalf4 main(float2 coord) {\n float2 uv = coord / resolution;\n float2 centered = uv - 0.5;\n float2 warp = centered * (1.0 + dot(centered, centered) * curvature);\n float2 warpedUv = warp + 0.5;\n if (warpedUv.x < 0.0 || warpedUv.x > 1.0 || warpedUv.y < 0.0 || warpedUv.y > 1.0) {\n return half4(0.0, 0.0, 0.0, 1.0);\n }\n half4 c = src.eval(warpedUv * resolution);\n float scan = 0.5 + 0.5 * sin(warpedUv.y * resolution.y * 3.14159);\n float dim = mix(1.0, scan, scanlineIntensity);\n return half4(c.rgb * dim, c.a);\n}\n";
285
293
  export declare const BLOOM_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float threshold;\nuniform float intensity;\n\nhalf4 main(float2 coord) {\n half4 c = src.eval(coord);\n float luma = dot(c.rgb, half3(0.299, 0.587, 0.114));\n float mask = smoothstep(threshold, 1.0, luma);\n half3 boost = c.rgb * mask * intensity;\n return half4(c.rgb + boost, c.a);\n}\n";
286
294
  export declare const COLOR_GRADING_LUT_SKSL = "\nuniform shader src;\nuniform shader lut;\nuniform float intensity;\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n\n float r = float(scene.r) * 63.0;\n float g = float(scene.g) * 63.0;\n float b = float(scene.b) * 63.0;\n\n float bFloor = floor(b);\n float bCeil = min(bFloor + 1.0, 63.0);\n float bFrac = b - bFloor;\n\n float2 uvFloor = float2((bFloor * 64.0 + r + 0.5) / 4096.0,\n (g + 0.5) / 64.0);\n float2 uvCeil = float2((bCeil * 64.0 + r + 0.5) / 4096.0,\n (g + 0.5) / 64.0);\n\n half3 lutFloor = lut.eval(uvFloor * float2(4096.0, 64.0)).rgb;\n half3 lutCeil = lut.eval(uvCeil * float2(4096.0, 64.0)).rgb;\n\n half3 graded = mix(lutFloor, lutCeil, half(bFrac));\n half3 result = mix(scene.rgb, graded, half(intensity));\n\n return half4(result, scene.a);\n}\n";
287
- export declare const WEATHER_RAIN_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float intensity;\nuniform float direction;\nuniform float scrollOffsetY;\nuniform float3 color;\nuniform float density;\nuniform float streakLen;\n\n// scrollOffsetY is a normalized fall phase in [0,1). Increase it each tick\n// by (speed * dt / screenHeight) and wrap with fract() on the game side.\n\nfloat hash(float2 p) { return fract(sin(dot(p, float2(127.1, 311.7))) * 43758.5453); }\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n float2 uv = coord / resolution;\n float aspect = resolution.x / resolution.y;\n float rad = direction * 3.14159 / 180.0;\n float sinA = sin(rad);\n float cosA = cos(rad);\n // aspect-corrected rotated axes: fallAxis along drop travel, perpAxis across\n float perpAxis = (cosA * uv.x - sinA * uv.y) * aspect;\n float fallAxis = sinA * uv.x + cosA * uv.y;\n\n float coverage = 0.0;\n\n // near layer — COLS=45, tiling=6, brightness=1.0\n {\n float COLS = 45.0;\n float tiling = 6.0;\n float brightness = 1.0;\n float cid = floor(perpAxis * COLS);\n float colHash = hash(float2(cid, 0.0));\n if (colHash < density) {\n float phase = hash(float2(cid, 1.0));\n float colBright = brightness * (0.6 + hash(float2(cid, 2.0)) * 0.4);\n float center = 0.5 + (hash(float2(cid, 3.0)) - 0.5) * 0.4;\n float seg = fract(fallAxis * tiling - scrollOffsetY + phase);\n float coverageY = smoothstep(streakLen, 0.0, seg);\n float width = 0.04;\n float xMask = smoothstep(width, 0.0, abs(fract(perpAxis * COLS) - center));\n coverage = max(coverage, coverageY * xMask * colBright);\n }\n }\n\n // far layer — COLS=85, tiling=11, brightness=0.5\n {\n float COLS = 85.0;\n float tiling = 11.0;\n float brightness = 0.5;\n float cid = floor(perpAxis * COLS);\n float colHash = hash(float2(cid, 10.0));\n if (colHash < density) {\n float phase = hash(float2(cid, 11.0));\n float colBright = brightness * (0.6 + hash(float2(cid, 12.0)) * 0.4);\n float center = 0.5 + (hash(float2(cid, 13.0)) - 0.5) * 0.4;\n float seg = fract(fallAxis * tiling - scrollOffsetY + phase);\n float coverageY = smoothstep(streakLen, 0.0, seg);\n float width = 0.03;\n float xMask = smoothstep(width, 0.0, abs(fract(perpAxis * COLS) - center));\n coverage = max(coverage, coverageY * xMask * colBright);\n }\n }\n\n half3 mixed = mix(scene.rgb, half3(color), half(coverage * intensity));\n return half4(mixed, scene.a);\n}\n";
288
- export declare const WEATHER_SUN_SHAFT_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float intensity;\nuniform float direction;\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n float2 uv = coord / resolution;\n float rad = direction * 3.14159 / 180.0;\n float2 src_point = float2(0.5 + sin(rad) * 0.3, -0.05);\n float2 toFrag = uv - src_point;\n float angle = atan(toFrag.x, toFrag.y);\n float shafts = 0.5 + 0.5 * sin(angle * 8.0);\n float dist = length(toFrag);\n float falloff = 1.0 - smoothstep(0.0, 1.2, dist);\n half shaft = half(shafts * falloff * intensity * 0.35);\n return half4(scene.rgb + half3(shaft * 0.95, shaft * 0.9, shaft * 0.6), scene.a);\n}\n";
289
- export declare const WEATHER_DARK_VIGNETTE_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float intensity;\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n float2 uv = coord / resolution - 0.5;\n float d = length(uv);\n float v = smoothstep(0.3, 0.85, d);\n half dark = half(v * intensity);\n return half4(scene.rgb * (1.0 - dark), scene.a);\n}\n";
290
- export declare const WEATHER_CLOUDS_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float intensity;\nuniform float scrollOffsetX;\nuniform float direction;\n\nfloat hash(float2 p) { return fract(sin(dot(p, float2(127.1, 311.7))) * 43758.5453); }\nfloat vnoise(float2 p) {\n float2 i = floor(p); float2 f = fract(p);\n float2 u = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + float2(1.0, 0.0)), u.x),\n mix(hash(i + float2(0.0, 1.0)), hash(i + float2(1.0, 1.0)), u.x), u.y);\n}\nfloat fbm(float2 p) { return vnoise(p) * 0.6 + vnoise(p * 2.3) * 0.4; }\n\nhalf4 main(float2 coord) {\n half4 scene = src.eval(coord);\n float2 uv = coord / resolution;\n // direction=0 → pure horizontal scroll (cos=1, sin=0), matching the pre-direction default.\n float rad = direction * 3.14159 / 180.0;\n float2 scrollDir = float2(cos(rad), sin(rad));\n float2 cloudUv = float2(\n uv.x + scrollOffsetX * scrollDir.x / resolution.x,\n uv.y * 0.5 + scrollOffsetX * scrollDir.y / resolution.y\n );\n float cloud = fbm(cloudUv * 3.0);\n float heightFade = smoothstep(0.6, 0.2, uv.y);\n float alpha = cloud * heightFade * intensity * 0.5;\n half3 cloudColor = half3(0.9, 0.9, 0.95);\n return half4(mix(scene.rgb, cloudColor, half(alpha)), scene.a);\n}\n";
291
- export declare const COMPOSITE_SKSL = "\nuniform shader src;\n\nuniform float2 resolution;\nuniform float vignetteIntensity;\nuniform float vignetteRadius;\nuniform float3 vignetteColor;\nuniform float bloomThreshold;\nuniform float bloomIntensity;\nuniform float flashIntensity;\nuniform float chromaAmount;\nuniform float crtScanlineIntensity;\nuniform float crtCurvature;\nuniform float crtEnabled;\nuniform float weatherKind;\nuniform float weatherIntensity;\nuniform float weatherDirection;\nuniform float weatherScrollX;\nuniform float weatherScrollY;\nuniform float3 weatherColor;\nuniform float weatherDensity;\nuniform float weatherStreakLen;\n\nfloat hash(float2 p) { return fract(sin(dot(p, float2(127.1, 311.7))) * 43758.5453); }\nfloat vnoise(float2 p) {\n float2 i = floor(p); float2 f = fract(p);\n float2 u = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + float2(1.0, 0.0)), u.x),\n mix(hash(i + float2(0.0, 1.0)), hash(i + float2(1.0, 1.0)), u.x), u.y);\n}\nfloat fbm(float2 p) { return vnoise(p) * 0.6 + vnoise(p * 2.3) * 0.4; }\n\nhalf4 main(float2 coord) {\n // --- chromatic aberration ---\n float2 uv = coord / resolution;\n float2 chromaOffset = (uv - 0.5) * chromaAmount;\n half r = src.eval((uv - chromaOffset) * resolution).r;\n half g = src.eval(coord).g;\n half b = src.eval((uv + chromaOffset) * resolution).b;\n half3 c = half3(r, g, b);\n\n // --- CRT ---\n float2 crtCentered = uv - 0.5;\n float2 crtWarp = crtCentered * (1.0 + dot(crtCentered, crtCentered) * crtCurvature);\n float2 crtUv = crtWarp + 0.5;\n float crtMask = float(crtUv.x >= 0.0 && crtUv.x <= 1.0 && crtUv.y >= 0.0 && crtUv.y <= 1.0);\n {\n float2 chromaOffsetCrt = (crtUv - 0.5) * chromaAmount;\n half rCrt = src.eval((crtUv - chromaOffsetCrt) * resolution).r;\n half gCrt = src.eval(crtUv * resolution).g;\n half bCrt = src.eval((crtUv + chromaOffsetCrt) * resolution).b;\n half3 crtColor = half3(rCrt, gCrt, bCrt);\n float scan = 0.5 + 0.5 * sin(crtUv.y * resolution.y * 3.14159);\n float dim = mix(1.0, scan, crtScanlineIntensity);\n half3 crtResult = crtColor * half(dim);\n c = mix(c, mix(half3(0.0), crtResult, half(crtMask)), half(crtEnabled));\n }\n\n // --- bloom ---\n float luma = dot(c, half3(0.299, 0.587, 0.114));\n float bloomMask = smoothstep(bloomThreshold, 1.0, luma);\n c = c + c * half(bloomMask * bloomIntensity);\n\n // --- weather ---\n {\n float wk = weatherKind;\n if (wk >= 0.5 && wk < 1.5) {\n // rain — falling sawtooth streaks, 2 parallax layers, alpha-over blend\n // weatherScrollY is normalized [0,1) fall phase (increment speed*dt/screenH each tick)\n float rad = weatherDirection * 3.14159 / 180.0;\n float sinA = sin(rad);\n float cosA = cos(rad);\n float aspect = resolution.x / resolution.y;\n float perpAxis = (cosA * uv.x - sinA * uv.y) * aspect;\n float fallAxis = sinA * uv.x + cosA * uv.y;\n\n float coverage = 0.0;\n\n // near layer — COLS=45, tiling=6, brightness=1.0\n {\n float COLS = 45.0;\n float tiling = 6.0;\n float brightness = 1.0;\n float cid = floor(perpAxis * COLS);\n float colHash = hash(float2(cid, 0.0));\n if (colHash < weatherDensity) {\n float phase = hash(float2(cid, 1.0));\n float colBright = brightness * (0.6 + hash(float2(cid, 2.0)) * 0.4);\n float center = 0.5 + (hash(float2(cid, 3.0)) - 0.5) * 0.4;\n float seg = fract(fallAxis * tiling - weatherScrollY + phase);\n float coverageY = smoothstep(weatherStreakLen, 0.0, seg);\n float width = 0.04;\n float xMask = smoothstep(width, 0.0, abs(fract(perpAxis * COLS) - center));\n coverage = max(coverage, coverageY * xMask * colBright);\n }\n }\n\n // far layer — COLS=85, tiling=11, brightness=0.5\n {\n float COLS = 85.0;\n float tiling = 11.0;\n float brightness = 0.5;\n float cid = floor(perpAxis * COLS);\n float colHash = hash(float2(cid, 10.0));\n if (colHash < weatherDensity) {\n float phase = hash(float2(cid, 11.0));\n float colBright = brightness * (0.6 + hash(float2(cid, 12.0)) * 0.4);\n float center = 0.5 + (hash(float2(cid, 13.0)) - 0.5) * 0.4;\n float seg = fract(fallAxis * tiling - weatherScrollY + phase);\n float coverageY = smoothstep(weatherStreakLen, 0.0, seg);\n float width = 0.03;\n float xMask = smoothstep(width, 0.0, abs(fract(perpAxis * COLS) - center));\n coverage = max(coverage, coverageY * xMask * colBright);\n }\n }\n\n c = mix(c, half3(weatherColor), half(coverage * weatherIntensity));\n } else if (wk >= 1.5 && wk < 2.5) {\n // sun-shaft\n float rad = weatherDirection * 3.14159 / 180.0;\n float2 srcPoint = float2(0.5 + sin(rad) * 0.3, -0.05);\n float2 toFrag = uv - srcPoint;\n float angle = atan(toFrag.x, toFrag.y);\n float shafts = 0.5 + 0.5 * sin(angle * 8.0);\n float dist = length(toFrag);\n float falloff = 1.0 - smoothstep(0.0, 1.2, dist);\n half shaft = half(shafts * falloff * weatherIntensity * 0.35);\n c = c + half3(shaft * 0.95, shaft * 0.9, shaft * 0.6);\n } else if (wk >= 2.5 && wk < 3.5) {\n // dark-vignette\n float2 uvShift = uv - 0.5;\n float d2 = length(uvShift);\n float vd = smoothstep(0.3, 0.85, d2);\n half dark = half(vd * weatherIntensity);\n c = c * (1.0 - dark);\n } else if (wk >= 3.5) {\n // clouds — rotated scroll, mirrored from WEATHER_CLOUDS_SKSL (direction=0 → horizontal)\n float rad = weatherDirection * 3.14159 / 180.0;\n float2 scrollDir = float2(cos(rad), sin(rad));\n float2 cloudUv = float2(\n uv.x + weatherScrollX * scrollDir.x / resolution.x,\n uv.y * 0.5 + weatherScrollX * scrollDir.y / resolution.y\n );\n float cloud = fbm(cloudUv * 3.0);\n float heightFade = smoothstep(0.6, 0.2, uv.y);\n float alpha = cloud * heightFade * weatherIntensity * 0.5;\n half3 cloudColor = half3(0.9, 0.9, 0.95);\n c = mix(c, cloudColor, half(alpha));\n }\n }\n\n // --- grayscale flash ---\n float lumaFlash = dot(c, half3(0.299, 0.587, 0.114));\n half3 gray = half3(lumaFlash);\n c = mix(c, gray, half(flashIntensity));\n\n // --- vignette ---\n float2 vigCentered = uv - 0.5;\n float vigD = length(vigCentered);\n float vigV = smoothstep(vignetteRadius, vignetteRadius * 0.5, vigD);\n c = mix(half3(vignetteColor), c, half(mix(1.0 - vignetteIntensity, 1.0, vigV)));\n\n return half4(c, 1.0);\n}\n";
295
+ export declare const WEATHER_RAIN_SKSL: string;
296
+ export declare const WEATHER_SUN_SHAFT_SKSL: string;
297
+ export declare const WEATHER_DARK_VIGNETTE_SKSL: string;
298
+ export declare const WEATHER_CLOUDS_SKSL: string;
299
+ export declare const COMPOSITE_SKSL: string;
292
300
  export declare const GOD_RAYS_SKSL = "\nuniform shader src;\nuniform float2 resolution;\nuniform float2 u_lightPos;\nuniform float3 u_color;\nuniform float u_intensity;\nuniform float u_decay;\nuniform float u_density;\nuniform float u_weight;\nuniform float u_samples;\n\nconst int MAX_SAMPLES = 64;\n\nhalf4 main(float2 coord) {\n float2 uv = coord / resolution;\n float2 delta = (u_lightPos - uv) * u_density / float(MAX_SAMPLES);\n float2 sampleUv = uv;\n float illuminationDecay = 1.0;\n half3 accumulated = half3(0.0);\n\n for (int i = 0; i < MAX_SAMPLES; i++) {\n if (float(i) >= u_samples) break;\n sampleUv += delta;\n half3 s = src.eval(sampleUv * resolution).rgb;\n accumulated += s * half(illuminationDecay) * half(u_weight);\n illuminationDecay *= u_decay;\n }\n\n half4 orig = src.eval(coord);\n half3 rays = accumulated * half3(u_color) * half(u_weight) * half(u_intensity);\n return half4(orig.rgb + rays, orig.a);\n}\n";
293
301
  export type { BloomUniforms, ChromaticAberrationUniforms, ColorGradingLutUniforms, CompiledPass, CompiledShader, CompositeUniforms, CrtUniforms, Effect, EffectKind, EffectUniforms, GodRaysUniforms, GrayscaleFlashUniforms, PostFxController, PostFxControllerOptions, PostFxFlashConfig, PostFxRuntime, SkImageLike, SkiaPostFxModuleLike, SkiaRuntimeEffectFactory, SkiaRuntimeEffectLike, VignetteUniforms, WeatherCloudsUniforms, WeatherDarkVignetteUniforms, WeatherRainUniforms, WeatherSunShaftUniforms };
294
302
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/runtime.ts","../src/effect.ts","../src/chain.ts","../src/controller.ts","../src/lut.ts","../src/shaders.ts"],"mappings":";;;;;;;;;;;UA6BiB;WACN;;UAMM;EACf,uBAAuB,UAAU,yBAAyB;;EAE1D;;UAGe;EACf,KAAK,eAAe;;UAGL;EACf,eAAe;;UAGA;EACf,MAAM;EACN,QAAQ;;UAGO;;WAEN;;EAET,QAAQ,MAAM,aAAa;;EAE3B,aAAa,QAAQ,QAAQ,eAAe,iBAAiB;;EAE7D,UAAU,OAAO,aAAa,eAAe,iBAAiB;;EAE9D;;UAGe;EACf;EACA,MAAM;EACN,QAAQ;EACR,UAAU;;;;;;;;;;;;;EAaV,mBAAmB;;;;;;;wBAuBL,oBACd,MAAM,6BACN;EAAS;IACR;KCrGS;UAcK;EACf;E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EAWlC,KAAK,YAAY;EASjB;;EAKC,WAAW,iBAAiB;;UC5Fd;;WAEN;;WAEA;;UAGM;;WAEN,kBAAkB;;WAElB,OAAO;;WAEP,QAAQ;;UAGF;WACN,OAAO;WACP,SAAS;;EAElB;;;;;;;EAOA,aAAa,kBAAkB;;EAE/B,OAAO;;EAEP,UAAU,eAAe,0BAA0B;;;;;EAKnD,eAAe;;wBAKD,uBAAuB,SAAS,0BAA0B;wBCvD1D,yBAAyB;;;;;;;;;;;qBCS5B;qBAiBA;qBAaA;qBAgBA;qBAqBA;qBAiBA;qBA+BA;qBAuEA;qBAqBA;qBAeA;qBA8DA;qBA0KA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/runtime.ts","../src/effect.ts","../src/chain.ts","../src/controller.ts","../src/lut.ts","../src/shaders.ts"],"mappings":";;;;;;;;;;;UA6BiB;WACN;;UAMM;EACf,uBAAuB,UAAU,yBAAyB;;EAE1D;;UAGe;EACf,KAAK,eAAe;;UAGL;EACf,eAAe;;UAGA;EACf,MAAM;EACN,QAAQ;;UAGO;;WAEN;;EAET,QAAQ,MAAM,aAAa;;EAE3B,aAAa,QAAQ,QAAQ,eAAe,iBAAiB;;;;;;;;;;EAU7D,UAAU,OAAO,aAAa,eAAe,iBAAiB;;EAE9D;;UAGe;EACf;EACA,MAAM;EACN,QAAQ;EACR,UAAU;;;;;;;;;;;;;EAaV,mBAAmB;;;;;;;wBAuBL,oBACd,MAAM,6BACN;EAAS;IACR;KC7GS;UAcK;EACf;EACA;EACA;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,KAAK;EACL;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;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