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
Auto Trait Implementations
impl RefUnwindSafe for SkyboxMaterial
impl Send for SkyboxMaterial
impl Sync for SkyboxMaterial
impl Unpin for SkyboxMaterial
impl UnwindSafe for SkyboxMaterial
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: 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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub 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. Read more
impl<T> FromWorld for T where
T: Default,
impl<T> FromWorld for T where
T: Default,
pub fn from_world(_world: &mut World) -> T
pub fn from_world(_world: &mut World) -> T
Creates Self
using data from the given [World]
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
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