pub struct Skybox { /* private fields */ }
Expand description
An illusion of a sky.
Implementations§
source§impl Skybox
impl Skybox
sourcepub fn new(
context: &Context,
right: &CpuTexture,
left: &CpuTexture,
top: &CpuTexture,
bottom: &CpuTexture,
front: &CpuTexture,
back: &CpuTexture
) -> Self
pub fn new( context: &Context, right: &CpuTexture, left: &CpuTexture, top: &CpuTexture, bottom: &CpuTexture, front: &CpuTexture, back: &CpuTexture ) -> Self
Creates a new skybox with the given CpuTextures placed at the indicated sides of the skybox. All of the cpu textures must contain data with the same TextureDataType.
sourcepub fn new_from_equirectangular(
context: &Context,
cpu_texture: &CpuTexture
) -> Self
pub fn new_from_equirectangular( context: &Context, cpu_texture: &CpuTexture ) -> Self
Creates a new skybox with a cube texture generated from the equirectangular texture given as input.
sourcepub fn new_with_texture(context: &Context, texture: Arc<TextureCubeMap>) -> Self
pub fn new_with_texture(context: &Context, texture: Arc<TextureCubeMap>) -> Self
Creates a new skybox with the given TextureCubeMap.
The colors are assumed to be in linear sRGB (RgbU8
), linear sRGB with an alpha channel (RgbaU8
) or HDR color space.
sourcepub fn texture(&self) -> &Arc<TextureCubeMap>
pub fn texture(&self) -> &Arc<TextureCubeMap>
Returns a reference to the cube map texture
Trait Implementations§
source§impl Geometry for Skybox
impl Geometry for Skybox
source§fn draw(
&self,
camera: &Camera,
program: &Program,
render_states: RenderStates,
_attributes: FragmentAttributes
)
fn draw( &self, camera: &Camera, program: &Program, render_states: RenderStates, _attributes: FragmentAttributes )
Draw this geometry.
source§fn vertex_shader_source(
&self,
_required_attributes: FragmentAttributes
) -> String
fn vertex_shader_source( &self, _required_attributes: FragmentAttributes ) -> String
Returns the vertex shader source for this geometry given that the fragment shader needs the given vertex attributes.
source§fn id(&self, _required_attributes: FragmentAttributes) -> u16
fn id(&self, _required_attributes: FragmentAttributes) -> u16
Returns a unique ID for each variation of the shader source returned from
Geometry::vertex_shader_source
. Read moresource§fn aabb(&self) -> AxisAlignedBoundingBox
fn aabb(&self) -> AxisAlignedBoundingBox
Returns the AxisAlignedBoundingBox for this geometry in the global coordinate system.
source§fn render_with_material(
&self,
material: &dyn Material,
camera: &Camera,
lights: &[&dyn Light]
)
fn render_with_material( &self, material: &dyn Material, camera: &Camera, lights: &[&dyn Light] )
Render the geometry with the given Material.
Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method.
Use an empty array for the
lights
argument, if the material does not require lights to be rendered.source§fn render_with_effect(
&self,
material: &dyn Effect,
camera: &Camera,
lights: &[&dyn Light],
color_texture: Option<ColorTexture<'_>>,
depth_texture: Option<DepthTexture<'_>>
)
fn render_with_effect( &self, material: &dyn Effect, camera: &Camera, lights: &[&dyn Light], color_texture: Option<ColorTexture<'_>>, depth_texture: Option<DepthTexture<'_>> )
Render the geometry with the given Effect.
Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method.
Use an empty array for the
lights
argument, if the material does not require lights to be rendered.source§impl<'a> IntoIterator for &'a Skybox
impl<'a> IntoIterator for &'a Skybox
source§impl Object for Skybox
impl Object for Skybox
source§fn render(&self, camera: &Camera, lights: &[&dyn Light])
fn render(&self, camera: &Camera, lights: &[&dyn Light])
Render the object.
Use an empty array for the
lights
argument, if the objects does not require lights to be rendered.
Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method.source§fn material_type(&self) -> MaterialType
fn material_type(&self) -> MaterialType
Returns the type of material applied to this object.
Auto Trait Implementations§
impl RefUnwindSafe for Skybox
impl !Send for Skybox
impl !Sync for Skybox
impl Unpin for Skybox
impl UnwindSafe for Skybox
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