---
title: "fdCurvature"
description: "The value, slope and curvature of any field at a point: `value`, `dx`, `dy` and `curvature`."
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#L1027"
---

# fdCurvature

The value, slope and curvature of any field at a point: `value`, `dx`, `dy` and `curvature`.

```ts
fdCurvature(sampleAt: (p: Expr) => Expr, p: Expr, eps: number, hint: string = 'fd'): {value: Expr; dx: Expr; dy: Expr; curvature: Expr}
```

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

`fdSlope` with two more taps. The slopes are centred, so they sit on the point rather than half a step past it, and `curvature` is the field's Laplacian: negative on a crest, positive in a crease, zero on a flat or a plane. Scale it by a gain for a cavity shade that darkens creases and lifts crests. `eps` is the tap distance in the point's units.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `sampleAt` | `(p: Expr) => Expr` |  |
| `p` | `Expr` |  |
| `eps` | `number` |  |
| `hint` | `string` | Optional. Default `'fd'`. |

## Example

```ts
const relief = fdCurvature(cloth, q, 0.004)
const cavity = clamp(sub(1, mul(relief.curvature, 0.005)), 0.6, 1.1)
```

> **Tip.** Five taps of the field per pixel. Keep the field cheap.

## See also

- [`fdSlope`](/docs/primitives/materials/fdslope) — The value and slope of any field at a point: `value`, `dx` and `dy`.
- [`nudgeNormal`](/docs/primitives/materials/nudgenormal) — Tilts a normal by a slope in x and y, turning a height field into relief.

## Used by

[Satin](/docs/components/satin)