Class HDCamera
HDCamera class. This class holds all information for a given camera. Constants used for shading as well as buffers persistent from one frame to another etc.
Namespace: UnityEngine.Rendering.HighDefinition
Syntax
public class HDCamera : object
Fields
camera
Camera component.
Declaration
public Camera camera
Field Value
| Type | Description |
|---|---|
| Camera |
colorPyramidHistoryIsValid
Color pyramid history buffer state.
Declaration
public bool colorPyramidHistoryIsValid
Field Value
| Type | Description |
|---|---|
| Boolean |
frustum
Camera frustum.
Declaration
public Frustum frustum
Field Value
| Type | Description |
|---|---|
| Frustum |
mainViewConstants
View constants.
Declaration
public HDCamera.ViewConstants mainViewConstants
Field Value
| Type | Description |
|---|---|
| HDCamera.ViewConstants |
screenSize
Screen resolution information. Width, height, inverse width, inverse height.
Declaration
public Vector4 screenSize
Field Value
| Type | Description |
|---|---|
| Vector4 |
taaJitter
TAA jitter information.
Declaration
public Vector4 taaJitter
Field Value
| Type | Description |
|---|---|
| Vector4 |
time
Current time for this camera.
Declaration
public float time
Field Value
| Type | Description |
|---|---|
| Single |
volumetricHistoryIsValid
Volumetric history buffer state.
Declaration
public bool volumetricHistoryIsValid
Field Value
| Type | Description |
|---|---|
| Boolean |
Properties
actualHeight
Height actually used for rendering after dynamic resolution and XR is applied.
Declaration
public int actualHeight { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
actualWidth
Width actually used for rendering after dynamic resolution and XR is applied.
Declaration
public int actualWidth { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
frameSettings
Frame settings for this camera.
Declaration
public FrameSettings frameSettings { get; }
Property Value
| Type | Description |
|---|---|
| FrameSettings |
historyRTHandleProperties
RTHandle properties for the camera history buffers.
Declaration
public RTHandleProperties historyRTHandleProperties { get; }
Property Value
| Type | Description |
|---|---|
| RTHandleProperties |
msaaSamples
Number of MSAA samples used for this frame.
Declaration
public MSAASamples msaaSamples { get; }
Property Value
| Type | Description |
|---|---|
| MSAASamples |
volumeStack
Volume stack used for this camera.
Declaration
public VolumeStack volumeStack { get; }
Property Value
| Type | Description |
|---|---|
| VolumeStack |
Methods
AllocHistoryFrameRT(Int32, Func<String, Int32, RTHandleSystem, RTHandle>, Int32)
Allocates a history RTHandle with the unique identifier id.
Declaration
public RTHandle AllocHistoryFrameRT(int id, Func<string, int, RTHandleSystem, RTHandle> allocator, int bufferCount)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | id | Unique id for this history buffer. |
| Func<String, Int32, RTHandleSystem, RTHandle> | allocator | Allocator function for the history RTHandle. |
| Int32 | bufferCount | Number of buffer that should be allocated. |
Returns
| Type | Description |
|---|---|
| RTHandle | A new RTHandle. |
GetCurrentFrameRT(Int32)
Returns the id RTHandle of the current frame.
Declaration
public RTHandle GetCurrentFrameRT(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | id | Id of the history RTHandle. |
Returns
| Type | Description |
|---|---|
| RTHandle | The RTHandle of the current frame. |
GetOrCreate(Camera, Int32)
Get the existing HDCamera for the provided camera or create a new if it does not exist yet.
Declaration
public static HDCamera GetOrCreate(Camera camera, int xrMultipassId = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera | camera | Camera for which the HDCamera is needed. |
| Int32 | xrMultipassId | XR multi-pass Id. |
Returns
| Type | Description |
|---|---|
| HDCamera |
GetPreviousFrameRT(Int32)
Returns the id RTHandle from the previous frame.
Declaration
public RTHandle GetPreviousFrameRT(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | id | Id of the history RTHandle. |
Returns
| Type | Description |
|---|---|
| RTHandle | The RTHandle from previous frame. |
Reset()
Reset the camera persistent informations. This needs to be used when doing camera cuts for example in order to avoid information from previous unrelated frames to be used.
Declaration
public void Reset()