Skip to main content

EnvironmentIbl3D

Struct EnvironmentIbl3D 

Source
pub struct EnvironmentIbl3D { /* private fields */ }
Expand description

Precomputed Image-Based Lighting (IBL) bundle combining L2 9-band SH diffuse irradiance, octahedral GGX specular mips, and Kulla-Conty BRDF LUT.

Implementations§

Source§

impl EnvironmentIbl3D

IBL baking and sampling methods for EnvironmentIbl3D.

Source

pub fn from_equirectangular_hdr( hdr: &DecodedHdrImage, oct_size: u32, lut_size: u32, ) -> Self

Bakes an EnvironmentIbl3D from an equirectangular HDR environment image (.hdr / .exr).

§Arguments
  • &DecodedHdrImage - Equirectangular linear HDR image.
  • u32 - Base octahedral specular map resolution (clamped >= 8).
  • u32 - Split-Sum BRDF LUT resolution (clamped >= 8).
§Returns
  • Self - Precomputed diffuse SH + specular octahedral + BRDF LUT environment.
Source

pub fn from_procedural_sky( sun: &DirectionalLight3D, oct_size: u32, lut_size: u32, ) -> Self

Bakes an EnvironmentIbl3D from the analytical sky dome and sun directional light.

§Arguments
  • &DirectionalLight3D - Active directional sun and sky colors.
  • u32 - Base octahedral specular map resolution.
  • u32 - Split-Sum BRDF LUT resolution.
§Returns
  • Self - Precomputed procedural sky IBL environment.
Source

pub fn from_sampler<F>(sampler: F, oct_size: u32, lut_size: u32) -> Self
where F: Fn(Vec3) -> Vec3,

Precomputes SH9 diffuse irradiance, GGX octahedral specular mips, and BRDF LUT from any directional radiance closure.

§Arguments
  • F - Directional radiance callback mapping unit world direction to linear RGB.
  • u32 - Base octahedral specular resolution.
  • u32 - Split-Sum BRDF LUT resolution.
§Returns
  • Self - Precomputed IBL environment.
Source

pub fn evaluate_sh_diffuse(&self, normal: Vec3) -> Vec3

Evaluates L2 9-band Spherical Harmonics diffuse irradiance along world-space normal.

§Arguments
  • &Self - Environment IBL reference.
  • Vec3 - Unit world-space surface normal.
§Returns
  • Vec3 - Linear HDR diffuse irradiance RGB.
Source

pub fn sample_specular_octahedral( &self, reflect_dir: Vec3, roughness: f32, ) -> Vec3

Samples the octahedral prefiltered specular radiance map along reflect_dir at perceptual roughness.

§Arguments
  • &Self - Environment IBL reference.
  • Vec3 - World-space reflection vector.
  • f32 - Perceptual roughness in [0.0, 1.0].
§Returns
  • Vec3 - Trilinearly filtered prefiltered specular HDR radiance RGB.
Source

pub fn sample_brdf_lut(&self, n_dot_v: f32, roughness: f32) -> [f32; 2]

Looks up the bilinearly interpolated Split-Sum BRDF integration entry [scale, bias].

§Arguments
  • &Self - Environment IBL reference.
  • f32 - Clamped view-normal cosine N·V.
  • f32 - Perceptual roughness in [0.0, 1.0].
§Returns
  • [f32; 2] - Integrated [scale, bias] terms.
Source§

impl EnvironmentIbl3D

Source

pub fn get_sh_irradiance(&self) -> [[f32; 3]; 9]

Source

pub fn get_mut_sh_irradiance(&mut self) -> &mut [[f32; 3]; 9]

Source

pub fn set_sh_irradiance(&mut self, val: [[f32; 3]; 9]) -> &mut Self

Source

pub fn get_specular_oct_size(&self) -> u32

Source

pub fn get_mut_specular_oct_size(&mut self) -> &mut u32

Source

pub fn set_specular_oct_size(&mut self, val: u32) -> &mut Self

Source

pub fn get_specular_mips(&self) -> &Vec<Vec<[f32; 3]>>

Source

pub fn get_mut_specular_mips(&mut self) -> &mut Vec<Vec<[f32; 3]>>

Source

pub fn set_specular_mips(&mut self, val: Vec<Vec<[f32; 3]>>) -> &mut Self

Source

pub fn get_brdf_lut_size(&self) -> u32

Source

pub fn get_mut_brdf_lut_size(&mut self) -> &mut u32

Source

pub fn set_brdf_lut_size(&mut self, val: u32) -> &mut Self

Source

pub fn get_brdf_lut(&self) -> &Vec<[f32; 2]>

Source

pub fn get_mut_brdf_lut(&mut self) -> &mut Vec<[f32; 2]>

Source

pub fn set_brdf_lut(&mut self, val: Vec<[f32; 2]>) -> &mut Self

Source

pub fn get_intensity(&self) -> f32

Source

pub fn get_mut_intensity(&mut self) -> &mut f32

Source

pub fn set_intensity(&mut self, val: f32) -> &mut Self

Source

pub fn get_rotation_y_rad(&self) -> f32

Source

pub fn get_mut_rotation_y_rad(&mut self) -> &mut f32

Source

pub fn set_rotation_y_rad(&mut self, val: f32) -> &mut Self

Trait Implementations§

Source§

impl Clone for EnvironmentIbl3D

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EnvironmentIbl3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for EnvironmentIbl3D

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EnvironmentIbl3D

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.