Description
The GrabDepthTexture
method in the CommandList
class is used to capture the current depth texture from the rendering pipeline. This method returns a RenderTargetHandle
which can be used to reference the captured depth texture in subsequent rendering operations.
Usage
To use the GrabDepthTexture
method, you need to provide a unique string token that identifies the texture and a boolean indicating whether mipmaps should be generated for the texture.
Parameters:
token
(System.String): A unique identifier for the depth texture.
withMips
(System.Boolean): A flag indicating whether mipmaps should be generated for the texture.
Returns: RenderTargetHandle
- A handle to the captured depth texture.
Example
// Example usage of GrabDepthTexture
CommandList commandList = new CommandList();
string depthTextureToken = "MyDepthTexture";
bool generateMipmaps = true;
RenderTargetHandle depthTextureHandle = commandList.GrabDepthTexture(depthTextureToken, generateMipmaps);
// Use the depthTextureHandle for further rendering operations