---
title: "crackGeom"
description: "How much crack there is at a pixel, and which way the shard under it has moved."
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#L139"
---

# crackGeom

How much crack there is at a pixel, and which way the shard under it has moved.

```ts
crackGeom(
  uv: v2f,
  nPosX: number,
  nPosY: number,
  sPosX: number,
  sPosY: number,
  dispX: number,
  dispY: number,
  crackWidth: number,
): { crackIntensity: number; edgeNormal: v2f; displacedUV: v2f; disp: v2f; }
```

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

Takes the pixel's uv, the nearest and second-nearest shard positions (x and y, in uv), the nearest shard's displacement (x and y, in uv) and `crackWidth` (about 0.5 to 5). Returns a record with `crackIntensity` (0 to 1, and 0 until the shard has actually moved), `edgeNormal` (the direction across the crack), `displacedUV` (where to sample the layer inside) and `disp` (the displacement again, for `crackShardCompose`).

## Parameters

| Name | Type | Notes |
|---|---|---|
| `args` | `[uv: v2f, nPosX: number, nPosY: number, sPosX: number, sPosY: number, dispX: number, dispY: number, crackWidth: number]` |  |

## Example

```ts
const geom = call(crackGeom, 'crackGeom', [ctx.uv, dataAt(nearest, 0), dataAt(nearest, 1), dataAt(second, 0), dataAt(second, 1), dataAt(nearest, 2), dataAt(nearest, 3), uniforms.crackWidth])
```

## See also

- [`crackRefractUV`](/docs/primitives/effects-fracture/crackrefractuv) — Where to sample one color channel so the crack bends the light and splits it like a prism.
- [`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.
- [`cellLaneUVFor`](/docs/primitives/effects-fracture/celllaneuvfor) — Where one shard's value sits in a one-row data texture.

## Used by

[Shatter](/docs/components/shatter)