pub struct Material {
pub bind_group: Arc<BindGroup>,
pub albedo: Vec4,
pub roughness: f32,
pub metallic: f32,
pub anisotropy: f32,
pub clear_coat: f32,
pub subsurface: f32,
pub texture_source: Option<String>,
pub material_type: MaterialType,
pub is_transparent: bool,
pub is_double_sided: bool,
}Fields§
§bind_group: Arc<BindGroup>§albedo: Vec4§roughness: f32§metallic: f32§anisotropy: f32§clear_coat: f32§subsurface: f32§texture_source: Option<String>§material_type: MaterialType§is_transparent: bool§is_double_sided: boolImplementations§
Source§impl Material
impl Material
pub fn new(bind_group: Arc<BindGroup>) -> Material
Sourcepub fn with_pbr(self, albedo: Vec4, roughness: f32, metallic: f32) -> Material
pub fn with_pbr(self, albedo: Vec4, roughness: f32, metallic: f32) -> Material
PBR materyali olarak yapılandırır.
Not: Eğer albedo.w < 1.0 verilirse is_transparent otomatik olarak true yapılır.
roughness ve metallic değerleri [0.0, 1.0] aralığına sınırlandırılır.
pub fn with_anisotropy(self, anisotropy: f32) -> Material
pub fn with_clear_coat(self, clear_coat: f32) -> Material
pub fn with_subsurface(self, subsurface: f32) -> Material
Sourcepub fn with_transparent(self, transparent: bool) -> Material
pub fn with_transparent(self, transparent: bool) -> Material
Saydamlığı manuel olarak belirler.
Uyarı: with_pbr, with_unlit veya with_water metodları albedo’nun alpha değerine (w) bakarak
saydamlığı otomatik değiştirebilir. Kesin bir saydamlık istiyorsanız, bu metodu builder zincirinin en sonunda çağırın.
pub fn with_double_sided(self, double_sided: bool) -> Material
Sourcepub fn with_unlit(self, albedo: Vec4) -> Material
pub fn with_unlit(self, albedo: Vec4) -> Material
Işıklandırmadan etkilenmeyen (Unlit) materyal olarak yapılandırır.
Not: Eğer albedo.w < 1.0 verilirse is_transparent otomatik olarak true yapılır.
pub fn with_skybox(self) -> Material
Sourcepub fn with_water(self, base_albedo: Vec4) -> Material
pub fn with_water(self, base_albedo: Vec4) -> Material
Su materyali olarak yapılandırır.
roughness 0.05, metallic 0.0 olarak varsayılan su değerlerine ayarlanır.
Not: Eğer base_albedo.w < 1.0 verilirse is_transparent otomatik olarak true yapılır.
pub fn with_texture_source(self, path: String) -> Material
Trait Implementations§
Source§impl Component for Material
impl Component for Material
fn storage_type() -> StorageType
Auto Trait Implementations§
impl Freeze for Material
impl !RefUnwindSafe for Material
impl Send for Material
impl Sync for Material
impl Unpin for Material
impl UnsafeUnpin for Material
impl !UnwindSafe for Material
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
Source§impl<T> BundleExt for Twhere
T: Bundle,
impl<T> BundleExt for Twhere
T: Bundle,
fn with<C>(self, component: C) -> DynamicBundle<Self, C>where
C: Component,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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