---
title: "shadowVisibility"
description: "How much of a light reaches a point, 1 when nothing is in the way and 0 when the shape blocks it."
group: "light"
groupTitle: "Noise, light & materials"
categoryId: "radiance"
categorySlug: "radiance"
categoryTitle: "Radiance"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/paint/radiance.ts#L208"
---

# shadowVisibility

How much of a light reaches a point, 1 when nothing is in the way and 0 when the shape blocks it.

```ts
shadowVisibility(spec: ShadowSpec): Expr
```

Import `radiance` from `shaders/std` and use `radiance.shadowVisibility`.

Casts a ray from `from` toward the light and stops at the shape. Values between 0 and 1 are the soft edge of the shadow, wider with `softness`. Multiply a light's contribution by it.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `spec` | `ShadowSpec` |  |

## Example

```ts
const lit = math.mul(strength, shadowVisibility({from: math.add(edge.point, math.mul(edge.normal, math.mul(px, 2))), toward: light.uv, field: far.at, steps: 12, surfaceEps: px, softness: u.shadowSoftness}))
```

> **Tip.** Start `from` two pixels off the edge along its normal or the point shadows itself.

## See also

- [`gatherIrradiance`](/docs/primitives/radiance/gatherirradiance) — The light arriving at a pixel from a glowing shape edge, with the shape's body blocking it.
- [`irradianceField`](/docs/primitives/radiance/irradiancefield) — The light spilling from a shape's edges, gathered once into a texture and read per pixel.

## Used by

[Irradiance](/docs/components/irradiance)