The Depth Of Field component applies a depth of field effect, which simulates the focus properties of a camera lens. In real life, a camera can only focus sharply on an object at a specific distance. Objects nearer or farther from the camera are out of focus. The blurring gives a visual cue about an object’s distance, and introduces “bokeh”, which refers to visual artifacts that appear around bright areas of the image as they fall out of focus. To read more about bokeh, see the Wikipedia article on Bokeh.
The Universal Render Pipeline (URP) has two depth of field modes:
Depth Of Field uses the Volume system, so to enable and modify Depth Of Field properties, you must add a Depth Of Field override to a Volume in your Scene. To add Depth Of Field to a Volume:
Property | Description |
---|---|
Mode | Use this drop-down to select the mode that URP uses to set the focus for the depth of field effect. • Off: Select this option to disable depth of field. • Gaussian: Select this option to use the faster but more limited depth of field mode. • Bokeh: Select this option to use the Bokeh-based depth of field mode. |
Property | Description |
---|---|
Start | Set the distance from the Camera at which the far field starts blurring. |
End | Set the distance from the Camera at which the far field blur reaches its maximum blur radius. |
Max Radius | Set the maximum radius the far blur can reach. The default value is 1. Note: Values above 1 can cause visual under-sampling artifacts to appear in your Scene. If your blur effects are not smooth or appear to have static noise in them, try decreasing the value back to 1 or lower. |
High Quality Sampling | Use higher quality sampling to reduce flickering and improve the overall blur smoothness. This can cause some performance cost. |
The Bokeh Depth of Field mode closely imitates the effect of a real-life camera. For this reason, the settings are based on real-life camera settings, and offer a number of properties to adjust the diaphragm blades on the Camera. For an introduction to diaphragm blades and how they affect the visual quality of your Camera output, see Improve Photography’s guide Aperture Blades: How many is best?.
Property | Description |
---|---|
Focus Distance | Set the distance from the Camera to the focus point. |
Focal Length | Set the distance, in millimeters, between the Camera sensor and the Camera lens. The larger the value is, the shallower the depth of field. |
Aperture | Set the ratio of aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is. |
Blade Count | Use the slider to set the number of diaphragm blades the Camera uses to form the aperture. The more blades you use, the rounder the bokeh appear. |
Blade Curvature | Use the slider to set the curvature of diaphragm blades the Camera uses to form the aperture. The smaller the value is, the more visible aperture blades are. A value of 1 makes the bokeh perfectly circular. |
Blade Rotation | Use the slider to set the rotation of diaphragm blades in degrees. |