Skip to main content

PbrMaterial

Struct PbrMaterial 

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

Physically based metallic-roughness material parameters for 3D surfaces.

Implementations§

Source§

impl PbrMaterial

Material presets and fluent builders for metallic conductors, dielectrics, architectural glass, and neon signage.

Source

pub fn pbr( color: Color, metallic: f32, roughness: f32, reflectivity: f32, ) -> Self

Creates a PBR material from an sRGB Color, metallic, roughness, and reflectivity.

§Arguments
  • Color - Base albedo color.
  • f32 - Metallic scalar [0.0, 1.0].
  • f32 - Roughness scalar [0.04, 1.0].
  • f32 - Ray-traced reflectivity weight [0.0, 1.0].
§Returns
  • Self - Configured PBR material.
Source

pub fn metallic(color: Color, roughness: f32) -> Self

Creates a metallic conductor PBR material (chrome, painted car body, brushed steel).

§Arguments
  • Color - Base metallic reflectance color.
  • f32 - Surface roughness in [0.04, 1.0].
§Returns
  • Self - Conductor PBR material.
Source

pub fn dielectric(color: Color, roughness: f32) -> Self

Creates a non-metallic dielectric PBR material (asphalt, concrete, matte plastic, cloth).

§Arguments
  • Color - Base diffuse albedo color.
  • f32 - Surface roughness in [0.04, 1.0].
§Returns
  • Self - Dielectric PBR material.
Source

pub fn glass(color: Color, roughness: f32) -> Self

Creates a highly reflective architectural glass PBR material.

§Arguments
  • Color - Subtle glass tint color.
  • f32 - Surface roughness in [0.04, 0.4].
§Returns
  • Self - Reflective glass PBR material.
Source

pub fn neon(color: Color, intensity: f32) -> Self

Creates an emissive neon PBR material for city signage, vehicle tail-lights, and beacons.

§Arguments
  • Color - Base and emissive neon color.
  • f32 - Emissive intensity multiplier.
§Returns
  • Self - Emissive PBR material.
Source

pub fn with_emissive(self, emissive: Vec3) -> Self

Returns a copy of this material with custom linear HDR emissive radiance.

§Arguments
  • Self - Base material.
  • Vec3 - Emissive HDR RGB radiance.
§Returns
  • Self - Updated material.
Source

pub fn with_roughness(self, roughness: f32) -> Self

Returns a copy of this material with adjusted surface roughness.

§Arguments
  • Self - Base material.
  • f32 - Surface roughness clamped to [0.04, 1.0].
§Returns
  • Self - Updated material.
Source

pub fn with_metallic(self, metallic: f32) -> Self

Returns a copy of this material with adjusted metallic factor.

§Arguments
  • Self - Base material.
  • f32 - Metallic factor clamped to [0.0, 1.0].
§Returns
  • Self - Updated material.
Source

pub fn with_reflectivity(self, reflectivity: f32) -> Self

Returns a copy of this material with adjusted ray-traced reflectivity.

§Arguments
  • Self - Base material.
  • f32 - Reflectivity weight clamped to [0.0, 1.0].
§Returns
  • Self - Updated material.
Source

pub fn with_surface_detail(self, mode: SurfaceDetailMode) -> Self

Returns a copy of this material with the requested procedural surface detail overlay.

§Arguments
  • Self - Base material.
  • SurfaceDetailMode - Procedural surface detail mode.
§Returns
  • Self - Updated material.
Source§

impl PbrMaterial

Source

pub fn get_base_color(&self) -> Vec3

Source

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

Source

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

Source

pub fn get_metallic(&self) -> f32

Source

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

Source

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

Source

pub fn get_roughness(&self) -> f32

Source

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

Source

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

Source

pub fn get_emissive(&self) -> Vec3

Source

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

Source

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

Source

pub fn get_reflectivity(&self) -> f32

Source

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

Source

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

Source

pub fn get_surface_detail(&self) -> SurfaceDetailMode

Source

pub fn get_mut_surface_detail(&mut self) -> &mut SurfaceDetailMode

Source

pub fn set_surface_detail(&mut self, val: SurfaceDetailMode) -> &mut Self

Trait Implementations§

Source§

impl Clone for PbrMaterial

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 PbrMaterial

Source§

impl Debug for PbrMaterial

Source§

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

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

impl Default for PbrMaterial

Default neutral matte PBR material.

Source§

fn default() -> Self

Returns a mid-gray dielectric PBR material.

§Returns
  • Self - Default PbrMaterial.
Source§

impl PartialEq for PbrMaterial

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 PbrMaterial

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.