pub struct MaterialPipeline {
pub name: String,
pub pipeline: RenderPipeline,
pub material_type: MaterialType,
pub bind_group: Option<BindGroup>,
}Fields§
§name: String§pipeline: RenderPipeline§material_type: MaterialType§bind_group: Option<BindGroup>Bind group for material textures (albedo, normal, roughness). Uses fallback white texture if no texture was provided. None for Basic materials that don’t use textures.
Implementations§
Source§impl MaterialPipeline
impl MaterialPipeline
pub fn from_builtin( device: &Device, queue: &Queue, format: TextureFormat, camera_layout: &BindGroupLayout, light_layout: &BindGroupLayout, shader: BuiltinShader, material_type: MaterialType, name: impl Into<String>, ) -> MaterialPipeline
pub fn from_source( device: &Device, queue: &Queue, format: TextureFormat, camera_layout: &BindGroupLayout, light_layout: &BindGroupLayout, source: &ShaderSource, material_type: MaterialType, albedo_texture: Option<&Texture>, name: impl Into<String>, ) -> Result<MaterialPipeline, MaterialError>
pub fn from_source_with_fallback( device: &Device, queue: &Queue, format: TextureFormat, camera_layout: &BindGroupLayout, light_layout: &BindGroupLayout, source: &ShaderSource, fallback_shader: BuiltinShader, material_type: MaterialType, albedo_texture: Option<&Texture>, name: impl Into<String>, ) -> MaterialPipeline
pub fn from_descriptor( device: &Device, queue: &Queue, format: TextureFormat, camera_layout: &BindGroupLayout, light_layout: &BindGroupLayout, descriptor: &MaterialDescriptor, ) -> Result<MaterialPipeline, MaterialError>
Auto Trait Implementations§
impl Freeze for MaterialPipeline
impl !RefUnwindSafe for MaterialPipeline
impl Send for MaterialPipeline
impl Sync for MaterialPipeline
impl Unpin for MaterialPipeline
impl UnsafeUnpin for MaterialPipeline
impl !UnwindSafe for MaterialPipeline
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> 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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.