Skip to main content

AreaLight3D

Struct AreaLight3D 

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

Physically based Blender rectangular or disk area light evaluated with representative-point GGX and horizon-clamped irradiance.

Implementations§

Source§

impl AreaLight3D

Construction and representative-point GGX / LTC-aligned evaluation for AreaLight3D.

Source

pub fn new_rect( position: Vec3, direction: Vec3, color: Vec3, intensity: f32, dimensions: (f32, f32), range: f32, ) -> Self

Constructs a rectangular Blender AreaLight3D oriented along direction.

§Arguments
  • Vec3 - World-space emitter center.
  • Vec3 - Unit emitting normal pointing from emitter into scene.
  • Vec3 - Linear HDR RGB emission color.
  • f32 - Luminous intensity multiplier.
  • (f32, f32) - Aperture (width, height) in meters.
  • f32 - Maximum attenuation cutoff range in meters.
§Returns
  • Self - Configured rectangular area light.
Source

pub fn new_disk( position: Vec3, direction: Vec3, color: Vec3, intensity: f32, diameter: f32, range: f32, ) -> Self

Constructs a disk Blender AreaLight3D oriented along direction.

§Arguments
  • Vec3 - World-space emitter center.
  • Vec3 - Unit emitting normal pointing from emitter into scene.
  • Vec3 - Linear HDR RGB emission color.
  • f32 - Luminous intensity multiplier.
  • f32 - Disk emitter diameter in meters.
  • f32 - Maximum attenuation cutoff range in meters.
§Returns
  • Self - Configured disk area light.
Source

pub fn evaluate_pbr( &self, world_pos: Vec3, normal: Vec3, view_dir: Vec3, material_terms: (Vec3, Vec3, f32, f32), ) -> Vec3

Evaluates physically based diffuse irradiance and Karis representative-point GGX specular contribution for this rectangular or disk area light.

§Arguments
  • &Self - Area light reference.
  • Vec3 - World-space surface shading position.
  • Vec3 - Unit outward surface normal.
  • Vec3 - Unit view direction pointing from surface toward camera.
  • (Vec3, Vec3, f32, f32) - (albedo, f0_specular, perceptual_roughness, diffuse_scale).
§Returns
  • Vec3 - Linear HDR direct radiance contributed by this area light.
Source§

impl AreaLight3D

Source

pub fn get_position(&self) -> Vec3

Source

pub fn get_mut_position(&mut self) -> &mut Vec3

Source

pub fn set_position(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_direction(&self) -> Vec3

Source

pub fn get_mut_direction(&mut self) -> &mut Vec3

Source

pub fn set_direction(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_right(&self) -> Vec3

Source

pub fn get_mut_right(&mut self) -> &mut Vec3

Source

pub fn set_right(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_up(&self) -> Vec3

Source

pub fn get_mut_up(&mut self) -> &mut Vec3

Source

pub fn set_up(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_color(&self) -> Vec3

Source

pub fn get_mut_color(&mut self) -> &mut Vec3

Source

pub fn set_color(&mut self, val: Vec3) -> &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_width(&self) -> f32

Source

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

Source

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

Source

pub fn get_height(&self) -> f32

Source

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

Source

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

Source

pub fn get_range(&self) -> f32

Source

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

Source

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

Source

pub fn get_shape(&self) -> AreaLightShape3D

Source

pub fn get_mut_shape(&mut self) -> &mut AreaLightShape3D

Source

pub fn set_shape(&mut self, val: AreaLightShape3D) -> &mut Self

Source

pub fn get_two_sided(&self) -> bool

Source

pub fn get_mut_two_sided(&mut self) -> &mut bool

Source

pub fn set_two_sided(&mut self, val: bool) -> &mut Self

Trait Implementations§

Source§

impl Clone for AreaLight3D

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 Copy for AreaLight3D

Source§

impl Debug for AreaLight3D

Source§

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

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

impl PartialEq for AreaLight3D

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 AreaLight3D

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.