Struct bevy_skybox_cubemap::SkyboxMaterial[][src]

pub struct SkyboxMaterial {
    pub color: Color,
    pub texture: Option<Handle<Texture>>,
}
Expand description

Material for a Skybox. Consists of a base color and an optional 6-sided array-texture.

When rendering, the color from the texure is multiplied by the base color. This can be used to tint the skybox. When creating a new material, the default color is [Color::WHITE] which will have no effect on the texture color.

It is also possible to use a skybox texture with only a [Color]. One reason you might want to do this is that (at time of writing) Bevy does not seem to antialias against the window [ClearColor] properly, instead antialiasing with white for objects that have not other 3d object behind them. This leads to white borders around antialiased object that overlap the window clear color. To avoid this, you could spawn a skybox using only a color. Since the skybox is a 3d rendered object, antialiasing against it works properly.

Skyboxes should generally be spawned using SkyboxBundle, and you can see that type for info on what components are used with this material.

Fields

color: Color

Base color of the skybox. Multiplied with the color from the texture if a texture is supplied, otherwise used by itself as the skybox color.

texture: Option<Handle<Texture>>

Texture to use for the skybox. This must be a an aray texture with 6 layers which are all square and the same size. See the crate overview for details on the required layer order and how to get a texture in this format.

Implementations

Creates a SkyboxMaterial with just a texture. The color will be set to [Color::WHITE] to avoid tinting the texture.

Creates a SkyboxMaterial with only a color. This could be used in place of [ClearColor] if ClearColor is giving you issues with antialiasing. Otherwise it’s not all that useful.

Trait Implementations

Formats the value using the given formatter. Read more

Creates a new skybox material with color set to white and no texture.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

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

Performs the conversion.

Creates Self using data from the given [World]

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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