rawSurfaceOf

The canvas like surfaceOf, but always measured against the whole canvas, never a fitted box.

rawSurfaceOf(params: GpuFragmentParams): {uv: Expr; viewport: Expr; aspect: Expr}

Import frames from shaders/std and use frames.rawSurfaceOf.

Use it when a pattern should stay anchored to the canvas as the layer is resized.

Parameters

NameTypeNotes
paramsGpuFragmentParams

Example

const {delta, dist} = centredFrame({center: p('center')})(params, rawSurfaceOf(params))

See also

  • surfaceOf — The canvas a generator paints on: its uv, its viewport size in pixels and its aspect.

Used by

Blob