Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ClearRenderTarget

Adds a "clear render target" command.
Read time 2 minutesLast updated 4 days ago

Definition

ClearRenderTarget(bool, bool, Color)

Adds a "clear render target" command.
public void ClearRenderTarget(bool clearDepth, bool clearColor, Color backgroundColor)

Parameters

clearDepth

Whether to clear both the depth buffer and the stencil buffer.

clearColor

Whether to clear the color buffer.

backgroundColor

Color to clear with.

ClearRenderTarget(bool, bool, Color, float)

Adds a "clear render target" command.
public void ClearRenderTarget(bool clearDepth, bool clearColor, Color backgroundColor, float depth)

Parameters

clearDepth

Whether to clear both the depth buffer and the stencil buffer.

clearColor

Whether to clear the color buffer.

backgroundColor

Color to clear with.

depth

Depth to clear with (default is 1.0).

ClearRenderTarget(bool, bool, Color, float, uint)

Adds a "clear render target" command.
public void ClearRenderTarget(bool clearDepth, bool clearColor, Color backgroundColor, float depth = 1, uint stencil = 0)

Parameters

clearDepth

Whether to clear both the depth buffer and the stencil buffer.

clearColor

Whether to clear the color buffer.

backgroundColor

Color to clear with.

depth

Depth to clear with (default is 1.0).

stencil

Stencil to clear with (default is 0).

ClearRenderTarget(RTClearFlags, Color, float, uint)

Adds a "clear render target" command.
public void ClearRenderTarget(RTClearFlags clearFlags, Color backgroundColor, float depth = 1, uint stencil = 0)

Parameters

clearFlags

Which render targets to clear, defined using a bitwise OR combination of RTClearFlags values.

backgroundColor

Color to clear with.

depth

Depth to clear with (default is 1.0).

stencil

Stencil to clear with (default is 0).

ClearRenderTarget(RTClearFlags, Color[], float, uint)

Adds a "clear render target" command.
public void ClearRenderTarget(RTClearFlags clearFlags, Color[] backgroundColors, float depth = 1, uint stencil = 0)

Parameters

clearFlags

Which render targets to clear, defined using a bitwise OR combination of RTClearFlags values.

backgroundColors

Colors to clear with.

depth

Depth to clear with (default is 1.0).

stencil

Stencil to clear with (default is 0).