Skip to main content

Module validate

Module validate 

Source
Expand description

Named bake-time validators for the data-only assets. Each function clamps or normalizes an asset’s authored value into a self-consistent runtime value. The registry entry names the function via validate: <fn>; the build-side RegisteredType::reserialize_args applies it while baking the blob record. The runtime never runs these – a baked record is already validated.

Functions§

decal
Clamp a Decal’s authored fields into their valid ranges.
joint
Clamp a PhysicsJoint’s authored fields into their valid ranges.
material
Public so the cook-side Material data-resource compiler can apply the same clamps: Material left the component registry, so its generated from_args (the usual caller of this validator) no longer runs – cook must call it explicitly before baking the material into its data_bytes.
point_light
Clamp a PointLight’s authored fields into their valid ranges.
prop
Clamp a Prop’s authored fields into their valid ranges.
sdf_volume
Normalize an authored volume for the runtime: clamp the raymarch knobs to sane bounds, force shadows off for translucent volumetrics (they write no depth), and collapse the per-backend fragment_shaders map to the current backend’s fragment_shader (the DirectX raymarch pass filters volumes by that path’s extension). The step-count bounds stay in core: they double as the runtime kernel’s loop bound.
volumetric_fog
Clamp a VolumetricFog’s authored fields into their valid ranges.
voxel_chunk
Clamp a VoxelChunk’s authored fields into their valid ranges.