浏览代码

GC fix (120B)

/stochastic_alpha_test
Thomas 7 年前
当前提交
18ef6174
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 6
      ScriptableRenderPipeline/HDRenderPipeline/Camera/HDCamera.cs

6
ScriptableRenderPipeline/HDRenderPipeline/Camera/HDCamera.cs


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;

正在加载...
取消
保存