浏览代码

Use FrameSettings more appropriately

Pass in FrameSettings or use m_FrameSettings where available (PR feedback)
/feature-ReflectionProbeFit
Robert Srinivasiah 7 年前
当前提交
f77d89b1
共有 2 个文件被更改,包括 9 次插入9 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs
  2. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs


Reset();
}
public void Update(PostProcessLayer postProcessLayer, bool stereoEnabled)
public void Update(PostProcessLayer postProcessLayer, FrameSettings frameSettings)
{
// If TAA is enabled projMatrix will hold a jittered projection matrix. The original,
// non-jittered projection matrix can be accessed via nonJitteredProjMatrix.

m_LastFrameActive = Time.frameCount;
RenderTextureDescriptor tempDesc;
if (stereoEnabled)
if (frameSettings.enableStereo)
{
screenSize = new Vector4(XRSettings.eyeTextureWidth, XRSettings.eyeTextureHeight, 1.0f / XRSettings.eyeTextureWidth, 1.0f / XRSettings.eyeTextureHeight);
tempDesc = XRSettings.eyeTextureDesc;

}
// Grab the HDCamera tied to a given Camera and update it.
public static HDCamera Get(Camera camera, PostProcessLayer postProcessLayer, bool stereoEnabled)
public static HDCamera Get(Camera camera, PostProcessLayer postProcessLayer, FrameSettings frameSettings)
{
HDCamera hdcam;

s_Cameras.Add(camera, hdcam);
}
hdcam.Update(postProcessLayer, stereoEnabled);
hdcam.Update(postProcessLayer, frameSettings);
return hdcam;
}

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


}
var postProcessLayer = camera.GetComponent<PostProcessLayer>();
var hdCamera = HDCamera.Get(camera, postProcessLayer, m_FrameSettings.enableStereo);
var hdCamera = HDCamera.Get(camera, postProcessLayer, m_FrameSettings);
Resize(hdCamera);

}
ConfigureForShadowMask(enableBakeShadowMask, cmd);
InitAndClearBuffer(hdCamera, enableBakeShadowMask, cmd, m_FrameSettings.enableStereo);
InitAndClearBuffer(hdCamera, enableBakeShadowMask, cmd);
RenderDepthPrepass(m_CullResults, hdCamera, renderContext, cmd);

}
}
void InitAndClearBuffer(HDCamera hdCamera, bool enableBakeShadowMask, CommandBuffer cmd, bool stereoEnabled)
void InitAndClearBuffer(HDCamera hdCamera, bool enableBakeShadowMask, CommandBuffer cmd)
{
using (new ProfilingSample(cmd, "InitAndClearBuffer", GetSampler(CustomSamplerId.InitAndClearBuffer)))
{

// Color and depth pyramids
m_GaussianPyramidColorBufferDesc = BuildPyramidDescriptor(hdCamera, PyramidType.Color, stereoEnabled);
m_GaussianPyramidColorBufferDesc = BuildPyramidDescriptor(hdCamera, PyramidType.Color, m_FrameSettings.enableStereo);
m_DepthPyramidBufferDesc = BuildPyramidDescriptor(hdCamera, PyramidType.Depth, stereoEnabled);
m_DepthPyramidBufferDesc = BuildPyramidDescriptor(hdCamera, PyramidType.Depth, m_FrameSettings.enableStereo);
cmd.ReleaseTemporaryRT(m_DepthPyramidBuffer);
cmd.GetTemporaryRT(m_DepthPyramidBuffer, m_DepthPyramidBufferDesc, FilterMode.Trilinear);

正在加载...
取消
保存