Package com.google.android.filament
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. 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- See Also:
Camera
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classView.DepthOfFieldOptions.Filter
-
Field Summary
Fields Modifier and Type Field Description intbackgroundRingCountnumber of kernel rings for background tilesfloatcocScalecircle of confusion scale factor (amount of blur)booleanenabledenable or disable depth of field effectintfastGatherRingCountnumber of kernel rings for fast tilesView.DepthOfFieldOptions.Filterfilterfilter to use for filling gaps in the kernelintforegroundRingCountNumber of of rings used by the gather kernels.floatmaxApertureDiametermaximum aperture diameter in meters (zero to disable 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)
-
maxApertureDiameter
public float maxApertureDiameter
maximum aperture diameter in meters (zero to disable 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 gather kernels. 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 kernel rings for background tiles
-
fastGatherRingCount
public int fastGatherRingCount
number of kernel rings for fast tiles
-
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.
-
-