Installation
Choose your framework. The registry installs one component file and its PixiJS dependency.
Installation unavailable
The preview is public, but its installable release is still being prepared.
The registry command writes the component to src/lib/components/ui/FluidMaskReveal.svelte and installs its dependencies.
The registry command writes the component to src/components/ui/FluidMaskReveal.tsx and installs its dependencies.
The registry command writes the component to src/components/ui/FluidMaskReveal.vue and installs its dependencies.
Overview
Fluid Mask Reveal uses the same curl, vorticity, divergence, pressure, and advection pipeline as Fluid Simulation, with transported dye serving as the reveal mask.
A softly thresholded density field reveals the second fitted image while pointer movement continuously injects motion and mask density.
Basic usage
The shader fills its parent. Your layout decides whether that parent is a card, hero, or viewport.
- Move the pointer across the canvas to reveal the second image.
- The first pointer move establishes history without injecting a jump from the canvas origin.
- Higher pressure iterations and target resolutions improve fidelity but increase GPU work.
Component API
Types below match the selected Svelte component.
Additional classes for the parent-sized root element.
- Type
string
URL or data URL visible outside the fluid mask.
- Type
string- Range / values
Image URL or data URL
URL or data URL exposed by the persistent fluid mask.
- Type
string- Range / values
Image URL or data URL
Controls how the source image is placed inside the canvas.
- Type
"cover" | "fit" | "stretch"- Default
"cover"- Range / values
cover, fit, stretch
Resolution of the short side of the velocity and pressure grid.
- Type
number- Default
256- Range / values
32–256
Resolution of the short side of the transported dye field.
- Type
number- Default
1024- Range / values
128–1024
Dye decay rate used by result / (1 + rate × dt).
- Type
number- Default
1- Range / values
0–4
Velocity decay rate used by result / (1 + rate × dt).
- Type
number- Default
0.05- Range / values
0–4
Pressure retained before the Jacobi solve each physics step.
- Type
number- Default
0.8- Range / values
0–1
Jacobi iterations used to solve pressure each physics step.
- Type
number- Default
1- Range / values
1–40
Strength of vorticity confinement that restores small eddies.
- Type
number- Default
0- Range / values
0–50
Pointer splat radius in the reference's 0.01–1.00 scale.
- Type
number- Default
0.87- Range / values
0.01–1
Multiplier applied to normalized, aspect-corrected pointer deltas.
- Type
number- Default
6000- Range / values
0–10000
Softness of the thresholded fluid reveal boundary.
- Type
number- Default
0.22- Range / values
0.01–0.49
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Enables pointer-driven effects when the shader supports them.
- Type
boolean- Default
true
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
Component public instance- Range / values
pause, resume, reset, resize, destroy
Types below match the selected React component.
Additional classes for the parent-sized root element.
- Type
string
URL or data URL visible outside the fluid mask.
- Type
string- Range / values
Image URL or data URL
URL or data URL exposed by the persistent fluid mask.
- Type
string- Range / values
Image URL or data URL
Controls how the source image is placed inside the canvas.
- Type
"cover" | "fit" | "stretch"- Default
"cover"- Range / values
cover, fit, stretch
Resolution of the short side of the velocity and pressure grid.
- Type
number- Default
256- Range / values
32–256
Resolution of the short side of the transported dye field.
- Type
number- Default
1024- Range / values
128–1024
Dye decay rate used by result / (1 + rate × dt).
- Type
number- Default
1- Range / values
0–4
Velocity decay rate used by result / (1 + rate × dt).
- Type
number- Default
0.05- Range / values
0–4
Pressure retained before the Jacobi solve each physics step.
- Type
number- Default
0.8- Range / values
0–1
Jacobi iterations used to solve pressure each physics step.
- Type
number- Default
1- Range / values
1–40
Strength of vorticity confinement that restores small eddies.
- Type
number- Default
0- Range / values
0–50
Pointer splat radius in the reference's 0.01–1.00 scale.
- Type
number- Default
0.87- Range / values
0.01–1
Multiplier applied to normalized, aspect-corrected pointer deltas.
- Type
number- Default
6000- Range / values
0–10000
Softness of the thresholded fluid reveal boundary.
- Type
number- Default
0.22- Range / values
0.01–0.49
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Enables pointer-driven effects when the shader supports them.
- Type
boolean- Default
true
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
FluidMaskRevealHandle- Range / values
pause, resume, reset, resize, destroy
Types below match the selected Vue component.
Additional classes for the parent-sized root element.
- Type
string
URL or data URL visible outside the fluid mask.
- Type
string- Range / values
Image URL or data URL
URL or data URL exposed by the persistent fluid mask.
- Type
string- Range / values
Image URL or data URL
Controls how the source image is placed inside the canvas.
- Type
"cover" | "fit" | "stretch"- Default
"cover"- Range / values
cover, fit, stretch
Resolution of the short side of the velocity and pressure grid.
- Type
number- Default
256- Range / values
32–256
Resolution of the short side of the transported dye field.
- Type
number- Default
1024- Range / values
128–1024
Dye decay rate used by result / (1 + rate × dt).
- Type
number- Default
1- Range / values
0–4
Velocity decay rate used by result / (1 + rate × dt).
- Type
number- Default
0.05- Range / values
0–4
Pressure retained before the Jacobi solve each physics step.
- Type
number- Default
0.8- Range / values
0–1
Jacobi iterations used to solve pressure each physics step.
- Type
number- Default
1- Range / values
1–40
Strength of vorticity confinement that restores small eddies.
- Type
number- Default
0- Range / values
0–50
Pointer splat radius in the reference's 0.01–1.00 scale.
- Type
number- Default
0.87- Range / values
0.01–1
Multiplier applied to normalized, aspect-corrected pointer deltas.
- Type
number- Default
6000- Range / values
0–10000
Softness of the thresholded fluid reveal boundary.
- Type
number- Default
0.22- Range / values
0.01–0.49
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Enables pointer-driven effects when the shader supports them.
- Type
boolean- Default
true
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
Component public instance- Range / values
pause, resume, reset, resize, destroy