Struct bevy_core_pipeline::dof::DepthOfFieldSettings
source · pub struct DepthOfFieldSettings {
pub mode: DepthOfFieldMode,
pub focal_distance: f32,
pub sensor_height: f32,
pub aperture_f_stops: f32,
pub max_circle_of_confusion_diameter: f32,
pub max_depth: f32,
}
Expand description
Depth of field settings.
Fields§
§mode: DepthOfFieldMode
The appearance of the effect.
focal_distance: f32
The distance in meters to the location in focus.
sensor_height: f32
The height of the image sensor format in meters.
Focal length is derived from the FOV and this value. The default is 18.66mm, matching the Super 35 format, which is popular in cinema.
aperture_f_stops: f32
Along with the focal length, controls how much objects not in focus are blurred.
max_circle_of_confusion_diameter: f32
The maximum diameter, in pixels, that we allow a circle of confusion to be.
A circle of confusion essentially describes the size of a blur.
This value is nonphysical but is useful for avoiding pathologically-slow behavior.
max_depth: f32
Objects are never considered to be farther away than this distance as far as depth of field is concerned, even if they actually are.
This is primarily useful for skyboxes and background colors. The Bevy
renderer considers them to be infinitely far away. Without this value,
that would cause the circle of confusion to be infinitely large, capped
only by the max_circle_of_confusion_diameter
. As that’s unsightly,
this value can be used to essentially adjust how “far away” the skybox
or background are.
Implementations§
source§impl DepthOfFieldSettings
impl DepthOfFieldSettings
sourcepub fn from_physical_camera(
camera: &PhysicalCameraParameters
) -> DepthOfFieldSettings
pub fn from_physical_camera( camera: &PhysicalCameraParameters ) -> DepthOfFieldSettings
Initializes DepthOfFieldSettings
from a set of
PhysicalCameraParameters
.
By passing the same PhysicalCameraParameters
object to this function
and to bevy_render::camera::Exposure::from_physical_camera
, matching
results for both the exposure and depth of field effects can be
obtained.
All fields of the returned DepthOfFieldSettings
other than
focal_length
and aperture_f_stops
are set to their default values.
Trait Implementations§
source§impl Clone for DepthOfFieldSettings
impl Clone for DepthOfFieldSettings
source§fn clone(&self) -> DepthOfFieldSettings
fn clone(&self) -> DepthOfFieldSettings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Component for DepthOfFieldSettings
impl Component for DepthOfFieldSettings
source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
source§fn register_component_hooks(_hooks: &mut ComponentHooks)
fn register_component_hooks(_hooks: &mut ComponentHooks)
ComponentHooks
.source§impl Default for DepthOfFieldSettings
impl Default for DepthOfFieldSettings
impl Copy for DepthOfFieldSettings
Auto Trait Implementations§
impl Freeze for DepthOfFieldSettings
impl RefUnwindSafe for DepthOfFieldSettings
impl Send for DepthOfFieldSettings
impl Sync for DepthOfFieldSettings
impl Unpin for DepthOfFieldSettings
impl UnwindSafe for DepthOfFieldSettings
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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
source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId) )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
source§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>)
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>) )
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))
source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World
.