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
Namespace: UnityEngine.Rendering
Syntax
public class RTHandle
Properties
name
Name of the RTHandle
Declaration
public string name { get; }
Property Value
Type | Description |
---|---|
String |
nameID
RenderTargetIdentifier associated with the RTHandle
Declaration
public RenderTargetIdentifier nameID { get; }
Property Value
Type | Description |
---|---|
RenderTargetIdentifier |
referenceSize
Reference size of the RTHandle System associated with the RTHandle
Declaration
public Vector2Int referenceSize { get; }
Property Value
Type | Description |
---|---|
Vector2Int |
rt
RenderTexture associated with the RTHandle
Declaration
public RenderTexture rt { get; }
Property Value
Type | Description |
---|---|
RenderTexture |
rtHandleProperties
Current properties of the RTHandle System
Declaration
public RTHandleProperties rtHandleProperties { get; }
Property Value
Type | Description |
---|---|
RTHandleProperties |
scaleFactor
Scale factor applied to the RTHandle reference size.
Declaration
public Vector2 scaleFactor { get; }
Property Value
Type | Description |
---|---|
Vector2 |
useScaling
Returns true if the RTHandle uses automatic scaling.
Declaration
public bool useScaling { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
GetScaledSize(Vector2Int)
Return the input size, scaled by the RTHandle scale factor.
Declaration
public Vector2Int GetScaledSize(Vector2Int refSize)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | refSize | Input size |
Returns
Type | Description |
---|---|
Vector2Int | Input size scaled by the RTHandle scale factor. |
Release()
Release the RTHandle
Declaration
public void Release()
Operators
Implicit(RTHandle to RenderTargetIdentifier)
Implicit conversion operator to RenderTargetIdentifier
Declaration
public static implicit operator RenderTargetIdentifier(RTHandle handle)
Parameters
Type | Name | Description |
---|---|---|
RTHandle | handle | Input RTHandle |
Returns
Type | Description |
---|---|
RenderTargetIdentifier | RenderTargetIdentifier representation of the RTHandle. |
Implicit(RTHandle to RenderTexture)
Implicit conversion operator to RenderTexture
Declaration
public static implicit operator RenderTexture(RTHandle handle)
Parameters
Type | Name | Description |
---|---|---|
RTHandle | handle | Input RTHandle |
Returns
Type | Description |
---|---|
RenderTexture | RenderTexture representation of the RTHandle. |
Implicit(RTHandle to Texture)
Implicit conversion operator to Texture
Declaration
public static implicit operator Texture(RTHandle handle)
Parameters
Type | Name | Description |
---|---|---|
RTHandle | handle | Input RTHandle |
Returns
Type | Description |
---|---|
Texture | Texture representation of the RTHandle. |