namespace UnityEngine.Rendering.HighDefinition
{
/// Properties computed during a frame rendering.
public struct RenderOutputProperties
{
/// The size of the output in pixels.
public readonly Vector2Int outputSize;
/// World to camera matrix. (Right Hand Side).
public readonly Matrix4x4 cameraToWorldMatrixRHS;
/// Projection matrix.
public readonly Matrix4x4 projectionMatrix;
/// Creates a new FrameProperties.
///
///
///
public RenderOutputProperties(Vector2Int outputSize, Matrix4x4 cameraToWorldMatrixRhs, Matrix4x4 projectionMatrix)
{
this.outputSize = outputSize;
cameraToWorldMatrixRHS = cameraToWorldMatrixRhs;
this.projectionMatrix = projectionMatrix;
}
/// Creates a new FrameProperties from an .
/// The camera to use.
internal static RenderOutputProperties From(HDCamera hdCamera)
=> new RenderOutputProperties(
new Vector2Int(hdCamera.actualWidth, hdCamera.actualHeight),
hdCamera.camera.cameraToWorldMatrix,
hdCamera.mainViewConstants.projMatrix
);
}
}