---
title: "planarReflection"
description: "A mirror floor: the child as it is above a line, and its reflection fading out below it."
group: "effects"
groupTitle: "Filters & effects"
categoryId: "effects.blurs"
categorySlug: "effects-blurs"
categoryTitle: "Blurs, glows & screens"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/effects/blurs.ts#L1598"
---

# planarReflection

A mirror floor: the child as it is above a line, and its reflection fading out below it.

```ts
planarReflection(
  opts: {line: PropRef; distance: PropRef; falloff: PropRef; edges: PropRef},
  original: Expr,
  reflection: (uv: Expr) =,
> Expr, reflectedUV: (params: GpuFragmentParams) => Expr): (params: GpuFragmentParams) => Expr
```

Import `effects` from `shaders/std` and use `effects.blurs.planarReflection`.

`line` (0–1 in uv), `distance` (how far below the line the reflection stays visible, in uv) and `falloff` (the width of the fade as a fraction of `distance`) are props. `edges` is a prop with `transform: transformEdges` and `compileTime: true`. `original` is the child's color at this pixel, `reflection` samples the child (or its blurred copy) at a coordinate, and `reflectedUV` is usually `mirrorAcrossRow(line)`. Returns a fragment function whose result is premultiplied; unpremultiply it before returning from `gpu.fragment`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `opts` | `{line: PropRef; distance: PropRef; falloff: PropRef; edges: PropRef}` |  |
| `original` | `Expr` |  |
| `reflection` | `(uv: Expr) => Expr` |  |
| `reflectedUV` | `(params: GpuFragmentParams) => Expr` |  |

## Example

```ts
planarReflection({line: p('height'), distance: p('distance'), falloff: p('falloff'), edges: p('edges')}, source.sample(ctx.uv), (uv) => blurred.sample(uv), mirrorAcrossRow(p('height')))(params)
```

## See also

- [`mirrorAcrossRow`](/docs/primitives/effects-blurs/mirroracrossrow) — The coordinate mirrored across a horizontal line, for reading a reflection below it.
- [`depthRampBlur`](/docs/primitives/effects-blurs/depthrampblur) — The blur half of a mirror floor: blurs the child more the further a row sits below the line.

## Used by

[ReflectivePlane](/docs/components/reflectiveplane)