Struct BlinkingLEDMaterial

Source
#[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()

Shader Preview

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

Source

pub fn new(active_color: Color, passive_color: Color) -> Self

Source

pub fn with_random_sequence(self) -> Self

Source

pub fn with_sequence(self, sequence: [f32; 16]) -> Self

Source

pub fn with_active_emission(self, intensity: f32) -> Self

Source

pub fn with_passive_emission(self, intensity: f32) -> Self

Trait Implementationsยง

Sourceยง

impl AsBindGroup for BlinkingLEDMaterial

Sourceยง

type Data = ()

Data that will be stored alongside the โ€œpreparedโ€ bind group.
Sourceยง

type Param = (Res<'static, RenderAssets<GpuImage>>, Res<'static, FallbackImage>, Res<'static, RenderAssets<GpuShaderStorageBuffer>>)

Sourceยง

fn label() -> Option<&'static str>

label
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>

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>

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>

Creates a bind group for self matching the layout defined in AsBindGroup::bind_group_layout.
Sourceยง

fn bind_group_layout(render_device: &RenderDevice) -> BindGroupLayout
where Self: Sized,

Creates the bind group layout matching all bind groups returned by AsBindGroup::as_bind_group
Sourceยง

impl Clone for BlinkingLEDMaterial

Sourceยง

fn clone(&self) -> BlinkingLEDMaterial

Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl Default for BlinkingLEDMaterial

Sourceยง

fn default() -> Self

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl Material for BlinkingLEDMaterial

Sourceยง

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

Returns this materialโ€™s AlphaMode. Defaults to AlphaMode::Opaque.
Sourceยง

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

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

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

Returns whether the material would like to read from ViewTransmissionTexture. Read more
Sourceยง

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 more
Sourceยง

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 more
Sourceยง

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

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>

Customizes the default RenderPipelineDescriptor for a specific entity using the entityโ€™s MaterialPipelineKey and MeshVertexBufferLayoutRef as input.
Sourceยง

impl TypePath for BlinkingLEDMaterial

Sourceยง

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
Sourceยง

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>

Returns the name of the type, or None if it is anonymous. Read more
Sourceยง

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
Sourceยง

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
Sourceยง

impl VisitAssetDependencies for BlinkingLEDMaterial

Sourceยง

impl Asset for BlinkingLEDMaterial

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, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Sourceยง

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 A
where A: Asset,

Sourceยง

fn insert(self: Box<A>, id: UntypedAssetId, world: &mut World)

Sourceยง

fn asset_type_name(&self) -> &'static str

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> Downcast<T> for T

Sourceยง

impl<T> Downcast for T
where T: Any,

Sourceยง

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>

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)

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)

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
where T: Any + Send + Sync,

Sourceยง

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Sourceยง

impl<T> DynamicTypePath for T
where T: TypePath,

Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<S> FromSample<S> for S

Sourceยง

impl<T> FromWorld for T
where T: Default,

Sourceยง

fn from_world(_world: &mut World) -> T

Creates Self using default().

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Sourceยง

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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Sourceยง

impl<T> Pointable for T

Sourceยง

const ALIGN: usize

The alignment of pointer.
Sourceยง

type Init = T

The type for initializers.
Sourceยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Sourceยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Sourceยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Sourceยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToSample<U> for T
where U: FromSample<T>,

Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Sourceยง

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Sourceยง

impl<T> Upcast<T> for T

Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

impl<T> ConditionalSend for T
where T: Send,

Sourceยง

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Sourceยง

impl<T> Settings for T
where T: 'static + Send + Sync,

Sourceยง

impl<T> WasmNotSend for T
where T: Send,

Sourceยง

impl<T> WasmNotSendSync for T

Sourceยง

impl<T> WasmNotSync for T
where T: Sync,