Skip to main content

Module sdf_volume

Module sdf_volume 

Source
Expand description

The SdfVolume asset: the authored schema (the struct, its Default, cone_ratio, and SDF_PARAMS_LEN), the Component impl, the blob-residency helper the engine init uses, and the runtime step-count clamp bounds. The JSON-args source selection, validation, and the bake-time clamp live in concinnity-cook (authoring::source_args, check::sdf_volume, authoring::validate::sdf_volume).

Structs§

SdfVolume
A raymarched signed-distance-field volume. It occupies a world-space bounding box; a user-authored fragment shader sphere-traces an SDF inside the box, composites correctly with the surrounding scene through the depth buffer, and shades hits with the engine’s lighting helpers.

Constants§

SDF_MAX_STEPS_CEILING
Hard cap on the per-volume cone-march step count. Matches the runtime kernel’s loop bound; values above this are clamped.
SDF_MAX_STEPS_FLOOR
Lower bound on the per-volume cone-march step count. Below this the march doesn’t have enough budget to converge on anything interesting.
SDF_PARAMS_LEN
Per-volume parameter slots packed into a single fixed-size uniform block. The user shader casts the bound buffer to its own typed struct; the engine just transports the bytes. Sized to comfortably fit a flow-water shader (flow speed, wave coefficients, deep + shallow colours, foam params, …) without forcing schema design.

Functions§

sdf_volume_blob_indices
Blob indices that hold an SdfVolume fragment-shader payload.