# sdfFieldNodes

Bind world-space TSL samplers to a generated signed-distance volume.

The volume is borrowed: the returned samplers read the generator's current
texture and transforms, and [`SDFFieldNodes.update`](/docs/api/SDFFieldNodes/) re-reads both after a
regeneration. The field is static in world space, so a source whose geometry
was captured in object space must be regenerated when that object moves.

Distances are stored in world units, so every option below is world-space too.
Reconstruction is a manual trilinear `textureLoad` because r32float volumes are
not filterable on adapters without `float32-filterable`.

[SDF and raymarching](/docs/blocks/sdf-raymarching/)

## Import

```ts
import { sdfFieldNodes } from "three-blocks/sdf-raymarching";
```

## Used in the gallery

- [Splat to solid](/examples/webgpu_points_bvh_volume/source/#L291)

## Declaration

```ts
function sdfFieldNodes(source: SDFFieldNodesSource, options?: SDFFieldNodesOptions): SDFFieldNodes;
```

## Parameters

- `source` — Generated field to sample; must already hold a texture.
- `options` — Sampling budgets and the out-of-volume distance.

## Returns

World-space distance, normal, occlusion, and shadow samplers.

## Related types

[`SDFFieldNodesSource`](/docs/api/SDFFieldNodesSource/) · [`SDFFieldNodesOptions`](/docs/api/SDFFieldNodesOptions/) · [`SDFFieldNodes`](/docs/api/SDFFieldNodes/)
