Skip to main content

RtLightKind

Enum RtLightKind 

Source
pub enum RtLightKind {
    Directional {
        direction: Vec3,
        angular_radius_rad: f32,
    },
    Point {
        position: Vec3,
        radius: f32,
    },
    Spot {
        position: Vec3,
        direction: Vec3,
        inner_cos: f32,
        outer_cos: f32,
        radius: f32,
    },
    RectArea {
        position: Vec3,
        right: Vec3,
        up: Vec3,
        normal: Vec3,
        width: f32,
        height: f32,
        two_sided: bool,
    },
    DiskArea {
        position: Vec3,
        right: Vec3,
        up: Vec3,
        normal: Vec3,
        radius: f32,
        two_sided: bool,
    },
}
Expand description

Physical light emitter geometry supported by direct sampling, soft shadows, and MIS.

Variants§

§

Directional

Infinite directional light (sun/moon) with optional cone angular radius for soft penumbrae.

Fields

§direction: Vec3

Unit direction pointing from the scene toward the light source.

§angular_radius_rad: f32

Cone half-angle in radians (0.0 produces crisp shadows; ~0.00465 matches solar disk).

§

Point

Omnidirectional spherical point light with inverse-square falloff and optional emitter radius.

Fields

§position: Vec3

World-space light center.

§radius: f32

Spherical emitter radius in meters (0.0 for delta point light).

§

Spot

Focused cone spotlight with smooth inner-to-outer angular falloff and optional emitter radius.

Fields

§position: Vec3

World-space emitter center.

§direction: Vec3

Unit beam direction pointing away from the emitter.

§inner_cos: f32

Cosine of the inner full-intensity cone half-angle.

§outer_cos: f32

Cosine of the outer cutoff cone half-angle.

§radius: f32

Spherical emitter radius in meters.

§

RectArea

Physically based rectangular area emitter supporting exact uniform surface sampling and MIS.

Fields

§position: Vec3

World-space rectangle center.

§right: Vec3

Unit tangent axis along rectangle width.

§up: Vec3

Unit bitangent axis along rectangle height.

§normal: Vec3

Unit emitting normal direction.

§width: f32

Total rectangle width in meters.

§height: f32

Total rectangle height in meters.

§two_sided: bool

Whether both sides of the rectangle emit radiance.

§

DiskArea

Physically based circular disk area emitter supporting exact uniform disk sampling and MIS.

Fields

§position: Vec3

World-space disk center.

§right: Vec3

Unit tangent axis in the disk plane.

§up: Vec3

Unit bitangent axis in the disk plane.

§normal: Vec3

Unit emitting normal direction.

§radius: f32

Disk radius in meters.

§two_sided: bool

Whether both sides of the disk emit radiance.

Trait Implementations§

Source§

impl Clone for RtLightKind

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 RtLightKind

Source§

impl Debug for RtLightKind

Source§

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

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

impl PartialEq for RtLightKind

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 RtLightKind

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.