ClearRenderPass
¶
Use a Clear Render Pass to clear the color, depth, and stencil buffers of the current render context before passing the control to the descendants of this render pass.
When you create a Clear Render Pass using the API, it does not clear any buffers. However, when you create a Clear Render Pass in Kanzi Studio, the render pass clears the depth buffer.
You control which buffers a Clear Render Pass clears by setting in the render pass the properties for those buffers. To disable the clearing of a buffer, remove from that render pass the property for the buffer the clearing of which you want to disable.
Clear values
To clear any of the four color buffers, set the ClearColor0Property, ClearColor1Property, ClearColor2Property, or ClearColor3Property to an RGBA color. Values for each color range from 0.0f to 1.0f. When using the Clear Render Pass in Kanzi Studio, the most common use cases include clearing to either transparent black or any given opaque color. ColorRGBA::transparentBlack() is synonymous to ColorRGBA(0.0f, 0.0f, 0.0f, 0.0f) and provided for convenience.
To clear the depth buffer, set the ClearDepthProperty to a value between 0.0f and 1.0f. 1.0f represents the largest possible value in the depth buffer and is the most commonly used value. Unless you want to achieve a very specific effect, set the value of the ClearDepthProperty to either 1.0f or do not set the value at all.
To clear the stencil buffer, set the ClearStencilProperty to a value between 0 and 255. Since the stencil buffer is usually 8 bits, this means any 8-bit unsigned integer. For example, use the ClearStencilProperty to reset the stencil buffer before masking areas in it.
Use a Clear render pass to clear the color, depth, and stencil buffers of the current render context.
Inherits properties and message types from ClearRenderPassMetadata.
Creates a Clear Render Pass.
| name | (string) | The name of the Clear Render Pass. |
| (ClearRenderPass) | The created Clear Render Pass. |