浏览代码

Added a NaN/Inf tracker to the debug modes

/RenderPassXR_Sandbox
Thomas Hourdel 7 年前
当前提交
c4976158
共有 4 个文件被更改,包括 25 次插入1 次删除
  1. 3
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
  2. 1
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs.hlsl
  3. 20
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugFullScreen.shader
  4. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs

3
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs


None,
SSAO,
SSAOBeforeFiltering,
MotionVectors
MotionVectors,
NanTracker
}
[Serializable]

1
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs.hlsl


#define FULLSCREENDEBUGMODE_SSAO (1)
#define FULLSCREENDEBUGMODE_SSAOBEFORE_FILTERING (2)
#define FULLSCREENDEBUGMODE_MOTION_VECTORS (3)
#define FULLSCREENDEBUGMODE_NAN_TRACKER (4)
#endif

20
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugFullScreen.shader


{
return 1.0f - SAMPLE_TEXTURE2D(_DebugFullScreenTexture, sampler_DebugFullScreenTexture, input.texcoord).xxxx;
}
if (_FullScreenDebugMode == FULLSCREENDEBUGMODE_NAN_TRACKER)
{
#if UNITY_UV_STARTS_AT_TOP
input.texcoord.y = 1.0 - input.texcoord.y;
#endif
float4 color = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, sampler_DebugFullScreenTexture, input.texcoord);
if (any(isnan(color)) || any(isinf(color)))
{
color = float4(1.0, 0.0, 1.0, 1.0);
}
else
{
// Dim the color buffer so we can see NaNs & Infs better
color.rgb *= 0.25;
}
return color;
}
if (_FullScreenDebugMode == FULLSCREENDEBUGMODE_MOTION_VECTORS)
{
float2 mv = SampleMotionVectors(input.texcoord);

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


// Render all type of transparent forward (unlit, lit, complex (hair...)) to keep the sorting between transparent objects.
RenderForward(m_CullResults, camera, renderContext, cmd, false);
PushFullScreenDebugTexture(cmd, m_CameraColorBuffer, camera, renderContext, FullScreenDebugMode.NanTracker);
// Planar and real time cubemap doesn't need post process and render in FP16
if (camera.cameraType == CameraType.Reflection)
{

正在加载...
取消
保存