pub struct FogEffect {
pub color: Srgba,
pub density: f32,
pub animation: f32,
pub time: f32,
}
Expand description
An effect that simulates fog, ie. the area where it is applied gets hazy when objects are far away.
Fields§
§color: Srgba
The color of the fog.
density: f32
The density of the fog.
animation: f32
Determines the variation on the density as a function of time.
time: f32
The time used for the animation.
Trait Implementations§
source§impl Effect for FogEffect
impl Effect for FogEffect
source§fn fragment_shader_source(
&self,
_lights: &[&dyn Light],
color_texture: Option<ColorTexture<'_>>,
depth_texture: Option<DepthTexture<'_>>
) -> String
fn fragment_shader_source( &self, _lights: &[&dyn Light], color_texture: Option<ColorTexture<'_>>, depth_texture: Option<DepthTexture<'_>> ) -> String
Returns the fragment shader source for this effect.
source§fn id(
&self,
color_texture: Option<ColorTexture<'_>>,
depth_texture: Option<DepthTexture<'_>>
) -> u16
fn id( &self, color_texture: Option<ColorTexture<'_>>, depth_texture: Option<DepthTexture<'_>> ) -> u16
Returns a unique ID for each variation of the shader source returned from Effect::fragment_shader_source. Read more
source§fn fragment_attributes(&self) -> FragmentAttributes
fn fragment_attributes(&self) -> FragmentAttributes
Returns a FragmentAttributes struct that describes which fragment attributes,
ie. the input from the vertex shader, are required for rendering with this effect.
source§fn use_uniforms(
&self,
program: &Program,
camera: &Camera,
_lights: &[&dyn Light],
color_texture: Option<ColorTexture<'_>>,
depth_texture: Option<DepthTexture<'_>>
)
fn use_uniforms( &self, program: &Program, camera: &Camera, _lights: &[&dyn Light], color_texture: Option<ColorTexture<'_>>, depth_texture: Option<DepthTexture<'_>> )
Sends the uniform data needed for this effect to the fragment shader.
source§fn render_states(&self) -> RenderStates
fn render_states(&self) -> RenderStates
Returns the render states needed to render with this effect.
Auto Trait Implementations§
impl RefUnwindSafe for FogEffect
impl Send for FogEffect
impl Sync for FogEffect
impl Unpin for FogEffect
impl UnwindSafe for FogEffect
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