pub struct MaterialBuilder {
pub material: Material,
}
Expand description
Builder for creating and configuring glTF materials with PBR properties
Fields§
§material: Material
Implementations§
Source§impl MaterialBuilder
impl MaterialBuilder
Sourcepub fn with_base_color(self, color: [f32; 4]) -> Self
pub fn with_base_color(self, color: [f32; 4]) -> Self
Set base color factor
Sourcepub fn with_metallic_factor(self, factor: f32) -> Self
pub fn with_metallic_factor(self, factor: f32) -> Self
Set metallic factor
Sourcepub fn with_roughness_factor(self, factor: f32) -> Self
pub fn with_roughness_factor(self, factor: f32) -> Self
Set roughness factor
Sourcepub fn with_base_color_texture(
self,
texture_index: usize,
tex_coord: Option<usize>,
) -> Self
pub fn with_base_color_texture( self, texture_index: usize, tex_coord: Option<usize>, ) -> Self
Set base color texture
Sourcepub fn with_metallic_roughness_texture(
self,
texture_index: usize,
tex_coord: Option<usize>,
) -> Self
pub fn with_metallic_roughness_texture( self, texture_index: usize, tex_coord: Option<usize>, ) -> Self
Set metallic roughness texture
Sourcepub fn with_normal_texture(
self,
texture_index: usize,
tex_coord: Option<usize>,
scale: Option<f32>,
) -> Self
pub fn with_normal_texture( self, texture_index: usize, tex_coord: Option<usize>, scale: Option<f32>, ) -> Self
Set normal texture
Sourcepub fn with_occlusion_texture(
self,
texture_index: usize,
tex_coord: Option<usize>,
strength: Option<f32>,
) -> Self
pub fn with_occlusion_texture( self, texture_index: usize, tex_coord: Option<usize>, strength: Option<f32>, ) -> Self
Set occlusion texture
Sourcepub fn with_emissive_texture(
self,
texture_index: usize,
tex_coord: Option<usize>,
) -> Self
pub fn with_emissive_texture( self, texture_index: usize, tex_coord: Option<usize>, ) -> Self
Set emissive texture
Sourcepub fn with_emissive_factor(self, factor: [f32; 3]) -> Self
pub fn with_emissive_factor(self, factor: [f32; 3]) -> Self
Set emissive factor
Sourcepub fn with_alpha_mode(self, mode: String, cutoff: Option<f32>) -> Self
pub fn with_alpha_mode(self, mode: String, cutoff: Option<f32>) -> Self
Set alpha mode and cutoff
Sourcepub fn with_double_sided(self, double_sided: bool) -> Self
pub fn with_double_sided(self, double_sided: bool) -> Self
Set double sided flag
Auto Trait Implementations§
impl Freeze for MaterialBuilder
impl RefUnwindSafe for MaterialBuilder
impl Send for MaterialBuilder
impl Sync for MaterialBuilder
impl Unpin for MaterialBuilder
impl UnwindSafe for MaterialBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more