Package com.google.android.filament
Class Renderer.ClearOptions
- java.lang.Object
-
- com.google.android.filament.Renderer.ClearOptions
-
- Enclosing class:
- Renderer
public static class Renderer.ClearOptions extends java.lang.ObjectClearOptions are used at the beginning of a frame to clear or retain the SwapChain content.
-
-
Field Summary
Fields Modifier and Type Field Description booleanclearWhether the SwapChain should be cleared using the clearColor.float[]clearColorColor (sRGB linear) to use to clear the RenderTarget (typically the SwapChain).booleandiscardWhether the SwapChain content should be discarded.
-
Constructor Summary
Constructors Constructor Description ClearOptions()
-
-
-
Field Detail
-
clearColor
@NonNull public float[] clearColor
Color (sRGB linear) to use to clear the RenderTarget (typically the SwapChain). The RenderTarget is cleared using this color, which won't be tone-mapped since tone-mapping is part of View rendering (this is not). When a View is rendered, there are 3 scenarios to consider: - Pixels rendered by the View replace the clear color (or blend with it in `BlendMode.TRANSLUCENT` mode). - With blending mode set to `BlendMode.TRANSLUCENT`, Pixels untouched by the View are considered fulling transparent and let the clear color show through. - With blending mode set to `BlendMode.OPAQUE`, Pixels untouched by the View are set to the clear color. However, because it is now used in the context of a View, it will go through the post-processing stage, which includes tone-mapping. For consistency, it is recommended to always use a Skybox to clear an opaque View's background, or to use black or fully-transparent (i.e. {0,0,0,0}) as the clear color.
-
clear
public boolean clear
Whether the SwapChain should be cleared using the clearColor. Use this if translucent View will be drawn, for instance.
-
discard
public boolean discard
Whether the SwapChain content should be discarded. clear implies discard. Set this to false (along with clear to false as well) if the SwapChain already has content that needs to be preserved
-
-