Skip to main content

Mix

Struct Mix 

Source
pub struct Mix<B1, B2> {
    pub b1: B1,
    pub b2: B2,
    pub factor: f32,
}
Expand description

BSDF that can blend two arbitrary BSDF’s together

Fields§

§b1: B1§b2: B2§factor: f32

Trait Implementations§

Source§

impl<B1, B2> BSDF for Mix<B1, B2>
where B1: BSDF, B2: BSDF,

Source§

fn evaluate(&self, omega_o: Vec3d, omega_i: Vec3d) -> RgbD

Returns the value of the BSDF at the given directions Read more
Source§

fn emission(&self, omega_o: Vec3d) -> RgbD

Returns how much light is emitted to the given direction omega_o
Source§

fn sample_incoming(&self, omega_o: Vec3d, rdf: Vec3d) -> SampleIncomingResponse

Given a direction where light is scattered to, samples an incident direction, from which the light may come from Read more
Source§

fn sample_outgoing(&self, omega_i: Vec3d, rdf: Vec3d) -> SampleOutgoingResponse

Given an incident light direction, samples a direction where light is scattered to Read more
Source§

fn sample_emission(&self, rd: Vec2d) -> SampleEmissionResponse

Samples a direction in which light is emitted to and also returns the amount of emission The returned vector is the null vector, if this surface does not emit any light See also: SampleEmissionResponse
Source§

fn sample_incoming_pdf(&self, omega_o: Vec3d, omega_i: Vec3d) -> f64

Returns the probability density sampling an incoming direction given an outgoing direction See BSDF::sample_incoming and SampleIncomingResponse
Source§

fn sample_outgoing_pdf(&self, omega_o: Vec3d, omega_i: Vec3d) -> f64

Returns the probability density sampling an outgoing direction given an incoming direction See BSDF::sample_outgoing_pdf and SampleOutgoingResponse
Source§

fn sample_emission_pdf(&self, omega_o: Vec3d) -> f64

Returns the probability density of choosing the given direction when sampled with BSDF::sample_emission Returns 0.0 if the surface does not emit light
Source§

fn base_color(&self, omega_o: Vec3d) -> RgbD

Returns the base color of the surface. This function is used to generate auxiliary images for AI tools such as Open Image Denoise

Auto Trait Implementations§

§

impl<B1, B2> Freeze for Mix<B1, B2>
where B1: Freeze, B2: Freeze,

§

impl<B1, B2> RefUnwindSafe for Mix<B1, B2>

§

impl<B1, B2> Send for Mix<B1, B2>
where B1: Send, B2: Send,

§

impl<B1, B2> Sync for Mix<B1, B2>
where B1: Sync, B2: Sync,

§

impl<B1, B2> Unpin for Mix<B1, B2>
where B1: Unpin, B2: Unpin,

§

impl<B1, B2> UnsafeUnpin for Mix<B1, B2>
where B1: UnsafeUnpin, B2: UnsafeUnpin,

§

impl<B1, B2> UnwindSafe for Mix<B1, B2>
where B1: UnwindSafe, B2: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.