---
title: "silhouette"
description: "The shape's coverage at this pixel: 1 inside, 0 outside, soft across the edge."
group: "light"
groupTitle: "Noise, light & materials"
categoryId: "materials"
categorySlug: "materials"
categoryTitle: "Materials & surfaces"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/paint/materials.ts#L714"
---

# silhouette

The shape's coverage at this pixel: 1 inside, 0 outside, soft across the edge.

```ts
silhouette(field: SurfaceField, edgeSoftness: Expr): Expr
```

Import `materials` from `shaders/std` and use `materials.silhouette`.

`edgeSoftness` is the softness prop; at 0 the edge is still anti-aliased over 1.5 pixels. Use it as the alpha of the color you return.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `field` | `SurfaceField` |  |
| `edgeSoftness` | `Expr` |  |

## Example

```ts
return guarded(insideShape(field.sdf, field.pxH), vec4(rgb, silhouette(field, u.edgeSoftness)), vec4(0, 0, 0, 0))
```

## See also

- [`insideShape`](/docs/primitives/materials/insideshape) — True inside the shape and up to two pixels outside it.
- [`guarded`](/docs/primitives/materials/guarded) — Evaluates an expression only where a condition holds, and a cheap fallback everywhere else.

## Used by

[BrushedMetal](/docs/components/brushedmetal), [CarbonFiber](/docs/components/carbonfiber), [Chrome](/docs/components/chrome), [Frost](/docs/components/frost), [Holographic](/docs/components/holographic), [Irradiance](/docs/components/irradiance), [LiquidMetal](/docs/components/liquidmetal), [Nebula](/docs/components/nebula), [Obsidian](/docs/components/obsidian), [Plastic](/docs/components/plastic), [Water](/docs/components/water)