MotionScript

@motion-script/core


@motion-script/core / SkSLEffect

Interface: SkSLEffect

Defined in: attributes/shape/effects/implementations/sksl.ts:28

Custom SkSL effect, classified by the shared EffectMode:

  • 'backdrop': The shader receives uniform shader u_backdrop (a snapshot of the canvas content beneath the node). Use this for magnification, distortion, ripple, etc. Works identically to the built-in magnify/bulge effects — the result replaces the backdrop within the node's silhouette clip.

  • 'foreground' (the default): The shader is applied as an overlay/modifier on the node's own layer via ImageFilter.MakeShader. The shader generates a colour from uniforms/position and is composited onto the layer using blendMode (default Screen). Useful for procedural overlays (noise, gradients, glows).

Extends

Properties

blendMode?

optional blendMode?: "color" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "luminosity" | "normal"

Defined in: attributes/shape/effects/implementations/sksl.ts:39

Blend mode used when mode is 'foreground'. Defaults to 'screen' so the generated shader overlay composites additively onto the layer. Ignored for 'backdrop', where the shader's output replaces the backdrop.


mode?

optional mode?: EffectMode

Defined in: attributes/shape/effects/effect-data.ts:83

Inherited from

ModedEffect.mode


shader

shader: string

Defined in: attributes/shape/effects/implementations/sksl.ts:31

SkSL shader source code.


type

type: "sksl"

Defined in: attributes/shape/effects/implementations/sksl.ts:29


uniforms

uniforms: SkSLUniform[]

Defined in: attributes/shape/effects/implementations/sksl.ts:33

Uniform values passed to the shader in declaration order. Values lerp component-wise.