Module dof

Source
Expand description

Depth of field, a postprocessing effect that simulates camera focus.

By default, Bevy renders all objects in full focus: regardless of depth, all objects are rendered perfectly sharp (up to output resolution). Real lenses, however, can only focus on objects at a specific distance. The distance between the nearest and furthest objects that are in focus is known as depth of field, and this term is used more generally in computer graphics to refer to the effect that simulates focus of lenses.

Attaching DepthOfField to a camera causes Bevy to simulate the focus of a camera lens. Generally, Bevy’s implementation of depth of field is optimized for speed instead of physical accuracy. Nevertheless, the depth of field effect in Bevy is based on physical parameters.

Structs§

AuxiliaryDepthOfFieldTexture
The extra texture used as the second render target for the hexagonal bokeh blur.
DepthOfField
A component that enables a depth of field postprocessing effect when attached to a Camera3d, simulating the focus of a camera lens.
DepthOfFieldGlobalBindGroup
The bind group shared among all invocations of the depth of field shader, regardless of view.
DepthOfFieldGlobalBindGroupLayout
The layout for the bind group shared among all invocations of the depth of field shader.
DepthOfFieldNode
The node in the render graph for depth of field.
DepthOfFieldPipeline
Information needed to specialize the pipeline corresponding to a pass of the depth of field shader.
DepthOfFieldPipelineKey
A key that uniquely identifies depth of field pipelines.
DepthOfFieldPlugin
A plugin that adds support for the depth of field effect to Bevy.
DepthOfFieldUniform
Data about the depth of field effect that’s uploaded to the GPU.
ViewDepthOfFieldBindGroupLayouts
Bind group layouts for depth of field specific to a single view.

Enums§

DepthOfFieldMode
Controls the appearance of the effect.
DepthOfFieldPipelines

Functions§

calculate_focal_length
Given the sensor height and the FOV, returns the focal length.
configure_depth_of_field_view_targets
Configures depth textures so that the depth of field shader can read from them.
prepare_auxiliary_depth_of_field_textures
Creates the second render target texture that the first pass of the bokeh effect needs.
prepare_depth_of_field_global_bind_group
Creates depth of field bind group 1, which is shared among all instances of the depth of field shader.
prepare_depth_of_field_pipelines
Specializes the depth of field pipelines specific to a view.
prepare_depth_of_field_view_bind_group_layouts
Creates the bind group layouts for the depth of field effect that are specific to each view.

Type Aliases§

DepthOfFieldSettingsDeprecated