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 authoring registry names the function via validate: <fn> and applies it while baking the blob record; a runtime bake applies the same function before installing the value. The runtime never runs these on a loaded world – a baked record is already validated.

Functions§

decal
Clamp a Decal’s authored fields into their valid ranges.
directional_light
Clamp a DirectionalLight’s authored fields into their valid ranges.
glass_panel
Clamp a GlassPanel’s authored fields into their valid ranges.
instanced_prop
Clamp an InstancedProp’s authored fields into their valid ranges.
joint
Clamp a PhysicsJoint’s authored fields into their valid ranges.
material
Clamp a Material’s authored fields into their valid ranges. Material is a data resource, not a registered component, so no generated from_args runs this – the material compilers call it explicitly before baking the bytes.
particle_emitter
Clamp a ParticleEmitter’s authored fields into their valid ranges.
point_light
Clamp a PointLight’s authored fields into their valid ranges.
prop
Clamp a Prop’s authored fields into their valid ranges.
rect_area_light
Clamp a RectAreaLight’s authored fields into their valid ranges.
reflection_probe
Clamp a ReflectionProbe’s authored fields into their valid ranges.
rigid_body
Reset a RigidBody’s runtime state on construction.
sdf_volume
Normalize an authored volume for the runtime: clamp the raymarch knobs to sane bounds and force shadows off for translucent volumetrics, which write no depth to cast from. The step-count bounds stay with the schema: they double as the runtime kernel’s loop bound.
sky_rotation
Replace a SkyRotation’s degenerate axis with the default pole: an axis with no direction would leave the sky in a fixed orientation whatever the rate said.
spot_light
Clamp a SpotLight’s authored fields into their valid ranges.
volumetric_fog
Clamp a VolumetricFog’s authored fields into their valid ranges.
voxel_chunk
Clamp a VoxelChunk’s authored fields into their valid ranges.
water_surface
Clamp a WaterSurface’s authored fields into their valid ranges.