mirrorAcrossRow

The coordinate mirrored across a horizontal line, for reading a reflection below it.

mirrorAcrossRow(line: PropRef): (params: GpuFragmentParams) => Expr

Import effects from shaders/std and use effects.blurs.mirrorAcrossRow.

line is a prop, 0–1 down the canvas in uv. Returns a function of the fragment params that gives the mirrored uv. Above the line the coordinate is still mirrored; planarReflection only shows the reflection below it.

Parameters

NameTypeNotes
linePropRef

Example

const reflectedUV = mirrorAcrossRow(p('height'))

See also

  • planarReflection — A mirror floor: the child as it is above a line, and its reflection fading out below it.
  • depthRampBlur — The blur half of a mirror floor: blurs the child more the further a row sits below the line.

Used by

ReflectivePlane