---
title: "crackRefractUV"
description: "Where to sample one color channel so the crack bends the light and splits it like a prism."
group: "effects"
groupTitle: "Filters & effects"
categoryId: "effects.fracture"
categorySlug: "effects-fracture"
categoryTitle: "Fracture"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/effects/fracture.ts#L177"
---

# crackRefractUV

Where to sample one color channel so the crack bends the light and splits it like a prism.

```ts
crackRefractUV(
  displacedUV: v2f,
  edgeNormal: v2f,
  crackIntensity: number,
  refractionStrength: number,
  chromaticSplit: number,
  channel: number,
): v2f
```

Import `effects` from `shaders/std` and use `effects.fracture.crackRefractUV`.

`channel` is 1 for red, 0 for green and -1 for blue; the three samples land slightly apart. `refractionStrength` (0 to 10) bends the sample across the crack and `chromaticSplit` (0 to 5) spreads the channels. Both fade with `crackIntensity`, so unbroken glass is untouched.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `args` | `[displacedUV: v2f, edgeNormal: v2f, crackIntensity: number, refractionStrength: number, chromaticSplit: number, channel: number]` |  |

## Example

```ts
const red = child.sample(call(crackRefractUV, 'crackRefractUV', [geom.member('displacedUV'), geom.member('edgeNormal'), geom.member('crackIntensity'), uniforms.refractionStrength, uniforms.chromaticSplit, floatE(1)]))
```

## See also

- [`crackGeom`](/docs/primitives/effects-fracture/crackgeom) — How much crack there is at a pixel, and which way the shard under it has moved.
- [`crackShardCompose`](/docs/primitives/effects-fracture/crackshardcompose) — The finished glass: the three refracted channels blended into the crack, with a hint of light on tilted shards.

## Used by

[Shatter](/docs/components/shatter)