Expand description
Runtime behavior for the SdfVolume asset. The authored schema (the
SdfVolume struct, its Default, cone_ratio, and SDF_PARAMS_LEN) lives in
concinnity-asset; this file keeps 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-world (source_args, check::sdf_volume, validate::sdf_volume).
The schema type + SDF_PARAMS_LEN are re-exported so
crate::components::sdf_volume::* paths (the render backends’ uniform structs)
keep resolving.
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
SdfVolumefragment-shader payload.