Skip to main content

PrincipledMaterial3D

Struct PrincipledMaterial3D 

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

Complete 1:1 Blender 4.x/5.x Principled BSDF material supporting glTF 2.0 core and all KHR PBR extensions.

Implementations§

Source§

impl PrincipledMaterial3D

Conversion and GPU packing helpers for PrincipledMaterial3D.

Source

pub fn dielectric_f0(&self) -> f32

Computes the dielectric F0 derived from self.ior.

§Arguments
  • &Self - Principled material reference.
§Returns
  • f32 - Dielectric Fresnel F0 scalar.
Source

pub fn to_legacy_pbr(&self) -> PbrMaterial

Projects this Principled BSDF material down to a compact legacy PbrMaterial for existing CPU fast paths.

§Arguments
  • &Self - Principled material reference.
§Returns
  • PbrMaterial - Legacy scalar PBR summary.
Source

pub fn from_legacy_pbr(name: &str, legacy: PbrMaterial) -> Self

Lifts a legacy scalar PbrMaterial into a PrincipledMaterial3D.

§Arguments
  • &str - Assigned material name.
  • PbrMaterial - Source legacy PBR material.
§Returns
  • Self - Equivalent PrincipledMaterial3D.
Source

pub fn to_gpu_data(&self) -> GpuMaterialData3D

Packs this material into a 160-byte std140 GpuMaterialData3D ready for GPU storage buffer upload.

§Arguments
  • &Self - Principled material reference.
§Returns
  • GpuMaterialData3D - GPU-aligned 160-byte material block.
Source§

impl PrincipledMaterial3D

Source

pub fn get_name(&self) -> &String

Source

pub fn get_mut_name(&mut self) -> &mut String

Source

pub fn set_name(&mut self, val: String) -> &mut Self

Source

pub fn get_base_color_factor(&self) -> [f32; 4]

Source

pub fn get_mut_base_color_factor(&mut self) -> &mut [f32; 4]

Source

pub fn set_base_color_factor(&mut self, val: [f32; 4]) -> &mut Self

Source

pub fn get_base_color_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_base_color_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_base_color_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_base_color_texture( &mut self, val: Option<TextureSlot3D>, ) -> &mut Self

Source

pub fn get_metallic_factor(&self) -> f32

Source

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

Source

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

Source

pub fn get_roughness_factor(&self) -> f32

Source

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

Source

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

Source

pub fn get_metallic_roughness_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_metallic_roughness_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_metallic_roughness_texture( &mut self, ) -> &mut Option<TextureSlot3D>

Source

pub fn set_metallic_roughness_texture( &mut self, val: Option<TextureSlot3D>, ) -> &mut Self

Source

pub fn get_normal_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_normal_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_normal_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_normal_texture(&mut self, val: Option<TextureSlot3D>) -> &mut Self

Source

pub fn get_normal_scale(&self) -> f32

Source

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

Source

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

Source

pub fn get_occlusion_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_occlusion_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_occlusion_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_occlusion_texture(&mut self, val: Option<TextureSlot3D>) -> &mut Self

Source

pub fn get_occlusion_strength(&self) -> f32

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_emissive_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_emissive_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_emissive_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_emissive_texture(&mut self, val: Option<TextureSlot3D>) -> &mut Self

Source

pub fn get_emissive_strength(&self) -> f32

Source

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

Source

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

Source

pub fn get_alpha_mode(&self) -> AlphaMode3D

Source

pub fn get_mut_alpha_mode(&mut self) -> &mut AlphaMode3D

Source

pub fn set_alpha_mode(&mut self, val: AlphaMode3D) -> &mut Self

Source

pub fn get_alpha_cutoff(&self) -> f32

Source

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

Source

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

Source

pub fn get_double_sided(&self) -> bool

Source

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

Source

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

Source

pub fn get_unlit(&self) -> bool

Source

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

Source

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

Source

pub fn get_ior(&self) -> f32

Source

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

Source

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

Source

pub fn get_specular_factor(&self) -> f32

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_specular_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_specular_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_specular_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_specular_texture(&mut self, val: Option<TextureSlot3D>) -> &mut Self

Source

pub fn get_specular_color_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_specular_color_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_specular_color_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_specular_color_texture( &mut self, val: Option<TextureSlot3D>, ) -> &mut Self

Source

pub fn get_clearcoat_factor(&self) -> f32

Source

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

Source

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

Source

pub fn get_clearcoat_roughness_factor(&self) -> f32

Source

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

Source

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

Source

pub fn get_clearcoat_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_clearcoat_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_clearcoat_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_clearcoat_texture(&mut self, val: Option<TextureSlot3D>) -> &mut Self

Source

pub fn get_clearcoat_roughness_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_clearcoat_roughness_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_clearcoat_roughness_texture( &mut self, ) -> &mut Option<TextureSlot3D>

Source

pub fn set_clearcoat_roughness_texture( &mut self, val: Option<TextureSlot3D>, ) -> &mut Self

Source

pub fn get_clearcoat_normal_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_clearcoat_normal_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_clearcoat_normal_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_clearcoat_normal_texture( &mut self, val: Option<TextureSlot3D>, ) -> &mut Self

Source

pub fn get_transmission_factor(&self) -> f32

Source

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

Source

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

Source

pub fn get_transmission_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_transmission_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_transmission_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_transmission_texture( &mut self, val: Option<TextureSlot3D>, ) -> &mut Self

Source

pub fn get_thickness_factor(&self) -> f32

Source

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

Source

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

Source

pub fn get_attenuation_distance(&self) -> f32

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_sheen_roughness_factor(&self) -> f32

Source

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

Source

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

Source

pub fn get_sheen_color_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_sheen_color_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_sheen_color_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_sheen_color_texture( &mut self, val: Option<TextureSlot3D>, ) -> &mut Self

Source

pub fn get_sheen_roughness_texture(&self) -> Option<TextureSlot3D>

Source

pub fn try_get_sheen_roughness_texture(&self) -> Option<TextureSlot3D>

Source

pub fn get_mut_sheen_roughness_texture(&mut self) -> &mut Option<TextureSlot3D>

Source

pub fn set_sheen_roughness_texture( &mut self, val: Option<TextureSlot3D>, ) -> &mut Self

Trait Implementations§

Source§

impl Clone for PrincipledMaterial3D

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 PrincipledMaterial3D

Source§

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

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

impl Default for PrincipledMaterial3D

Default Blender Principled BSDF dielectric preset for PrincipledMaterial3D.

Source§

fn default() -> Self

Returns the canonical glTF 2.0 / Blender Principled BSDF default material.

§Returns
  • Self - Default PrincipledMaterial3D.
Source§

impl PartialEq for PrincipledMaterial3D

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 PrincipledMaterial3D

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.