浏览代码

Intial debug view implementation.

/projects-TheLastStand
John Parsaie 7 年前
当前提交
8953ccf9
共有 1 个文件被更改,包括 3 次插入12 次删除
  1. 15
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs

15
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


private int m_ShadowCasterCascadesCount;
private int m_ShadowMapRTID;
private int m_ScreenSpaceShadowMapRTID;
private int m_DebugViewRTID;
private RenderTargetIdentifier m_DebugViewRT;
private RenderTargetIdentifier m_ColorRT;
private RenderTargetIdentifier m_CopyColorRT;
private RenderTargetIdentifier m_DepthRT;

m_ShadowMapRTID = Shader.PropertyToID("_ShadowMap");
m_ScreenSpaceShadowMapRTID = Shader.PropertyToID("_ScreenSpaceShadowMap");
m_DebugViewRTID = Shader.PropertyToID("_DebugViewRT");
CameraRenderTargetID.color = Shader.PropertyToID("_CameraColorRT");
CameraRenderTargetID.copyColor = Shader.PropertyToID("_CameraCopyColorRT");
CameraRenderTargetID.depth = Shader.PropertyToID("_CameraDepthTexture");

m_ScreenSpaceShadowMapRT = new RenderTargetIdentifier(m_ScreenSpaceShadowMapRTID);
m_DebugViewRT = new RenderTargetIdentifier(m_DebugViewRTID);
m_ColorRT = new RenderTargetIdentifier(CameraRenderTargetID.color);
m_CopyColorRT = new RenderTargetIdentifier(CameraRenderTargetID.copyColor);
m_DepthRT = new RenderTargetIdentifier(CameraRenderTargetID.depth);

}
private void DebugViewPass(FrameRenderingConfiguration frameRenderingConfiguration, ref ScriptableRenderContext context, bool stereoEnabled)
{
//Set up buffers.
//CommandBuffer cmd = CommandBufferPool.Get("Debug View");
//cmd.GetTemporaryRT(m_DebugViewRTID, m_CurrCamera.pixelWidth, m_CurrCamera.pixelHeight, 0, FilterMode.Point, RenderTextureFormat.ARGB32);
//SetRenderTarget(cmd, m_DebugViewRT, ClearFlag.Color);
//context.ExecuteCommandBuffer(cmd);
{
CommandBuffer cmd = CommandBufferPool.Get("Debug View Mode");
LightweightShaderUtils.ResetDebugModes(cmd);

context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
//Draw
var debugViewDrawSettings = new DrawRendererSettings(m_CurrCamera, m_DebugViewPass);
debugViewDrawSettings.sorting.flags = SortFlags.CommonOpaque;

正在加载...
取消
保存