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.
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
Assembly: Unity.RenderPipelines.HighDefinition.Runtime.dll
Syntax
public class HDCamera
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 |
---|---|
bool |
currentSSRAlgorithm
Store current algorithm which help to know if we trigger to reset history SSR Buffers.
Declaration
public ScreenSpaceReflectionAlgorithm currentSSRAlgorithm
Field Value
Type | Description |
---|---|
ScreenSpaceReflectionAlgorithm |
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 |
materialsDirty
Flag that tracks if one of the objects that is included into the RTAS had its material changed.
Declaration
public bool materialsDirty
Field Value
Type | Description |
---|---|
bool |
rayTracingAccelerationStructure
Ray tracing acceleration structure that is used in case the user specified the build mode as manual for the RTAS.
Declaration
public RayTracingAccelerationStructure rayTracingAccelerationStructure
Field Value
Type | Description |
---|---|
RayTracingAccelerationStructure |
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 |
---|---|
float |
transformsDirty
Flag that tracks if one of the objects that is included into the RTAS had its transform changed.
Declaration
public bool transformsDirty
Field Value
Type | Description |
---|---|
bool |
volumetricHistoryIsValid
Volumetric history buffer state.
Declaration
public bool volumetricHistoryIsValid
Field Value
Type | Description |
---|---|
bool |
Properties
actualHeight
Height actually used for rendering after dynamic resolution and XR is applied.
Declaration
public int actualHeight { get; }
Property Value
Type | Description |
---|---|
int |
actualWidth
Width actually used for rendering after dynamic resolution and XR is applied.
Declaration
public int actualWidth { get; }
Property Value
Type | Description |
---|---|
int |
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 |
msaaEnabled
Returns true if MSAA is enabled for this camera (equivalent to msaaSamples != MSAASamples.None).
Declaration
public bool msaaEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
msaaSamples
Number of MSAA samples used for this frame.
Declaration
public MSAASamples msaaSamples { get; }
Property Value
Type | Description |
---|---|
MSAASamples |
name
Camera name.
Declaration
public string name { get; }
Property Value
Type | Description |
---|---|
string |
postProcessScreenSize
Screen resolution information for post processes passes. Width, height, inverse width, inverse height.
Declaration
public Vector4 postProcessScreenSize { get; }
Property Value
Type | Description |
---|---|
Vector4 |
volumeStack
Volume stack used for this camera.
Declaration
public VolumeStack volumeStack { get; }
Property Value
Type | Description |
---|---|
VolumeStack |
Methods
AllocHistoryFrameRT(int, Func<string, int, RTHandleSystem, RTHandle>, int)
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 |
---|---|---|
int | id | Unique id for this history buffer. |
Func<string, int, RTHandleSystem, RTHandle> | allocator | Allocator function for the history RTHandle. |
int | bufferCount | Number of buffer that should be allocated. |
Returns
Type | Description |
---|---|
RTHandle | A new RTHandle. |
GetCurrentFrameRT(int)
Returns the id RTHandle of the current frame.
Declaration
public RTHandle GetCurrentFrameRT(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id | Id of the history RTHandle. |
Returns
Type | Description |
---|---|
RTHandle | The RTHandle of the current frame. |
GetOrCreate(Camera, int)
Get the existing HDCamera with its history for the provided camera or create a new one 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. |
int | xrMultipassId | XR multi-pass Id. |
Returns
Type | Description |
---|---|
HDCamera |
GetPreviousFrameRT(int)
Returns the id RTHandle from the previous frame.
Declaration
public RTHandle GetPreviousFrameRT(int id)
Parameters
Type | Name | Description |
---|---|---|
int | 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()