Skip to content

Format

typescript
RenderTexture.depthStencilFormat

class: RenderTexture

Description

(Read Only) The format of the depth and stencil buffer.

This method returns an enumeration type, for more details see GraphicsFormat.

Parameters

param_nametypedescription

Return

typedescription
GraphicsFormatGraphicsFormat enumeration value

Code Example

typescript
function Test() {
    try {
        let temp_texture = RenderTexture.GetTemporary(100, 100, RenderTextureFormat.Default, DepthType.Depth24Stencil8, AntiAliasingLevel.x8);
        // Get the format of the depth/stencil buffer
        let depthStencilFormat = temp_texture.getDepthStencilFormat();
    } catch (error) {
        Debug.Log(error);
    }
}