#[repr(C)]pub struct BlinkingLEDMaterial { /* private fields */ }
Expand description
Blinking led material.
It blinks according to the specified intervals sequence.
ยงExamples:
For the effect from the examples:
BlinkingLEDMaterial::default()
You can specify your own colors, emission intensity and sequence of cource:
let active_color = Color:WHITE;
let passive_color = Color::BLACK;
BlinkingLEDMaterial::new(active_color, passive_color)
.with_sequence(/* sequence format: [f32; 16] */)
.with_random_sequence() // To generate random sequence you can use `with_random_sequence` instead of `with_sequence`
.with_active_emission(3.0) // For active color
Implementationsยง
Sourceยงimpl BlinkingLEDMaterial
impl BlinkingLEDMaterial
pub fn new(active_color: Color, passive_color: Color) -> Self
pub fn with_random_sequence(self) -> Self
pub fn with_sequence(self, sequence: [f32; 16]) -> Self
pub fn with_active_emission(self, intensity: f32) -> Self
pub fn with_passive_emission(self, intensity: f32) -> Self
Trait Implementationsยง
Sourceยงimpl AsBindGroup for BlinkingLEDMaterial
impl AsBindGroup for BlinkingLEDMaterial
type Param = (Res<'static, RenderAssets<GpuImage>>, Res<'static, FallbackImage>, Res<'static, RenderAssets<GpuShaderStorageBuffer>>)
Sourceยงfn unprepared_bind_group(
&self,
layout: &BindGroupLayout,
render_device: &RenderDevice,
(images, fallback_image, storage_buffers): &mut SystemParamItem<'_, '_, Self::Param>,
) -> Result<UnpreparedBindGroup<Self::Data>, AsBindGroupError>
fn unprepared_bind_group( &self, layout: &BindGroupLayout, render_device: &RenderDevice, (images, fallback_image, storage_buffers): &mut SystemParamItem<'_, '_, Self::Param>, ) -> Result<UnpreparedBindGroup<Self::Data>, AsBindGroupError>
Returns a vec of (binding index,
OwnedBindingResource
).
In cases where OwnedBindingResource
is not available (as for bindless texture arrays currently),
an implementor may define as_bind_group
directly. This may prevent certain features
from working correctly.Sourceยงfn bind_group_layout_entries(
render_device: &RenderDevice,
) -> Vec<BindGroupLayoutEntry>
fn bind_group_layout_entries( render_device: &RenderDevice, ) -> Vec<BindGroupLayoutEntry>
Returns a vec of bind group layout entries
Sourceยงfn as_bind_group(
&self,
layout: &BindGroupLayout,
render_device: &RenderDevice,
param: &mut <Self::Param as SystemParam>::Item<'_, '_>,
) -> Result<PreparedBindGroup<Self::Data>, AsBindGroupError>
fn as_bind_group( &self, layout: &BindGroupLayout, render_device: &RenderDevice, param: &mut <Self::Param as SystemParam>::Item<'_, '_>, ) -> Result<PreparedBindGroup<Self::Data>, AsBindGroupError>
Creates a bind group for
self
matching the layout defined in AsBindGroup::bind_group_layout
.Sourceยงfn bind_group_layout(render_device: &RenderDevice) -> BindGroupLayoutwhere
Self: Sized,
fn bind_group_layout(render_device: &RenderDevice) -> BindGroupLayoutwhere
Self: Sized,
Creates the bind group layout matching all bind groups returned by
AsBindGroup::as_bind_group
Sourceยงimpl Clone for BlinkingLEDMaterial
impl Clone for BlinkingLEDMaterial
Sourceยงfn clone(&self) -> BlinkingLEDMaterial
fn clone(&self) -> BlinkingLEDMaterial
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSourceยงimpl Default for BlinkingLEDMaterial
impl Default for BlinkingLEDMaterial
Sourceยงimpl Material for BlinkingLEDMaterial
impl Material for BlinkingLEDMaterial
Sourceยงfn fragment_shader() -> ShaderRef
fn fragment_shader() -> ShaderRef
Returns this materialโs fragment shader. If
ShaderRef::Default
is returned, the default mesh fragment shader
will be used.Sourceยงfn alpha_mode(&self) -> AlphaMode
fn alpha_mode(&self) -> AlphaMode
Returns this materialโs
AlphaMode
. Defaults to AlphaMode::Opaque
.Sourceยงfn vertex_shader() -> ShaderRef
fn vertex_shader() -> ShaderRef
Returns this materialโs vertex shader. If
ShaderRef::Default
is returned, the default mesh vertex shader
will be used.Sourceยงfn opaque_render_method(&self) -> OpaqueRendererMethod
fn opaque_render_method(&self) -> OpaqueRendererMethod
Returns if this material should be rendered by the deferred or forward renderer.
for
AlphaMode::Opaque
or AlphaMode::Mask
materials.
If OpaqueRendererMethod::Auto
, it will default to what is selected in the DefaultOpaqueRendererMethod
resource.Sourceยงfn depth_bias(&self) -> f32
fn depth_bias(&self) -> f32
Add a bias to the view depth of the mesh which can be used to force a specific render order.
for meshes with similar depth, to avoid z-fighting.
The bias is in depth-texture units so large values may be needed to overcome small depth differences.
Sourceยงfn reads_view_transmission_texture(&self) -> bool
fn reads_view_transmission_texture(&self) -> bool
Returns whether the material would like to read from
ViewTransmissionTexture
. Read moreSourceยงfn prepass_vertex_shader() -> ShaderRef
fn prepass_vertex_shader() -> ShaderRef
Returns this materialโs prepass vertex shader. If
ShaderRef::Default
is returned, the default prepass vertex shader
will be used. Read moreSourceยงfn prepass_fragment_shader() -> ShaderRef
fn prepass_fragment_shader() -> ShaderRef
Returns this materialโs prepass fragment shader. If
ShaderRef::Default
is returned, the default prepass fragment shader
will be used. Read moreSourceยงfn deferred_vertex_shader() -> ShaderRef
fn deferred_vertex_shader() -> ShaderRef
Returns this materialโs deferred vertex shader. If
ShaderRef::Default
is returned, the default deferred vertex shader
will be used.Sourceยงfn deferred_fragment_shader() -> ShaderRef
fn deferred_fragment_shader() -> ShaderRef
Returns this materialโs deferred fragment shader. If
ShaderRef::Default
is returned, the default deferred fragment shader
will be used.Sourceยงfn specialize(
pipeline: &MaterialPipeline<Self>,
descriptor: &mut RenderPipelineDescriptor,
layout: &MeshVertexBufferLayoutRef,
key: MaterialPipelineKey<Self>,
) -> Result<(), SpecializedMeshPipelineError>
fn specialize( pipeline: &MaterialPipeline<Self>, descriptor: &mut RenderPipelineDescriptor, layout: &MeshVertexBufferLayoutRef, key: MaterialPipelineKey<Self>, ) -> Result<(), SpecializedMeshPipelineError>
Customizes the default
RenderPipelineDescriptor
for a specific entity using the entityโs
MaterialPipelineKey
and MeshVertexBufferLayoutRef
as input.Sourceยงimpl TypePath for BlinkingLEDMaterial
impl TypePath for BlinkingLEDMaterial
Sourceยงfn type_path() -> &'static str
fn type_path() -> &'static str
Returns the fully qualified path of the underlying type. Read more
Sourceยงfn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Returns a short, pretty-print enabled path to the type. Read more
Sourceยงfn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Sourceยงfn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Sourceยงimpl VisitAssetDependencies for BlinkingLEDMaterial
impl VisitAssetDependencies for BlinkingLEDMaterial
fn visit_dependencies(&self, visit: &mut impl FnMut(UntypedAssetId))
impl Asset for BlinkingLEDMaterial
Auto Trait Implementationsยง
impl Freeze for BlinkingLEDMaterial
impl RefUnwindSafe for BlinkingLEDMaterial
impl Send for BlinkingLEDMaterial
impl Sync for BlinkingLEDMaterial
impl Unpin for BlinkingLEDMaterial
impl UnwindSafe for BlinkingLEDMaterial
Blanket Implementationsยง
Sourceยงimpl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Sourceยงfn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.Sourceยงimpl<A> AssetContainer for Awhere
A: Asset,
impl<A> AssetContainer for Awhere
A: Asset,
fn insert(self: Box<A>, id: UntypedAssetId, world: &mut World)
fn asset_type_name(&self) -> &'static str
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> 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>
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.Sourceยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
Sourceยงimpl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Sourceยงfn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
See
TypePath::type_path
.Sourceยงfn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Sourceยงfn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
See
TypePath::type_ident
.Sourceยงfn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
See
TypePath::crate_name
.Sourceยงfn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Sourceยงimpl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Sourceยงimpl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Sourceยงfn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
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>
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