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§
- Auxiliary
Depth OfField Texture - The extra texture used as the second render target for the hexagonal bokeh blur.
- Depth
OfField - A component that enables a depth of field postprocessing effect when attached to a
Camera3d
, simulating the focus of a camera lens. - Depth
OfField Global Bind Group - The bind group shared among all invocations of the depth of field shader, regardless of view.
- Depth
OfField Global Bind Group Layout - The layout for the bind group shared among all invocations of the depth of field shader.
- Depth
OfField Node - The node in the render graph for depth of field.
- Depth
OfField Pipeline - Information needed to specialize the pipeline corresponding to a pass of the depth of field shader.
- Depth
OfField Pipeline Key - A key that uniquely identifies depth of field pipelines.
- Depth
OfField Plugin - A plugin that adds support for the depth of field effect to Bevy.
- Depth
OfField Uniform - Data about the depth of field effect that’s uploaded to the GPU.
- View
Depth OfField Bind Group Layouts - Bind group layouts for depth of field specific to a single view.
Enums§
- Depth
OfField Mode - Controls the appearance of the effect.
- Depth
OfField Pipelines
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§
- Depth
OfField Settings Deprecated