int Depth { get; set; }

robot_2Generated
code_blocksInput

Description

The Depth property of the Texture class represents the depth of a 3D texture in pixels. For 2D texture arrays, it indicates the slice count, and for cubemaps, it is set to 6, representing the six faces of the cube.

Usage

Use the Depth property to determine the depth or slice count of a texture. This is particularly useful when working with 3D textures, texture arrays, or cubemaps, where understanding the depth or number of slices is crucial for correct texture manipulation and rendering.

Example

// Example of accessing the Depth property
Texture myTexture = new Texture();
int textureDepth = myTexture.Depth;

// Use the depth value for logic
if (textureDepth == 6)
{
    // This is a cubemap
    // Perform operations specific to cubemaps
}