---
title: "crispFill"
description: "A clean fill of a shape: 1 inside, 0 outside."
group: "space"
groupTitle: "Shapes, frames & warps"
categoryId: "mask"
categorySlug: "mask"
categoryTitle: "Masks"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/mask.ts#L86"
---

# crispFill

A clean fill of a shape: 1 inside, 0 outside.

```ts
crispFill(opts: {distance: Expr; footprint: Expr | number}): Expr
```

Import `mask` from `shaders/std` and use `mask.crispFill`.

`distance` is a signed distance, negative inside the shape, such as one from the `shape` words. `footprint` is how wide the edge blends. One pixel in the distance's units gives an anti-aliased edge. A wider value gives a deliberate soft edge.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `opts` | `{distance: Expr; footprint: Expr \| number}` |  |

## Example

```ts
const bar = mask.crispFill({distance: shape.roundedRect(x, y, w, h, rounding), footprint: px})
```

> **Tip.** One pixel in uv is `div(1, viewport.member('y'))`, with `viewport` from `frames.surfaceOf`.

## See also

- [`crispStroke`](/docs/primitives/mask/crispstroke) — A clean outline of a shape, or a drawn curve, of a given width.
- [`softDisc`](/docs/primitives/mask/softdisc) — A filled disc with a soft, shaped edge.

## Used by

[Waveform](/docs/components/waveform)