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: SrgbaThe color of the fog.
density: f32The density of the fog.
animation: f32Determines the variation on the density as a function of time.
time: f32The time used for the animation.
Implementations§
source§impl FogEffect
impl FogEffect
sourcepub fn apply(
&self,
context: &Context,
time: f64,
camera: &Camera,
depth_texture: DepthTexture<'_>
)
👎Deprecated: use apply_screen_effect instead
pub fn apply( &self, context: &Context, time: f64, camera: &Camera, depth_texture: DepthTexture<'_> )
apply_screen_effect insteadApply the fog effect on the current render target based on the given depth texture. Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method.
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