pub struct Volume {
pub thickness: f32,
pub thickness_texture: Option<TextureRef>,
pub attenuation_distance: Option<f32>,
pub attenuation_color: [f32; 3],
}Expand description
KHR_materials_volume parameters: turns the surface from an
infinitely thin wall into the boundary of a homogeneous absorbing
medium. Light travelling through the medium is attenuated towards
attenuation_color over
attenuation_distance. Requires a
manifold mesh and is typically paired with a non-zero
Transmission / MaterialExt::ior.
Fields§
§thickness: f32Thickness of the volume beneath the surface in the mesh’s
coordinate space (thicknessFactor). Default 0.0 —
thin-walled, i.e. the extension has no effect until thickness
is positive. Multiplied by the green channel of
thickness_texture.
thickness_texture: Option<TextureRef>Thickness texture (thicknessTexture), G channel.
attenuation_distance: Option<f32>Average distance light travels in the medium before interacting
with a particle, in world space (attenuationDistance). The
spec default is +Infinity (no absorption); represented here
as None so the special “infinite” case stays distinct from a
finite distance. See effective_attenuation_distance.
attenuation_color: [f32; 3]Colour white light turns into after travelling
attenuation_distance through the
medium (attenuationColor), linear RGB. Default [1,1,1] (no
tint).