浏览代码

Working version

Still color picker in game and motion vector to fix
/main
sebastienlagarde 7 年前
当前提交
64839789
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs

9
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


cmd.SetGlobalVector(HDShaderIDs._GaussianPyramidColorMipSize, new Vector4(pyramidSideSize, pyramidSideSize, lodCount, 0));
cmd.SetGlobalTexture(HDShaderIDs._MainTex, m_CameraColorBufferRT);
cmd.SetGlobalTexture(HDShaderIDs._BlitTexture, m_CameraColorBufferRT);
CoreUtils.DrawFullScreen(cmd, m_Blit, m_GaussianPyramidColorBufferRT, null, 1); // Bilinear filtering
var last = m_GaussianPyramidColorBuffer;

}
}
public void PushColorPickerDebugTexture(CommandBuffer cmd, RenderTargetIdentifier textureID, HDCamera hdCamera)
// allowFlip is false if we call the function after the FinalPass or cmd.Blit that flip the screen
public void PushColorPickerDebugTexture(CommandBuffer cmd, RenderTargetIdentifier textureID, HDCamera hdCamera, bool allowFlip = true)
{
if (m_CurrentDebugDisplaySettings.colorPickerDebugSettings.colorPickerMode != ColorPickerDebugMode.None)
{

// Mean that when we push the buffer here, we need to flip it to display correctly.
bool flipY = hdCamera.camera.cameraType != CameraType.SceneView;
bool flipY = hdCamera.camera.cameraType != CameraType.SceneView && allowFlip;
m_BlitFlipMip.SetFloat(HDShaderIDs._MipIndex, 0);
cmd.Blit(textureID, m_DebugColorPickerRT, m_BlitFlipMip, flipY ? 2 : 0); // 2 is nearest filtering and flip the image on Y, 1 is without flip
}

m_DebugFullScreen.SetFloat(HDShaderIDs._FullScreenDebugMode, (float)m_CurrentDebugDisplaySettings.fullScreenDebugMode);
CoreUtils.DrawFullScreen(cmd, m_DebugFullScreen, (RenderTargetIdentifier)BuiltinRenderTextureType.CameraTarget);
PushColorPickerDebugTexture(cmd, m_DebugFullScreenTempRT, hdCamera);
PushColorPickerDebugTexture(cmd, m_DebugFullScreenTempRT, hdCamera, false); // We are in RenderDebug() here so we msut not flip the copy
}
// Then overlays

正在加载...
取消
保存