pub struct DdaEnv<'a> {
pub sky: Option<&'a Sky>,
pub fog_color: u32,
pub fog_max_dist: f32,
pub side_shades: [i8; 6],
pub materials: Option<&'a MaterialTable>,
pub terrain_materials: &'a [(u32, u8)],
}Expand description
Per-frame environment for DDA shading (Substage DDA.5): a textured sky panorama, distance fog, and per-face side shading.
DdaEnv::default disables all three — flat baked-brightness hits
and a caller-pre-filled solid sky — so the brickmap/dense equivalence
tests run against an unchanged pipeline.
Fields§
§sky: Option<&'a Sky>Textured sky sampled per-ray-direction on a miss. None leaves
the destination untouched (caller’s solid sky pre-fill shows).
fog_color: u32Fog target colour (0x__RRGGBB); hits blend toward it with
distance. Typically the sky colour so terrain fades into the sky.
fog_max_dist: f32Depth at which fog is fully opaque. <= 0 disables fog.
side_shades: [i8; 6]Per-face brightness reduction [x-, x+, y-, y+, z-, z+], applied
to the hit face (voxlap setsideshades). All-zero = off.
materials: Option<&'a MaterialTable>TV: global voxel-material palette (id → opacity + blend mode). None
keeps terrain fully opaque (the first-hit path, bit-identical).
terrain_materials: &'a [(u32, u8)]TV: terrain colour→material map ((rgb, material_id)). A hit voxel’s
colour is looked up here for its material. Empty (the default) ⇒
every voxel is opaque, so the march returns the first hit unchanged.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DdaEnv<'a>
impl<'a> RefUnwindSafe for DdaEnv<'a>
impl<'a> Send for DdaEnv<'a>
impl<'a> Sync for DdaEnv<'a>
impl<'a> Unpin for DdaEnv<'a>
impl<'a> UnsafeUnpin for DdaEnv<'a>
impl<'a> UnwindSafe for DdaEnv<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more