Class View.DepthOfFieldOptions
- java.lang.Object
-
- com.google.android.filament.View.DepthOfFieldOptions
-
- Enclosing class:
- View
public static class View.DepthOfFieldOptions extends java.lang.ObjectOptions to control Depth of Field (DoF) effect in the scene
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classView.DepthOfFieldOptions.Filter
-
Field Summary
Fields Modifier and Type Field Description intbackgroundRingCountNumber of of rings used by the background kernel.floatcocScalecircle of confusion scale factor (amount of blur)booleanenabledenable or disable Depth of field effectintfastGatherRingCountNumber of of rings used by the fast gather kernel.View.DepthOfFieldOptions.Filterfilterfilter to use for filling gaps in the kernelintforegroundRingCountNumber of of rings used by the foreground kernel.floatmaxApertureDiametermaximum aperture diameter in meters (zero to disable bokeh rotation)intmaxBackgroundCOCmaximum circle-of-confusion in pixels for the background, must be in [0, 32] range.intmaxForegroundCOCmaximum circle-of-confusion in pixels for the foreground, must be in [0, 32] range.booleannativeResolutionperform DoF processing at native resolution
-
Constructor Summary
Constructors Constructor Description DepthOfFieldOptions()
-
-
-
Field Detail
-
cocScale
public float cocScale
circle of confusion scale factor (amount of blur)cocScale can be used to set the depth of field blur independently from the camera aperture, e.g. for artistic reasons. This can be achieved by setting:
cocScale = cameraAperture / desiredDoFAperture
-
maxApertureDiameter
public float maxApertureDiameter
maximum aperture diameter in meters (zero to disable bokeh rotation)
-
enabled
public boolean enabled
enable or disable Depth of field effect
-
filter
@NonNull public View.DepthOfFieldOptions.Filter filter
filter to use for filling gaps in the kernel
-
nativeResolution
public boolean nativeResolution
perform DoF processing at native resolution
-
foregroundRingCount
public int foregroundRingCount
Number of of rings used by the foreground kernel. The number of rings affects quality and performance. The actual number of sample per pixel is defined as (ringCount * 2 - 1)^2. Here are a few commonly used values:
3 rings : 25 ( 5x 5 grid) 4 rings : 49 ( 7x 7 grid) 5 rings : 81 ( 9x 9 grid) 17 rings : 1089 (33x33 grid)With a maximum circle-of-confusion of 32, it is never necessary to use more than 17 rings.
Usually all three settings below are set to the same value, however, it is often acceptable to use a lower ring count for the "fast tiles", which improves performance. Fast tiles are regions of the screen where every pixels have a similar circle-of-confusion radius.
A value of 0 means default, which is 5 on desktop and 3 on mobile.
-
backgroundRingCount
public int backgroundRingCount
Number of of rings used by the background kernel. The number of rings affects quality and performance.- See Also:
foregroundRingCount
-
fastGatherRingCount
public int fastGatherRingCount
Number of of rings used by the fast gather kernel. The number of rings affects quality and performance.- See Also:
foregroundRingCount
-
maxForegroundCOC
public int maxForegroundCOC
maximum circle-of-confusion in pixels for the foreground, must be in [0, 32] range. A value of 0 means default, which is 32 on desktop and 24 on mobile.
-
maxBackgroundCOC
public int maxBackgroundCOC
maximum circle-of-confusion in pixels for the background, must be in [0, 32] range. A value of 0 means default, which is 32 on desktop and 24 on mobile.
-
-