SDF Volumes
Arbitrary shapes from a baked 3D signed distance field.
TidalVolumeSDF defines a
volume of arbitrary shape from a baked 3D signed distance
field. Instead of a primitive, the volume samples an SDFTexture that captures the
exact contour of a mesh - ideal for shapes an
analytic volume cannot describe.
- Shape comes from a baked 3D SDF texture (
SDFTexture). - Optionally framed by an assigned ObjectRenderer.
- Used for hulls and interiors - for example the example submarine's interior.
Baking the SDF
SDF textures are baked with Unity's VFX Graph SDF Bake Tool. The volume inspector guides you through installing the tool and opens it for you, so you can bake the field for a mesh and assign it to the volume.
When to use SDF vs analytic
Use an SDF volume when the shape is arbitrary - boat hulls, ships, submarine interiors, or other irregular geometry. For anything that a cube, sphere, or cylinder can cover, prefer an analytic volume: it needs no bake step and gives exact per-fragment edges.
The example submarine uses an EXCLUDE SDF volume to carve out a walkable, dry interior, with cross-section windows looking back into the surrounding water.