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.
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<'_>>,
) -> EffectMaterialId
fn id( &self, color_texture: Option<ColorTexture<'_>>, depth_texture: Option<DepthTexture<'_>>, ) -> EffectMaterialId
Returns a unique ID for each variation of the shader source returned from Effect::fragment_shader_source. Read more
Source§fn use_uniforms(
&self,
program: &Program,
viewer: &dyn Viewer,
_lights: &[&dyn Light],
color_texture: Option<ColorTexture<'_>>,
depth_texture: Option<DepthTexture<'_>>,
)
fn use_uniforms( &self, program: &Program, viewer: &dyn Viewer, _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 Freeze for FogEffect
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