|
|
|
|
|
|
public Matrix4x4 projMatrix; |
|
|
|
public Matrix4x4 nonJitteredProjMatrix; |
|
|
|
public Vector4 screenSize; |
|
|
|
public Plane[] frustumPlanes; |
|
|
|
public Vector4[] frustumPlaneEquations; |
|
|
|
public Camera camera; |
|
|
|
|
|
|
|
|
|
|
public HDCamera(Camera cam) |
|
|
|
{ |
|
|
|
camera = cam; |
|
|
|
frustumPlanes = new Plane[6]; |
|
|
|
frustumPlaneEquations = new Vector4[6]; |
|
|
|
Reset(); |
|
|
|
} |
|
|
|
|
|
|
cameraPos = pos; |
|
|
|
screenSize = new Vector4(camera.pixelWidth, camera.pixelHeight, 1.0f / camera.pixelWidth, 1.0f / camera.pixelHeight); |
|
|
|
|
|
|
|
var planes = GeometryUtility.CalculateFrustumPlanes(viewProjMatrix); |
|
|
|
GeometryUtility.CalculateFrustumPlanes(viewProjMatrix, frustumPlanes); |
|
|
|
frustumPlaneEquations[i] = new Vector4(planes[i].normal.x, planes[i].normal.y, planes[i].normal.z, planes[i].distance); |
|
|
|
frustumPlaneEquations[i] = new Vector4(frustumPlanes[i].normal.x, frustumPlanes[i].normal.y, frustumPlanes[i].normal.z, frustumPlanes[i].distance); |
|
|
|
} |
|
|
|
|
|
|
|
m_LastFrameActive = Time.frameCount; |
|
|
|