pub struct IblEnvironment {
pub name: String,
pub irradiance_sh: [Vec3; 9],
pub specular_mips: Vec<(f32, Vec<Vec3>)>,
pub mip_width: u32,
pub mip_height: u32,
pub brdf_lut: Vec<Vec2>,
pub brdf_lut_size: u32,
pub exposure: f32,
pub rotation_y: f32,
}Expand description
Prefiltered environment map for image-based lighting.
Stores irradiance and specular prefiltered maps as spherical harmonic coefficients (irradiance) and mip-level radiance data (specular).
Fields§
§name: String§irradiance_sh: [Vec3; 9]9 SH coefficients for diffuse irradiance (precomputed from env map).
specular_mips: Vec<(f32, Vec<Vec3>)>Prefiltered specular mip levels: each entry is (roughness, [6WH] data).
mip_width: u32§mip_height: u32§brdf_lut: Vec<Vec2>BRDF integration LUT: 2D table of (NdotV, roughness) → (scale, bias).
brdf_lut_size: u32§exposure: f32§rotation_y: f32Implementations§
Source§impl IblEnvironment
impl IblEnvironment
Sourcepub fn grey(name: impl Into<String>, intensity: f32) -> Self
pub fn grey(name: impl Into<String>, intensity: f32) -> Self
Create from a uniform grey environment (good for testing).
Sourcepub fn sky_gradient(sky_color: Vec3, ground_color: Vec3, intensity: f32) -> Self
pub fn sky_gradient(sky_color: Vec3, ground_color: Vec3, intensity: f32) -> Self
Build a simple gradient sky IBL (blue sky + ground).
Sourcepub fn eval_diffuse(&self, normal: Vec3) -> Vec3
pub fn eval_diffuse(&self, normal: Vec3) -> Vec3
Evaluate diffuse irradiance for a given surface normal.
Sourcepub fn eval_brdf_lut(&self, n_dot_v: f32, roughness: f32) -> Vec2
pub fn eval_brdf_lut(&self, n_dot_v: f32, roughness: f32) -> Vec2
Evaluate the BRDF LUT at (n_dot_v, roughness).
Trait Implementations§
Source§impl Clone for IblEnvironment
impl Clone for IblEnvironment
Source§fn clone(&self) -> IblEnvironment
fn clone(&self) -> IblEnvironment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IblEnvironment
impl RefUnwindSafe for IblEnvironment
impl Send for IblEnvironment
impl Sync for IblEnvironment
impl Unpin for IblEnvironment
impl UnsafeUnpin for IblEnvironment
impl UnwindSafe for IblEnvironment
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.