Class RTHandle
A RTHandle is a RenderTexture that scales automatically with the camera size. This allows proper reutilization of RenderTexture memory when different cameras with various sizes are used during rendering. RTHandleSystem
Inherited Members
Namespace: UnityEngine.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public class RTHandle
Properties
Name | Description |
---|---|
isMSAAEnabled | Returns true is MSAA is enabled, false otherwise. |
name | Name of the RTHandle |
nameID | RenderTargetIdentifier associated with the RTHandle |
referenceSize | Reference size of the RTHandle System associated with the RTHandle |
rt | RenderTexture associated with the RTHandle |
rtHandleProperties | Current properties of the RTHandle System. If a custom property has been set through SetCustomHandleProperties method, it will be used that one instead. |
scaleFactor | Scale factor applied to the RTHandle reference size. |
useScaling | Returns true if the RTHandle uses automatic scaling. |
Methods
Name | Description |
---|---|
ClearCustomHandleProperties() | Method that clears any custom handle property being set. |
CopyToFastMemory(CommandBuffer, float, FastMemoryFlags) | Switch the render target to fast memory on platform that have it and copies the content. |
GetInstanceID() | Get the Instance ID of the RTHandle. |
GetScaledSize() | Return the scaled size of the RTHandle. |
GetScaledSize(Vector2Int) | Return the input size, scaled by the RTHandle scale factor. |
Release() | Release the RTHandle |
SetCustomHandleProperties(in RTHandleProperties) | By default, rtHandleProperties gets the global state of scalers against the global reference mode. This method lets the current RTHandle use a local custom RTHandleProperties. This function is being used by scalers such as TAAU and DLSS, which require to have a different resolution for color (independent of the RTHandleSystem). |
SwitchOutFastMemory(CommandBuffer, bool) | Switch out the render target from fast memory back to main memory on platforms that have fast memory. |
SwitchToFastMemory(CommandBuffer, float, FastMemoryFlags, bool) | Switch the render target to fast memory on platform that have it. |
Operators
Name | Description |
---|---|
implicit operator RenderTexture(RTHandle) | Implicit conversion operator to RenderTexture |
implicit operator RenderTargetIdentifier(RTHandle) | Implicit conversion operator to RenderTargetIdentifier |
implicit operator Texture(RTHandle) | Implicit conversion operator to Texture |