# SDFFieldNodes

World-space TSL samplers bound to one generated signed-distance volume.

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

## Import

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

## Declaration

```ts
interface SDFFieldNodes
```

## Members

### `distance`

```ts
distance(worldPosition: TSLVec3Node): TSLFloatNode;
```

Signed distance from a world position to the field surface, in world units.

### `normal`

```ts
normal(worldPosition: TSLVec3Node): TSLVec3Node;
```

Outward field normal at a world position, from a tetrahedral gradient.

### `occlusion`

```ts
occlusion(worldPosition: TSLVec3Node, surfaceNormal: TSLVec3Node, options?: SDFFieldOcclusionOptions): TSLFloatNode;
```

Cone-traced ambient occlusion above a world-space surface point.

### `shadow`

```ts
shadow(worldPosition: TSLVec3Node, lightDirection: TSLVec3Node, options?: SDFFieldShadowOptions): TSLFloatNode;
```

Sphere-traced soft shadow from a world position toward a normalized light direction.

### `update`

```ts
update(): void;
```

Refresh the bound texture and transforms after the source regenerates.

## Related types

[`SDFFieldOcclusionOptions`](/docs/api/SDFFieldOcclusionOptions/) · [`SDFFieldShadowOptions`](/docs/api/SDFFieldShadowOptions/)

## Referenced by

[`sdfFieldNodes`](/docs/api/sdfFieldNodes--case-73-64-66-46-69-65-6c-64-4e-6f-64-65-73/)
