@vysmo/transitions 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/LICENSE +21 -0
- package/README.md +618 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/inputs/normalize.d.ts +2 -0
- package/dist/inputs/normalize.d.ts.map +1 -0
- package/dist/inputs/normalize.js +2 -0
- package/dist/inputs/normalize.js.map +1 -0
- package/dist/runner/gl.d.ts +7 -0
- package/dist/runner/gl.d.ts.map +1 -0
- package/dist/runner/gl.js +59 -0
- package/dist/runner/gl.js.map +1 -0
- package/dist/runner/mesh.d.ts +28 -0
- package/dist/runner/mesh.d.ts.map +1 -0
- package/dist/runner/mesh.js +96 -0
- package/dist/runner/mesh.js.map +1 -0
- package/dist/runner/runner.d.ts +107 -0
- package/dist/runner/runner.d.ts.map +1 -0
- package/dist/runner/runner.js +410 -0
- package/dist/runner/runner.js.map +1 -0
- package/dist/transitions/all.d.ts +9 -0
- package/dist/transitions/all.d.ts.map +1 -0
- package/dist/transitions/all.js +129 -0
- package/dist/transitions/all.js.map +1 -0
- package/dist/transitions/bloom-reveal.d.ts +27 -0
- package/dist/transitions/bloom-reveal.d.ts.map +1 -0
- package/dist/transitions/bloom-reveal.js +106 -0
- package/dist/transitions/bloom-reveal.js.map +1 -0
- package/dist/transitions/chromatic-pulse.d.ts +4 -0
- package/dist/transitions/chromatic-pulse.d.ts.map +1 -0
- package/dist/transitions/chromatic-pulse.js +40 -0
- package/dist/transitions/chromatic-pulse.js.map +1 -0
- package/dist/transitions/clock-wipe.d.ts +6 -0
- package/dist/transitions/clock-wipe.d.ts.map +1 -0
- package/dist/transitions/clock-wipe.js +33 -0
- package/dist/transitions/clock-wipe.js.map +1 -0
- package/dist/transitions/color-phase.d.ts +10 -0
- package/dist/transitions/color-phase.d.ts.map +1 -0
- package/dist/transitions/color-phase.js +24 -0
- package/dist/transitions/color-phase.js.map +1 -0
- package/dist/transitions/colour-distance.d.ts.map +1 -0
- package/dist/transitions/cross-warp.d.ts.map +1 -0
- package/dist/transitions/cross-zoom.d.ts +5 -0
- package/dist/transitions/cross-zoom.d.ts.map +1 -0
- package/dist/transitions/cross-zoom.js +59 -0
- package/dist/transitions/cross-zoom.js.map +1 -0
- package/dist/transitions/crosshatch.d.ts +12 -0
- package/dist/transitions/crosshatch.d.ts.map +1 -0
- package/dist/transitions/crosshatch.js +49 -0
- package/dist/transitions/crosshatch.js.map +1 -0
- package/dist/transitions/define.d.ts +35 -0
- package/dist/transitions/define.d.ts.map +1 -0
- package/dist/transitions/define.js +37 -0
- package/dist/transitions/define.js.map +1 -0
- package/dist/transitions/directional-burn.d.ts +14 -0
- package/dist/transitions/directional-burn.d.ts.map +1 -0
- package/dist/transitions/directional-burn.js +67 -0
- package/dist/transitions/directional-burn.js.map +1 -0
- package/dist/transitions/directional-warp.d.ts +12 -0
- package/dist/transitions/directional-warp.d.ts.map +1 -0
- package/dist/transitions/directional-warp.js +46 -0
- package/dist/transitions/directional-warp.js.map +1 -0
- package/dist/transitions/dissolve.d.ts +2 -0
- package/dist/transitions/dissolve.d.ts.map +1 -0
- package/dist/transitions/dissolve.js +16 -0
- package/dist/transitions/dissolve.js.map +1 -0
- package/dist/transitions/dreamy-zoom.d.ts +25 -0
- package/dist/transitions/dreamy-zoom.d.ts.map +1 -0
- package/dist/transitions/dreamy-zoom.js +66 -0
- package/dist/transitions/dreamy-zoom.js.map +1 -0
- package/dist/transitions/dreamy.d.ts +8 -0
- package/dist/transitions/dreamy.d.ts.map +1 -0
- package/dist/transitions/dreamy.js +26 -0
- package/dist/transitions/dreamy.js.map +1 -0
- package/dist/transitions/drip-wipe.d.ts +22 -0
- package/dist/transitions/drip-wipe.d.ts.map +1 -0
- package/dist/transitions/drip-wipe.js +109 -0
- package/dist/transitions/drip-wipe.js.map +1 -0
- package/dist/transitions/ember-scatter.d.ts +22 -0
- package/dist/transitions/ember-scatter.d.ts.map +1 -0
- package/dist/transitions/ember-scatter.js +94 -0
- package/dist/transitions/ember-scatter.js.map +1 -0
- package/dist/transitions/film-burn.d.ts +17 -0
- package/dist/transitions/film-burn.d.ts.map +1 -0
- package/dist/transitions/film-burn.js +101 -0
- package/dist/transitions/film-burn.js.map +1 -0
- package/dist/transitions/film-grain.d.ts +24 -0
- package/dist/transitions/film-grain.d.ts.map +1 -0
- package/dist/transitions/film-grain.js +78 -0
- package/dist/transitions/film-grain.js.map +1 -0
- package/dist/transitions/flow-warp.d.ts +20 -0
- package/dist/transitions/flow-warp.d.ts.map +1 -0
- package/dist/transitions/flow-warp.js +51 -0
- package/dist/transitions/flow-warp.js.map +1 -0
- package/dist/transitions/fluid-flow.d.ts +26 -0
- package/dist/transitions/fluid-flow.d.ts.map +1 -0
- package/dist/transitions/fluid-flow.js +94 -0
- package/dist/transitions/fluid-flow.js.map +1 -0
- package/dist/transitions/fly-eye.d.ts.map +1 -0
- package/dist/transitions/fly-eye.js +58 -0
- package/dist/transitions/fly-eye.js.map +1 -0
- package/dist/transitions/glass-shatter.d.ts +25 -0
- package/dist/transitions/glass-shatter.d.ts.map +1 -0
- package/dist/transitions/glass-shatter.js +86 -0
- package/dist/transitions/glass-shatter.js.map +1 -0
- package/dist/transitions/glitch.d.ts +6 -0
- package/dist/transitions/glitch.d.ts.map +1 -0
- package/dist/transitions/glitch.js +59 -0
- package/dist/transitions/glitch.js.map +1 -0
- package/dist/transitions/god-rays-reveal.d.ts +32 -0
- package/dist/transitions/god-rays-reveal.d.ts.map +1 -0
- package/dist/transitions/god-rays-reveal.js +110 -0
- package/dist/transitions/god-rays-reveal.js.map +1 -0
- package/dist/transitions/gravity-pull.d.ts +16 -0
- package/dist/transitions/gravity-pull.d.ts.map +1 -0
- package/dist/transitions/gravity-pull.js +65 -0
- package/dist/transitions/gravity-pull.js.map +1 -0
- package/dist/transitions/grid-reveal.d.ts +12 -0
- package/dist/transitions/grid-reveal.d.ts.map +1 -0
- package/dist/transitions/grid-reveal.js +53 -0
- package/dist/transitions/grid-reveal.js.map +1 -0
- package/dist/transitions/heat-haze.d.ts +13 -0
- package/dist/transitions/heat-haze.d.ts.map +1 -0
- package/dist/transitions/heat-haze.js +51 -0
- package/dist/transitions/heat-haze.js.map +1 -0
- package/dist/transitions/index.d.ts +64 -0
- package/dist/transitions/index.d.ts.map +1 -0
- package/dist/transitions/index.js +63 -0
- package/dist/transitions/index.js.map +1 -0
- package/dist/transitions/ink-bloom.d.ts +15 -0
- package/dist/transitions/ink-bloom.d.ts.map +1 -0
- package/dist/transitions/ink-bloom.js +76 -0
- package/dist/transitions/ink-bloom.js.map +1 -0
- package/dist/transitions/ink-diffuse.d.ts +26 -0
- package/dist/transitions/ink-diffuse.d.ts.map +1 -0
- package/dist/transitions/ink-diffuse.js +90 -0
- package/dist/transitions/ink-diffuse.js.map +1 -0
- package/dist/transitions/iris-zoom.d.ts +13 -0
- package/dist/transitions/iris-zoom.d.ts.map +1 -0
- package/dist/transitions/iris-zoom.js +67 -0
- package/dist/transitions/iris-zoom.js.map +1 -0
- package/dist/transitions/kinetic-bands.d.ts +7 -0
- package/dist/transitions/kinetic-bands.d.ts.map +1 -0
- package/dist/transitions/kinetic-bands.js +58 -0
- package/dist/transitions/kinetic-bands.js.map +1 -0
- package/dist/transitions/lenticular-flip.d.ts +22 -0
- package/dist/transitions/lenticular-flip.d.ts.map +1 -0
- package/dist/transitions/lenticular-flip.js +73 -0
- package/dist/transitions/lenticular-flip.js.map +1 -0
- package/dist/transitions/light-leak.d.ts +7 -0
- package/dist/transitions/light-leak.d.ts.map +1 -0
- package/dist/transitions/light-leak.js +43 -0
- package/dist/transitions/light-leak.js.map +1 -0
- package/dist/transitions/lightning-strike.d.ts +22 -0
- package/dist/transitions/lightning-strike.d.ts.map +1 -0
- package/dist/transitions/lightning-strike.js +90 -0
- package/dist/transitions/lightning-strike.js.map +1 -0
- package/dist/transitions/linear-blur.d.ts +11 -0
- package/dist/transitions/linear-blur.d.ts.map +1 -0
- package/dist/transitions/linear-blur.js +40 -0
- package/dist/transitions/linear-blur.js.map +1 -0
- package/dist/transitions/liquid-chrome.d.ts +22 -0
- package/dist/transitions/liquid-chrome.d.ts.map +1 -0
- package/dist/transitions/liquid-chrome.js +114 -0
- package/dist/transitions/liquid-chrome.js.map +1 -0
- package/dist/transitions/liquid-morph.d.ts +6 -0
- package/dist/transitions/liquid-morph.d.ts.map +1 -0
- package/dist/transitions/liquid-morph.js +50 -0
- package/dist/transitions/liquid-morph.js.map +1 -0
- package/dist/transitions/lumina-melt.d.ts +11 -0
- package/dist/transitions/lumina-melt.d.ts.map +1 -0
- package/dist/transitions/lumina-melt.js +36 -0
- package/dist/transitions/lumina-melt.js.map +1 -0
- package/dist/transitions/mosaic.d.ts +13 -0
- package/dist/transitions/mosaic.d.ts.map +1 -0
- package/dist/transitions/mosaic.js +58 -0
- package/dist/transitions/mosaic.js.map +1 -0
- package/dist/transitions/noise-dissolve.d.ts +5 -0
- package/dist/transitions/noise-dissolve.d.ts.map +1 -0
- package/dist/transitions/noise-dissolve.js +41 -0
- package/dist/transitions/noise-dissolve.js.map +1 -0
- package/dist/transitions/page-curl.d.ts +32 -0
- package/dist/transitions/page-curl.d.ts.map +1 -0
- package/dist/transitions/page-curl.js +165 -0
- package/dist/transitions/page-curl.js.map +1 -0
- package/dist/transitions/paint-bleed.d.ts +12 -0
- package/dist/transitions/paint-bleed.d.ts.map +1 -0
- package/dist/transitions/paint-bleed.js +59 -0
- package/dist/transitions/paint-bleed.js.map +1 -0
- package/dist/transitions/particle-assemble.d.ts +23 -0
- package/dist/transitions/particle-assemble.d.ts.map +1 -0
- package/dist/transitions/particle-assemble.js +65 -0
- package/dist/transitions/particle-assemble.js.map +1 -0
- package/dist/transitions/pinwheel.d.ts +11 -0
- package/dist/transitions/pinwheel.d.ts.map +1 -0
- package/dist/transitions/pinwheel.js +40 -0
- package/dist/transitions/pinwheel.js.map +1 -0
- package/dist/transitions/pixelate.d.ts +4 -0
- package/dist/transitions/pixelate.d.ts.map +1 -0
- package/dist/transitions/pixelate.js +26 -0
- package/dist/transitions/pixelate.js.map +1 -0
- package/dist/transitions/plasma-pulse.d.ts.map +1 -0
- package/dist/transitions/plasma-pulse.js +92 -0
- package/dist/transitions/plasma-pulse.js.map +1 -0
- package/dist/transitions/polka-dots-curtain.d.ts +13 -0
- package/dist/transitions/polka-dots-curtain.d.ts.map +1 -0
- package/dist/transitions/polka-dots-curtain.js +46 -0
- package/dist/transitions/polka-dots-curtain.js.map +1 -0
- package/dist/transitions/polygon-flip.d.ts +27 -0
- package/dist/transitions/polygon-flip.d.ts.map +1 -0
- package/dist/transitions/polygon-flip.js +97 -0
- package/dist/transitions/polygon-flip.js.map +1 -0
- package/dist/transitions/portal-dive.d.ts +18 -0
- package/dist/transitions/portal-dive.d.ts.map +1 -0
- package/dist/transitions/portal-dive.js +83 -0
- package/dist/transitions/portal-dive.js.map +1 -0
- package/dist/transitions/prism-split.d.ts +12 -0
- package/dist/transitions/prism-split.d.ts.map +1 -0
- package/dist/transitions/prism-split.js +52 -0
- package/dist/transitions/prism-split.js.map +1 -0
- package/dist/transitions/push.d.ts +4 -0
- package/dist/transitions/push.d.ts.map +1 -0
- package/dist/transitions/push.js +34 -0
- package/dist/transitions/push.js.map +1 -0
- package/dist/transitions/radial-reveal.d.ts +5 -0
- package/dist/transitions/radial-reveal.d.ts.map +1 -0
- package/dist/transitions/radial-reveal.js +31 -0
- package/dist/transitions/radial-reveal.js.map +1 -0
- package/dist/transitions/ripple-wave.d.ts +24 -0
- package/dist/transitions/ripple-wave.d.ts.map +1 -0
- package/dist/transitions/ripple-wave.js +135 -0
- package/dist/transitions/ripple-wave.js.map +1 -0
- package/dist/transitions/ripple.d.ts +7 -0
- package/dist/transitions/ripple.d.ts.map +1 -0
- package/dist/transitions/ripple.js +43 -0
- package/dist/transitions/ripple.js.map +1 -0
- package/dist/transitions/shape-reveal.d.ts +12 -0
- package/dist/transitions/shape-reveal.d.ts.map +1 -0
- package/dist/transitions/shape-reveal.js +53 -0
- package/dist/transitions/shape-reveal.js.map +1 -0
- package/dist/transitions/shockwave.d.ts +10 -0
- package/dist/transitions/shockwave.d.ts.map +1 -0
- package/dist/transitions/shockwave.js +56 -0
- package/dist/transitions/shockwave.js.map +1 -0
- package/dist/transitions/singularity.d.ts +22 -0
- package/dist/transitions/singularity.d.ts.map +1 -0
- package/dist/transitions/singularity.js +59 -0
- package/dist/transitions/singularity.js.map +1 -0
- package/dist/transitions/slide.d.ts +10 -0
- package/dist/transitions/slide.d.ts.map +1 -0
- package/dist/transitions/slide.js +76 -0
- package/dist/transitions/slide.js.map +1 -0
- package/dist/transitions/smoldering-edge.d.ts +15 -0
- package/dist/transitions/smoldering-edge.d.ts.map +1 -0
- package/dist/transitions/smoldering-edge.js +74 -0
- package/dist/transitions/smoldering-edge.js.map +1 -0
- package/dist/transitions/split.d.ts +14 -0
- package/dist/transitions/split.d.ts.map +1 -0
- package/dist/transitions/split.js +53 -0
- package/dist/transitions/split.js.map +1 -0
- package/dist/transitions/swirl.d.ts +12 -0
- package/dist/transitions/swirl.d.ts.map +1 -0
- package/dist/transitions/swirl.js +42 -0
- package/dist/transitions/swirl.js.map +1 -0
- package/dist/transitions/tangent-motion-blur.d.ts +13 -0
- package/dist/transitions/tangent-motion-blur.d.ts.map +1 -0
- package/dist/transitions/tangent-motion-blur.js +58 -0
- package/dist/transitions/tangent-motion-blur.js.map +1 -0
- package/dist/transitions/tile-scatter.d.ts +22 -0
- package/dist/transitions/tile-scatter.d.ts.map +1 -0
- package/dist/transitions/tile-scatter.js +122 -0
- package/dist/transitions/tile-scatter.js.map +1 -0
- package/dist/transitions/tilt-sweep.d.ts +11 -0
- package/dist/transitions/tilt-sweep.d.ts.map +1 -0
- package/dist/transitions/tilt-sweep.js +31 -0
- package/dist/transitions/tilt-sweep.js.map +1 -0
- package/dist/transitions/warp-zoom.d.ts +7 -0
- package/dist/transitions/warp-zoom.d.ts.map +1 -0
- package/dist/transitions/warp-zoom.js +70 -0
- package/dist/transitions/warp-zoom.js.map +1 -0
- package/dist/transitions/wave-stripes.d.ts +16 -0
- package/dist/transitions/wave-stripes.d.ts.map +1 -0
- package/dist/transitions/wave-stripes.js +55 -0
- package/dist/transitions/wave-stripes.js.map +1 -0
- package/dist/transitions/wave-wipe.d.ts +23 -0
- package/dist/transitions/wave-wipe.d.ts.map +1 -0
- package/dist/transitions/wave-wipe.js +84 -0
- package/dist/transitions/wave-wipe.js.map +1 -0
- package/dist/transitions/wind.d.ts +9 -0
- package/dist/transitions/wind.d.ts.map +1 -0
- package/dist/transitions/wind.js +48 -0
- package/dist/transitions/wind.js.map +1 -0
- package/dist/transitions/window-slice.d.ts +11 -0
- package/dist/transitions/window-slice.d.ts.map +1 -0
- package/dist/transitions/window-slice.js +34 -0
- package/dist/transitions/window-slice.js.map +1 -0
- package/dist/transitions/wipe-directional.d.ts +5 -0
- package/dist/transitions/wipe-directional.d.ts.map +1 -0
- package/dist/transitions/wipe-directional.js +26 -0
- package/dist/transitions/wipe-directional.js.map +1 -0
- package/dist/types.d.ts +78 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +56 -0
- package/src/__tests__/__screenshots__/endpoint-correctness.test.ts/endpoint-correctness---every-transition-must-be-pixel-pure-from-to-at-progress-0-1-rippleWave-at-progress-0-is-pure--from--1.png +0 -0
- package/src/__tests__/__screenshots__/endpoint-correctness.test.ts/endpoint-correctness---every-transition-must-be-pixel-pure-from-to-at-progress-0-1-rippleWave-at-progress-1-is-pure--to--1.png +0 -0
- package/src/__tests__/endpoint-correctness.test.ts +161 -0
- package/src/__tests__/readme.test.ts +39 -0
- package/src/__tests__/ssr.test.ts +45 -0
- package/src/index.ts +75 -0
- package/src/inputs/normalize.ts +1 -0
- package/src/runner/__tests__/__screenshots__/mesh.test.ts/buildSubdividedPlane-centroid-is-shared-across-a-face-and-equals-mean-of-its-3-positions-1.png +0 -0
- package/src/runner/__tests__/__screenshots__/mesh.test.ts/buildSubdividedPlane-uv-matches-aPosition---0-5---0-5-1.png +0 -0
- package/src/runner/__tests__/mesh.test.ts +128 -0
- package/src/runner/gl.ts +69 -0
- package/src/runner/mesh.ts +135 -0
- package/src/runner/runner.ts +528 -0
- package/src/transitions/all.ts +131 -0
- package/src/transitions/bloom-reveal.ts +106 -0
- package/src/transitions/chromatic-pulse.ts +40 -0
- package/src/transitions/clock-wipe.ts +33 -0
- package/src/transitions/color-phase.ts +24 -0
- package/src/transitions/cross-zoom.ts +59 -0
- package/src/transitions/crosshatch.ts +49 -0
- package/src/transitions/define.ts +56 -0
- package/src/transitions/directional-burn.ts +67 -0
- package/src/transitions/directional-warp.ts +46 -0
- package/src/transitions/dissolve.ts +16 -0
- package/src/transitions/dreamy-zoom.ts +66 -0
- package/src/transitions/dreamy.ts +26 -0
- package/src/transitions/drip-wipe.ts +109 -0
- package/src/transitions/ember-scatter.ts +94 -0
- package/src/transitions/film-burn.ts +101 -0
- package/src/transitions/film-grain.ts +78 -0
- package/src/transitions/flow-warp.ts +51 -0
- package/src/transitions/fluid-flow.ts +94 -0
- package/src/transitions/glass-shatter.ts +86 -0
- package/src/transitions/glitch.ts +59 -0
- package/src/transitions/god-rays-reveal.ts +110 -0
- package/src/transitions/gravity-pull.ts +65 -0
- package/src/transitions/grid-reveal.ts +53 -0
- package/src/transitions/heat-haze.ts +51 -0
- package/src/transitions/index.ts +63 -0
- package/src/transitions/ink-bloom.ts +76 -0
- package/src/transitions/ink-diffuse.ts +90 -0
- package/src/transitions/iris-zoom.ts +67 -0
- package/src/transitions/kinetic-bands.ts +58 -0
- package/src/transitions/lenticular-flip.ts +73 -0
- package/src/transitions/light-leak.ts +43 -0
- package/src/transitions/linear-blur.ts +40 -0
- package/src/transitions/liquid-chrome.ts +114 -0
- package/src/transitions/liquid-morph.ts +50 -0
- package/src/transitions/lumina-melt.ts +36 -0
- package/src/transitions/mosaic.ts +58 -0
- package/src/transitions/noise-dissolve.ts +41 -0
- package/src/transitions/page-curl.ts +165 -0
- package/src/transitions/paint-bleed.ts +59 -0
- package/src/transitions/pinwheel.ts +40 -0
- package/src/transitions/pixelate.ts +26 -0
- package/src/transitions/polka-dots-curtain.ts +46 -0
- package/src/transitions/polygon-flip.ts +97 -0
- package/src/transitions/portal-dive.ts +83 -0
- package/src/transitions/prism-split.ts +52 -0
- package/src/transitions/push.ts +34 -0
- package/src/transitions/radial-reveal.ts +31 -0
- package/src/transitions/ripple-wave.ts +135 -0
- package/src/transitions/ripple.ts +43 -0
- package/src/transitions/shape-reveal.ts +53 -0
- package/src/transitions/shockwave.ts +56 -0
- package/src/transitions/singularity.ts +59 -0
- package/src/transitions/slide.ts +76 -0
- package/src/transitions/smoldering-edge.ts +74 -0
- package/src/transitions/split.ts +53 -0
- package/src/transitions/swirl.ts +42 -0
- package/src/transitions/tangent-motion-blur.ts +58 -0
- package/src/transitions/tile-scatter.ts +122 -0
- package/src/transitions/warp-zoom.ts +70 -0
- package/src/transitions/wave-stripes.ts +55 -0
- package/src/transitions/wind.ts +48 -0
- package/src/transitions/wipe-directional.ts +26 -0
- package/src/types.ts +87 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineTransition } from "./define.js";
|
|
2
|
+
/**
|
|
3
|
+
* Filmic dissolve. Everything that modulates the image is gated by a
|
|
4
|
+
* 4·p·(1-p) peak envelope so endpoints are pixel-pure from/to.
|
|
5
|
+
*
|
|
6
|
+
* At peak, the image picks up:
|
|
7
|
+
* - multi-scale animated grain (fine + medium + coarse), reseeded
|
|
8
|
+
* in discrete progress frames so scrubbing flickers like a
|
|
9
|
+
* projector
|
|
10
|
+
* - partial desaturation (content drifts toward luminance)
|
|
11
|
+
* - subtle warm tint (R up, B down)
|
|
12
|
+
* - a soft corner vignette
|
|
13
|
+
* - occasional dark vertical scratches on ~2% of columns, reseeded
|
|
14
|
+
* every couple of frames
|
|
15
|
+
*
|
|
16
|
+
* Base crossfade is a soft smoothstep(0.25, 0.75) so from and to
|
|
17
|
+
* overlap through the grainy middle — the grain is what carries the
|
|
18
|
+
* hand-off, rather than a geometric wipe with film on top.
|
|
19
|
+
*
|
|
20
|
+
* One param: grain (master intensity of the whole film character).
|
|
21
|
+
*/
|
|
22
|
+
export const filmGrain = defineTransition({
|
|
23
|
+
name: "film-grain",
|
|
24
|
+
defaults: {
|
|
25
|
+
grain: 1.0,
|
|
26
|
+
},
|
|
27
|
+
glsl: `
|
|
28
|
+
uniform float uGrain;
|
|
29
|
+
|
|
30
|
+
float hash21(vec2 p) {
|
|
31
|
+
return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
vec4 transition(vec2 uv) {
|
|
35
|
+
vec3 fromC = getFromColor(uv).rgb;
|
|
36
|
+
vec3 toC = getToColor(uv).rgb;
|
|
37
|
+
vec3 base = mix(fromC, toC, smoothstep(0.25, 0.75, uProgress));
|
|
38
|
+
|
|
39
|
+
// Peak envelope — zero at both endpoints, 1 at mid.
|
|
40
|
+
float peak = 4.0 * uProgress * (1.0 - uProgress) * uGrain;
|
|
41
|
+
|
|
42
|
+
// Partial desaturation toward luminance (old film is less vivid).
|
|
43
|
+
float lum = dot(base, vec3(0.299, 0.587, 0.114));
|
|
44
|
+
base = mix(base, vec3(lum), peak * 0.25);
|
|
45
|
+
|
|
46
|
+
// Warm tint: subtle R boost + B drop at peak. Still multiplicative
|
|
47
|
+
// on content (no synthetic colour introduced from nothing).
|
|
48
|
+
base *= mix(vec3(1.0), vec3(1.08, 1.00, 0.88), peak * 0.6);
|
|
49
|
+
|
|
50
|
+
// Stepped seed → scrubbing reads as projector flicker between
|
|
51
|
+
// a handful of discrete grain "frames" across the transition.
|
|
52
|
+
float frame = floor(uProgress * 22.0);
|
|
53
|
+
|
|
54
|
+
// Multi-scale grain. Fine texture + medium clumps + occasional
|
|
55
|
+
// coarse blotches — reads as film-stock rather than digital noise.
|
|
56
|
+
float g = 0.0;
|
|
57
|
+
g += (hash21(uv * 520.0 + vec2(frame, 0.0)) - 0.5) * 0.6;
|
|
58
|
+
g += (hash21(uv * 130.0 + vec2(0.0, frame)) - 0.5) * 0.3;
|
|
59
|
+
g += (hash21(uv * 32.0 + vec2(frame, frame)) - 0.5) * 0.18;
|
|
60
|
+
base += vec3(g) * peak * 0.55;
|
|
61
|
+
|
|
62
|
+
// Vertical scratches on ~2% of columns, reseeded every two frames.
|
|
63
|
+
float scratchCol = floor(uv.x * 220.0);
|
|
64
|
+
float scratchSeed = floor(frame * 0.5);
|
|
65
|
+
float scratchHash = hash21(vec2(scratchCol, scratchSeed));
|
|
66
|
+
float isScratch = step(0.98, scratchHash);
|
|
67
|
+
base *= mix(1.0, 0.32, isScratch * peak);
|
|
68
|
+
|
|
69
|
+
// Soft corner vignette at peak only — old projector look.
|
|
70
|
+
float d = distance(uv, vec2(0.5));
|
|
71
|
+
float vignette = 1.0 - smoothstep(0.35, 0.9, d);
|
|
72
|
+
base *= mix(1.0, 0.65 + 0.35 * vignette, peak * 0.8);
|
|
73
|
+
|
|
74
|
+
return vec4(base, 1.0);
|
|
75
|
+
}
|
|
76
|
+
`,
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=film-grain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"film-grain.js","sourceRoot":"","sources":["../../src/transitions/film-grain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE;QACR,KAAK,EAAE,GAAG;KACX;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDP;CACA,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Faithful port of akella demo6 (the "planetary" transition). Reads a
|
|
3
|
+
* displacement-map texture supplied via `RenderArgs.displacement` to drive
|
|
4
|
+
* a per-pixel UV offset vector. From-image is displaced in the direction
|
|
5
|
+
* `rotate(angle1) * dispVec * progress`; to-image is displaced in the
|
|
6
|
+
* direction `rotate(angle2) * dispVec * (1-progress)`. The two opposing
|
|
7
|
+
* angles produce the signature dual-flow akella aesthetic.
|
|
8
|
+
*
|
|
9
|
+
* The displacement is interpreted as centered: mid-gray (0.5) maps to
|
|
10
|
+
* zero offset; channel-r drives the x-component, channel-g the y. This
|
|
11
|
+
* differs from akella's raw [0,1] convention so the runner's default
|
|
12
|
+
* mid-gray fallback degrades to a clean crossfade when no displacement
|
|
13
|
+
* is supplied.
|
|
14
|
+
*/
|
|
15
|
+
export declare const flowWarp: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
|
|
16
|
+
readonly intensity: 0.4;
|
|
17
|
+
readonly angle1: 0.7853982;
|
|
18
|
+
readonly angle2: -2.3561945;
|
|
19
|
+
}>>;
|
|
20
|
+
//# sourceMappingURL=flow-warp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-warp.d.ts","sourceRoot":"","sources":["../../src/transitions/flow-warp.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ;;;;GAkCnB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineTransition } from "./define.js";
|
|
2
|
+
/**
|
|
3
|
+
* Faithful port of akella demo6 (the "planetary" transition). Reads a
|
|
4
|
+
* displacement-map texture supplied via `RenderArgs.displacement` to drive
|
|
5
|
+
* a per-pixel UV offset vector. From-image is displaced in the direction
|
|
6
|
+
* `rotate(angle1) * dispVec * progress`; to-image is displaced in the
|
|
7
|
+
* direction `rotate(angle2) * dispVec * (1-progress)`. The two opposing
|
|
8
|
+
* angles produce the signature dual-flow akella aesthetic.
|
|
9
|
+
*
|
|
10
|
+
* The displacement is interpreted as centered: mid-gray (0.5) maps to
|
|
11
|
+
* zero offset; channel-r drives the x-component, channel-g the y. This
|
|
12
|
+
* differs from akella's raw [0,1] convention so the runner's default
|
|
13
|
+
* mid-gray fallback degrades to a clean crossfade when no displacement
|
|
14
|
+
* is supplied.
|
|
15
|
+
*/
|
|
16
|
+
export const flowWarp = defineTransition({
|
|
17
|
+
name: "flow-warp",
|
|
18
|
+
defaults: {
|
|
19
|
+
intensity: 0.4,
|
|
20
|
+
angle1: 0.7853982,
|
|
21
|
+
angle2: -2.3561945,
|
|
22
|
+
},
|
|
23
|
+
glsl: `
|
|
24
|
+
uniform float uIntensity;
|
|
25
|
+
uniform float uAngle1;
|
|
26
|
+
uniform float uAngle2;
|
|
27
|
+
|
|
28
|
+
mat2 rotate2d(float a) {
|
|
29
|
+
float s = sin(a);
|
|
30
|
+
float c = cos(a);
|
|
31
|
+
return mat2(c, -s, s, c);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Out-of-range UVs use the runner-prologue mirrorUv() so displacement
|
|
35
|
+
// reads as mirrored continuation rather than streaked edge texels.
|
|
36
|
+
vec4 transition(vec2 uv) {
|
|
37
|
+
vec4 disp = getDisplacement(uv);
|
|
38
|
+
// Centered convention: mid-gray = no displacement, range [-1, 1].
|
|
39
|
+
vec2 dispVec = (disp.rg - 0.5) * 2.0;
|
|
40
|
+
|
|
41
|
+
vec2 distorted1 = uv + rotate2d(uAngle1) * dispVec * uIntensity * uProgress;
|
|
42
|
+
vec2 distorted2 = uv + rotate2d(uAngle2) * dispVec * uIntensity * (1.0 - uProgress);
|
|
43
|
+
|
|
44
|
+
vec4 t1 = getFromColor(mirrorUv(distorted1));
|
|
45
|
+
vec4 t2 = getToColor(mirrorUv(distorted2));
|
|
46
|
+
|
|
47
|
+
return mix(t1, t2, uProgress);
|
|
48
|
+
}
|
|
49
|
+
`,
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=flow-warp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-warp.js","sourceRoot":"","sources":["../../src/transitions/flow-warp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE;QACR,SAAS,EAAE,GAAG;QACd,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,CAAC,SAAS;KACnB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BP;CACA,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-pass pixel advection. The from-image is progressively carried
|
|
3
|
+
* along a swirly vector field, then blended toward to. Each pass
|
|
4
|
+
* samples uPrevious at a displaced position — pixels genuinely move
|
|
5
|
+
* (follow flow lines across iterations) rather than fading in place,
|
|
6
|
+
* so the character is closer to ink-stirring-into-water than any
|
|
7
|
+
* crossfade. Impossible single-pass: resolving a multi-step flow
|
|
8
|
+
* trajectory requires reading previous pass output.
|
|
9
|
+
*
|
|
10
|
+
* pass 0 — seed: sample from.
|
|
11
|
+
* pass 1..passCount-2 — advection: sample uPrevious at uv - flow·step,
|
|
12
|
+
* and blend toward to by a per-pass amount
|
|
13
|
+
* chosen so the compounded blend reaches
|
|
14
|
+
* progress after all advection passes.
|
|
15
|
+
* final pass — pass-through (output previous).
|
|
16
|
+
*
|
|
17
|
+
* Endpoints: at progress 0, step = 0 and per-pass blend = 0, so the
|
|
18
|
+
* chain preserves from. At progress 1, the per-pass blend = 1 so the
|
|
19
|
+
* first advection pass already writes to, and every subsequent pass
|
|
20
|
+
* preserves it (advecting a uniform field is a fixed point).
|
|
21
|
+
*/
|
|
22
|
+
export declare const fluidFlow: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
|
|
23
|
+
readonly strength: 0.12;
|
|
24
|
+
readonly scale: 3;
|
|
25
|
+
}>>;
|
|
26
|
+
//# sourceMappingURL=fluid-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluid-flow.d.ts","sourceRoot":"","sources":["../../src/transitions/fluid-flow.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS;;;GAsEpB,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { defineTransition } from "./define.js";
|
|
2
|
+
/**
|
|
3
|
+
* Multi-pass pixel advection. The from-image is progressively carried
|
|
4
|
+
* along a swirly vector field, then blended toward to. Each pass
|
|
5
|
+
* samples uPrevious at a displaced position — pixels genuinely move
|
|
6
|
+
* (follow flow lines across iterations) rather than fading in place,
|
|
7
|
+
* so the character is closer to ink-stirring-into-water than any
|
|
8
|
+
* crossfade. Impossible single-pass: resolving a multi-step flow
|
|
9
|
+
* trajectory requires reading previous pass output.
|
|
10
|
+
*
|
|
11
|
+
* pass 0 — seed: sample from.
|
|
12
|
+
* pass 1..passCount-2 — advection: sample uPrevious at uv - flow·step,
|
|
13
|
+
* and blend toward to by a per-pass amount
|
|
14
|
+
* chosen so the compounded blend reaches
|
|
15
|
+
* progress after all advection passes.
|
|
16
|
+
* final pass — pass-through (output previous).
|
|
17
|
+
*
|
|
18
|
+
* Endpoints: at progress 0, step = 0 and per-pass blend = 0, so the
|
|
19
|
+
* chain preserves from. At progress 1, the per-pass blend = 1 so the
|
|
20
|
+
* first advection pass already writes to, and every subsequent pass
|
|
21
|
+
* preserves it (advecting a uniform field is a fixed point).
|
|
22
|
+
*/
|
|
23
|
+
export const fluidFlow = defineTransition({
|
|
24
|
+
name: "fluid-flow",
|
|
25
|
+
passes: 6,
|
|
26
|
+
defaults: {
|
|
27
|
+
strength: 0.12,
|
|
28
|
+
scale: 3,
|
|
29
|
+
},
|
|
30
|
+
glsl: `
|
|
31
|
+
uniform float uStrength;
|
|
32
|
+
uniform float uScale;
|
|
33
|
+
|
|
34
|
+
float hash21(vec2 p) {
|
|
35
|
+
return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
float valNoise(vec2 p) {
|
|
39
|
+
vec2 i = floor(p);
|
|
40
|
+
vec2 f = fract(p);
|
|
41
|
+
f = f * f * (3.0 - 2.0 * f);
|
|
42
|
+
float a = hash21(i);
|
|
43
|
+
float b = hash21(i + vec2(1.0, 0.0));
|
|
44
|
+
float c = hash21(i + vec2(0.0, 1.0));
|
|
45
|
+
float d = hash21(i + vec2(1.0, 1.0));
|
|
46
|
+
return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
float fbm(vec2 p) {
|
|
50
|
+
return valNoise(p) * 0.55 +
|
|
51
|
+
valNoise(p * 2.1) * 0.28 +
|
|
52
|
+
valNoise(p * 4.3) * 0.17;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Swirly 2D vector field in [-1,1]² per axis. Two offset fbm fields
|
|
56
|
+
// give a non-divergence-free flow that still reads as fluid swirl.
|
|
57
|
+
vec2 flowField(vec2 p) {
|
|
58
|
+
return vec2(
|
|
59
|
+
fbm(p) * 2.0 - 1.0,
|
|
60
|
+
fbm(p + vec2(17.3, 23.7)) * 2.0 - 1.0
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
vec4 transition(vec2 uv) {
|
|
65
|
+
// Final pass: pass through the accumulated result.
|
|
66
|
+
if (uPass == uPassCount - 1) {
|
|
67
|
+
return getPrevious(uv);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Seed pass: carry the from image in untouched.
|
|
71
|
+
if (uPass == 0) {
|
|
72
|
+
return vec4(getFromColor(uv).rgb, 1.0);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
float nAdvect = float(uPassCount - 2);
|
|
76
|
+
vec2 flow = flowField(uv * uScale);
|
|
77
|
+
float stepAmount = uStrength * uProgress / nAdvect;
|
|
78
|
+
|
|
79
|
+
// Sample previous at the advected position — pixels flow along the
|
|
80
|
+
// field. Clamp keeps samples in-bounds when the flow pushes near
|
|
81
|
+
// the frame edge.
|
|
82
|
+
vec2 advectedUv = clamp(uv - flow * stepAmount, 0.0, 1.0);
|
|
83
|
+
vec3 advected = getPrevious(advectedUv).rgb;
|
|
84
|
+
|
|
85
|
+
// Per-pass blend chosen so (1 - blend)^N = 1 - progress, i.e. after
|
|
86
|
+
// nAdvect passes the compounded blend exactly equals progress.
|
|
87
|
+
float perPassBlend = 1.0 - pow(1.0 - uProgress, 1.0 / nAdvect);
|
|
88
|
+
|
|
89
|
+
vec3 blended = mix(advected, getToColor(uv).rgb, perPassBlend);
|
|
90
|
+
return vec4(blended, 1.0);
|
|
91
|
+
}
|
|
92
|
+
`,
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=fluid-flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluid-flow.js","sourceRoot":"","sources":["../../src/transitions/fluid-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE;QACR,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,CAAC;KACT;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DP;CACA,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fly-eye.d.ts","sourceRoot":"","sources":["../../src/transitions/fly-eye.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM;;;;GA+CjB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineTransition } from "./define.js";
|
|
2
|
+
/**
|
|
3
|
+
* Compound-eye lens effect: the frame fragments into tiles that grow from
|
|
4
|
+
* pixel-sized (endpoints) to large (midpoint) where each tile shows a
|
|
5
|
+
* centered sample. Per-tile staggered transitions avoid the freeze that a
|
|
6
|
+
* symmetric tile envelope + centered crossfade would otherwise produce —
|
|
7
|
+
* at any progress the image has tiles at every transition stage. A soft
|
|
8
|
+
* per-tile vignette gives it a lens feel without ever going fully dark.
|
|
9
|
+
*/
|
|
10
|
+
export const flyEye = defineTransition({
|
|
11
|
+
name: "fly-eye",
|
|
12
|
+
defaults: {
|
|
13
|
+
size: 22,
|
|
14
|
+
vignette: 0.35,
|
|
15
|
+
stagger: 0.5,
|
|
16
|
+
},
|
|
17
|
+
glsl: `
|
|
18
|
+
uniform float uSize;
|
|
19
|
+
uniform float uVignette;
|
|
20
|
+
uniform float uStagger;
|
|
21
|
+
|
|
22
|
+
float hash21(vec2 p) {
|
|
23
|
+
return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
vec4 transition(vec2 uv) {
|
|
27
|
+
float env = 4.0 * uProgress * (1.0 - uProgress);
|
|
28
|
+
|
|
29
|
+
// Cell count slides between per-pixel (no quantization at endpoints) and
|
|
30
|
+
// uSize tiles (large lenses at midpoint).
|
|
31
|
+
float maxRes = max(uResolution.x, uResolution.y);
|
|
32
|
+
float cellCount = mix(maxRes, max(uSize, 2.0), env);
|
|
33
|
+
|
|
34
|
+
vec2 pixel = uv * uResolution;
|
|
35
|
+
vec2 tileSize = uResolution / cellCount;
|
|
36
|
+
vec2 tileIdx = floor(pixel / tileSize);
|
|
37
|
+
vec2 tileCenter = (tileIdx + 0.5) * tileSize / uResolution;
|
|
38
|
+
vec2 sampleUv = mix(uv, tileCenter, env);
|
|
39
|
+
|
|
40
|
+
// Per-tile transition start times — breaks the freeze that a symmetric
|
|
41
|
+
// tile envelope + centered crossfade would create. At any given moment
|
|
42
|
+
// some tiles are mid-fade, some are fully from, some fully to.
|
|
43
|
+
float priority = hash21(tileIdx);
|
|
44
|
+
float start = priority * uStagger;
|
|
45
|
+
float localP = clamp((uProgress - start) / max(1.0 - uStagger, 0.0001), 0.0, 1.0);
|
|
46
|
+
|
|
47
|
+
// Per-tile vignette bounded away from zero so corners never go black.
|
|
48
|
+
vec2 withinTile = fract(pixel / tileSize) - 0.5;
|
|
49
|
+
float tileDist = length(withinTile);
|
|
50
|
+
float vignette = mix(1.0 - uVignette, 1.0, 1.0 - smoothstep(0.25, 0.5, tileDist));
|
|
51
|
+
float vEff = mix(1.0, vignette, env);
|
|
52
|
+
|
|
53
|
+
vec4 color = mix(getFromColor(sampleUv), getToColor(sampleUv), localP);
|
|
54
|
+
return vec4(color.rgb * vEff, color.a);
|
|
55
|
+
}
|
|
56
|
+
`,
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=fly-eye.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fly-eye.js","sourceRoot":"","sources":["../../src/transitions/fly-eye.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,CAAC;IACrC,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,GAAG;KACb;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCP;CACA,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voronoi tessellation where each cell flips from from to to at its own
|
|
3
|
+
* randomised moment, with a soft temporal window so the flip isn't an
|
|
4
|
+
* instant step. Every pixel samples both source images at its own uv —
|
|
5
|
+
* no per-shard displacement — so adjacent cells never diverge into
|
|
6
|
+
* different sample positions and the Voronoi edges resolve cleanly
|
|
7
|
+
* without halos or ghost outlines.
|
|
8
|
+
*
|
|
9
|
+
* Optional env-map glint (reflection > 0): each shard gets a random
|
|
10
|
+
* "facet direction" which picks a different patch of the env map, and
|
|
11
|
+
* that reflection blends in strongest at the shard's own mid-flip
|
|
12
|
+
* moment — reads as broken mirror catching the light as each piece
|
|
13
|
+
* rotates through, not a coloured tile. Defaults to 0 (no reflection)
|
|
14
|
+
* so the transition is unchanged without an env map.
|
|
15
|
+
*
|
|
16
|
+
* Endpoints: each cell's flip moment is constrained to [flipWindow/2,
|
|
17
|
+
* 1 - flipWindow/2] with a small safety margin, so at progress 0/1 the
|
|
18
|
+
* smoothstep is saturated off/on for every cell AND the mid-flip
|
|
19
|
+
* glint envelope is zero for every cell.
|
|
20
|
+
*/
|
|
21
|
+
export declare const glassShatter: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
|
|
22
|
+
readonly cells: 14;
|
|
23
|
+
readonly reflection: 0;
|
|
24
|
+
}>>;
|
|
25
|
+
//# sourceMappingURL=glass-shatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glass-shatter.d.ts","sourceRoot":"","sources":["../../src/transitions/glass-shatter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY;;;GA+DvB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineTransition } from "./define.js";
|
|
2
|
+
/**
|
|
3
|
+
* Voronoi tessellation where each cell flips from from to to at its own
|
|
4
|
+
* randomised moment, with a soft temporal window so the flip isn't an
|
|
5
|
+
* instant step. Every pixel samples both source images at its own uv —
|
|
6
|
+
* no per-shard displacement — so adjacent cells never diverge into
|
|
7
|
+
* different sample positions and the Voronoi edges resolve cleanly
|
|
8
|
+
* without halos or ghost outlines.
|
|
9
|
+
*
|
|
10
|
+
* Optional env-map glint (reflection > 0): each shard gets a random
|
|
11
|
+
* "facet direction" which picks a different patch of the env map, and
|
|
12
|
+
* that reflection blends in strongest at the shard's own mid-flip
|
|
13
|
+
* moment — reads as broken mirror catching the light as each piece
|
|
14
|
+
* rotates through, not a coloured tile. Defaults to 0 (no reflection)
|
|
15
|
+
* so the transition is unchanged without an env map.
|
|
16
|
+
*
|
|
17
|
+
* Endpoints: each cell's flip moment is constrained to [flipWindow/2,
|
|
18
|
+
* 1 - flipWindow/2] with a small safety margin, so at progress 0/1 the
|
|
19
|
+
* smoothstep is saturated off/on for every cell AND the mid-flip
|
|
20
|
+
* glint envelope is zero for every cell.
|
|
21
|
+
*/
|
|
22
|
+
export const glassShatter = defineTransition({
|
|
23
|
+
name: "glass-shatter",
|
|
24
|
+
defaults: {
|
|
25
|
+
cells: 14,
|
|
26
|
+
reflection: 0.0,
|
|
27
|
+
},
|
|
28
|
+
glsl: `
|
|
29
|
+
uniform float uCells;
|
|
30
|
+
uniform float uReflection;
|
|
31
|
+
const float uFlipWindow = 0.12;
|
|
32
|
+
|
|
33
|
+
float hash21(vec2 p) {
|
|
34
|
+
return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
|
|
35
|
+
}
|
|
36
|
+
vec2 hash22(vec2 p) {
|
|
37
|
+
return vec2(hash21(p), hash21(p + vec2(17.5, 31.3)));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
vec4 transition(vec2 uv) {
|
|
41
|
+
float aspect = uResolution.x / uResolution.y;
|
|
42
|
+
vec2 freq = vec2(uCells * aspect, uCells);
|
|
43
|
+
vec2 p = uv * freq;
|
|
44
|
+
vec2 cellBase = floor(p);
|
|
45
|
+
vec2 local = fract(p);
|
|
46
|
+
|
|
47
|
+
// 3x3 neighbourhood search for the closest cell (Voronoi).
|
|
48
|
+
float dist1 = 999.0;
|
|
49
|
+
vec2 id1 = cellBase;
|
|
50
|
+
for (int j = -1; j <= 1; j++) {
|
|
51
|
+
for (int i = -1; i <= 1; i++) {
|
|
52
|
+
vec2 nId = cellBase + vec2(float(i), float(j));
|
|
53
|
+
vec2 jitter = hash22(nId);
|
|
54
|
+
vec2 nPos = vec2(float(i), float(j)) + jitter;
|
|
55
|
+
float d = length(nPos - local);
|
|
56
|
+
if (d < dist1) {
|
|
57
|
+
dist1 = d;
|
|
58
|
+
id1 = nId;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Keep cell flip moments away from 0 and 1 with enough headroom for
|
|
64
|
+
// the window, plus a tiny safety margin so endpoints saturate cleanly.
|
|
65
|
+
float halfWin = uFlipWindow * 0.5;
|
|
66
|
+
float cellFlip = mix(halfWin + 0.02, 1.0 - halfWin - 0.02, hash21(id1 + vec2(0.31)));
|
|
67
|
+
|
|
68
|
+
float reveal = smoothstep(cellFlip - halfWin, cellFlip + halfWin, uProgress);
|
|
69
|
+
vec4 baseColor = mix(getFromColor(uv), getToColor(uv), reveal);
|
|
70
|
+
|
|
71
|
+
// Per-shard mirror glint: each shard has its own facet direction, and
|
|
72
|
+
// its reflection of the env map peaks at reveal=0.5 (the moment the
|
|
73
|
+
// shard flips). Reveal=0 or 1 → glintEnv=0, so endpoints stay clean.
|
|
74
|
+
if (uReflection > 0.0) {
|
|
75
|
+
vec2 facetDir = normalize(hash22(id1 + vec2(0.83)) * 2.0 - 1.0);
|
|
76
|
+
vec2 envUv = vec2(0.5 + 0.5 * facetDir.x, 0.5 - 0.5 * facetDir.y);
|
|
77
|
+
vec3 envColor = getEnvironment(envUv).rgb;
|
|
78
|
+
float glintEnv = 4.0 * reveal * (1.0 - reveal);
|
|
79
|
+
baseColor.rgb = mix(baseColor.rgb, envColor, glintEnv * uReflection);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return baseColor;
|
|
83
|
+
}
|
|
84
|
+
`,
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=glass-shatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glass-shatter.js","sourceRoot":"","sources":["../../src/transitions/glass-shatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;IAC3C,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,GAAG;KAChB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDP;CACA,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glitch.d.ts","sourceRoot":"","sources":["../../src/transitions/glitch.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;GAwDjB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { defineTransition } from "./define.js";
|
|
2
|
+
export const glitch = defineTransition({
|
|
3
|
+
name: "glitch",
|
|
4
|
+
defaults: {
|
|
5
|
+
intensity: 0.6,
|
|
6
|
+
chroma: 0.02,
|
|
7
|
+
blocks: 30,
|
|
8
|
+
},
|
|
9
|
+
glsl: `
|
|
10
|
+
uniform float uIntensity;
|
|
11
|
+
uniform float uChroma;
|
|
12
|
+
uniform float uBlocks;
|
|
13
|
+
|
|
14
|
+
float hash11(float n) { return fract(sin(n * 12.9898) * 43758.5453); }
|
|
15
|
+
float hash21(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }
|
|
16
|
+
|
|
17
|
+
vec4 transition(vec2 uv) {
|
|
18
|
+
// Envelope: ramps up to max at midpoint, zero at endpoints.
|
|
19
|
+
float envelope = 4.0 * uProgress * (1.0 - uProgress);
|
|
20
|
+
float glitchAmt = uIntensity * envelope;
|
|
21
|
+
|
|
22
|
+
// Per-stripe horizontal displacement; stripe layout evolves over time.
|
|
23
|
+
float stripeId = floor(uv.y * uBlocks);
|
|
24
|
+
float timeStep = floor(uProgress * 24.0);
|
|
25
|
+
float stripeSeed = hash21(vec2(stripeId, timeStep));
|
|
26
|
+
float displaceActive = step(0.6, stripeSeed);
|
|
27
|
+
float displaceAmount = (hash11(stripeSeed + 1.0) - 0.5) * 0.12 * glitchAmt * displaceActive;
|
|
28
|
+
|
|
29
|
+
vec2 displacedUv = vec2(uv.x + displaceAmount, uv.y);
|
|
30
|
+
vec2 clamped = clamp(displacedUv, 0.0, 1.0);
|
|
31
|
+
|
|
32
|
+
// RGB channel split scales with glitch amount. chroma is the per-channel
|
|
33
|
+
// UV offset multiplier — capped at 0.05; past that, R/B samples come from
|
|
34
|
+
// unrelated parts of the scene and edge-clamping creates color stripes
|
|
35
|
+
// instead of reading as glitch chromatic aberration.
|
|
36
|
+
float chromaOffset = glitchAmt * min(uChroma, 0.05);
|
|
37
|
+
vec2 offR = clamp(displacedUv + vec2(chromaOffset, 0.0), 0.0, 1.0);
|
|
38
|
+
vec2 offB = clamp(displacedUv - vec2(chromaOffset, 0.0), 0.0, 1.0);
|
|
39
|
+
|
|
40
|
+
vec3 fromRgb = vec3(
|
|
41
|
+
getFromColor(offR).r,
|
|
42
|
+
getFromColor(clamped).g,
|
|
43
|
+
getFromColor(offB).b
|
|
44
|
+
);
|
|
45
|
+
vec3 toRgb = vec3(
|
|
46
|
+
getToColor(offR).r,
|
|
47
|
+
getToColor(clamped).g,
|
|
48
|
+
getToColor(offB).b
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Hard-ish crossover concentrated in the middle 20% for a "cut" feel.
|
|
52
|
+
float mixW = smoothstep(0.45, 0.55, uProgress);
|
|
53
|
+
vec3 rgb = mix(fromRgb, toRgb, mixW);
|
|
54
|
+
|
|
55
|
+
return vec4(rgb, 1.0);
|
|
56
|
+
}
|
|
57
|
+
`,
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=glitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glitch.js","sourceRoot":"","sources":["../../src/transitions/glitch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,CAAC;IACrC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,SAAS,EAAE,GAAG;QACd,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,EAAE;KACX;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDP;CACA,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-pass transition. As to reveals through a noise mask, its
|
|
3
|
+
* bright highlights emit volumetric-looking light shafts toward a
|
|
4
|
+
* source point, built up by iterative radial blur — each pass samples
|
|
5
|
+
* from the previous pass's output at progressively finer steps along
|
|
6
|
+
* the ray from every pixel to the source. Impossible single-pass: a
|
|
7
|
+
* full-length radial streak would need ~30 samples across the ray,
|
|
8
|
+
* and after five iterations of 6 samples each, the shafts have
|
|
9
|
+
* progressively-refined spatial frequencies that a one-pass sampling
|
|
10
|
+
* of the source texture cannot produce.
|
|
11
|
+
*
|
|
12
|
+
* pass 0 — seed: to-highlights gated by the reveal
|
|
13
|
+
* mask AND a 4·p·(1-p) envelope.
|
|
14
|
+
* pass 1..passCount-2 — iterative radial blur. Pass i samples 6
|
|
15
|
+
* points along uv→source at step = 1/(5 · 2^(i-1)),
|
|
16
|
+
* reading from uPrevious so the shafts
|
|
17
|
+
* accumulate across passes.
|
|
18
|
+
* final pass — composite = mix(from, to, mask) +
|
|
19
|
+
* rays * intensity.
|
|
20
|
+
*
|
|
21
|
+
* Endpoints: seed envelope is 0 at progress 0 and 1, so the blur
|
|
22
|
+
* chain carries zeros and the composite resolves to pure from/to.
|
|
23
|
+
*/
|
|
24
|
+
export declare const godRaysReveal: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
|
|
25
|
+
readonly scale: 5;
|
|
26
|
+
readonly softness: 0.08;
|
|
27
|
+
readonly threshold: 0.45;
|
|
28
|
+
readonly intensity: 1.6;
|
|
29
|
+
readonly decay: 0.92;
|
|
30
|
+
readonly source: readonly [0.5, 0.5];
|
|
31
|
+
}>>;
|
|
32
|
+
//# sourceMappingURL=god-rays-reveal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"god-rays-reveal.d.ts","sourceRoot":"","sources":["../../src/transitions/god-rays-reveal.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa;;;;;;;GAoFxB,CAAC"}
|