浏览代码

minor update

/feature-ReflectionProbeFit
sebastienlagarde 7 年前
当前提交
06922d8a
共有 2 个文件被更改,包括 14 次插入20 次删除
  1. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDCustomSamplerId.cs
  2. 31
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs

3
ScriptableRenderPipeline/HDRenderPipeline/HDCustomSamplerId.cs


ForwardTransparentDepthPrepass,
RenderForwardError,
TransparentDepthPostPass,
Velocity,
ObjectsVelocity,
CameraVelocity,
GaussianPyramidColor,
PyramidDepth,
PostProcessing,

31
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


}
}
void RenderObjectsVelocity(CullResults cullResults, HDCamera hdcam, ScriptableRenderContext renderContext, CommandBuffer cmd)
void RenderObjectsVelocity(CullResults cullResults, HDCamera hdcamera, ScriptableRenderContext renderContext, CommandBuffer cmd)
using (new ProfilingSample(cmd, "Velocity", GetSampler(CustomSamplerId.Velocity)))
using (new ProfilingSample(cmd, "Objects Velocity", GetSampler(CustomSamplerId.ObjectsVelocity)))
hdcam.camera.depthTextureMode |= DepthTextureMode.MotionVectors | DepthTextureMode.Depth;
int w = (int)hdcam.screenSize.x;
int h = (int)hdcam.screenSize.y;
hdcamera.camera.depthTextureMode |= DepthTextureMode.MotionVectors | DepthTextureMode.Depth;
RenderOpaqueRenderList(cullResults, hdcam.camera, renderContext, cmd, HDShaderPassNames.s_MotionVectorsName, RendererConfiguration.PerObjectMotionVectors);
RenderOpaqueRenderList(cullResults, hdcamera.camera, renderContext, cmd, HDShaderPassNames.s_MotionVectorsName, RendererConfiguration.PerObjectMotionVectors);
void RenderCameraVelocity(CullResults cullResults, HDCamera hdcam, ScriptableRenderContext renderContext, CommandBuffer cmd)
void RenderCameraVelocity(CullResults cullResults, HDCamera hdcamera, ScriptableRenderContext renderContext, CommandBuffer cmd)
using (new ProfilingSample(cmd, "Velocity", GetSampler(CustomSamplerId.Velocity)))
using (new ProfilingSample(cmd, "Camera Velocity", GetSampler(CustomSamplerId.CameraVelocity)))
hdcam.camera.depthTextureMode |= DepthTextureMode.MotionVectors | DepthTextureMode.Depth;
hdcamera.camera.depthTextureMode |= DepthTextureMode.MotionVectors | DepthTextureMode.Depth;
int w = (int)hdcam.screenSize.x;
int h = (int)hdcam.screenSize.y;
// TODO: This is not safe ? as we don't use cmd buffer we can have a delay no ?
m_CameraMotionVectorsMaterial.SetVector(HDShaderIDs._CameraPosDiff, hdcamera.prevCameraPos - hdcamera.cameraPos);
// TODO: This is not safe ? as we don't use cmd buffer we can have a dealy no ?
m_CameraMotionVectorsMaterial.SetVector(HDShaderIDs._CameraPosDiff, hdcam.prevCameraPos - hdcam.cameraPos);
// Setup stencil buffer
CoreUtils.DrawFullScreen(cmd, m_CameraMotionVectorsMaterial, m_VelocityBufferRT, m_CameraDepthStencilBufferRT, null, 0);
cmd.ReleaseTemporaryRT(m_VelocityBuffer);
cmd.GetTemporaryRT(m_VelocityBuffer, w, h, 0, FilterMode.Point, Builtin.GetVelocityBufferFormat(), Builtin.GetVelocityBufferReadWrite());
CoreUtils.DrawFullScreen(cmd, m_CameraMotionVectorsMaterial, m_VelocityBufferRT, null, 0);
PushFullScreenDebugTexture(cmd, m_VelocityBuffer, hdcam.camera, renderContext, FullScreenDebugMode.MotionVectors);
PushFullScreenDebugTexture(cmd, m_VelocityBuffer, hdcamera.camera, renderContext, FullScreenDebugMode.MotionVectors);
}
}

正在加载...
取消
保存