浏览代码

HDRenderPipeline: Fix display of debug pyramid

/main
sebastienlagarde 7 年前
当前提交
aea87dab
共有 2 个文件被更改,包括 12 次插入10 次删除
  1. 20
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/DepthPyramid.compute

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


#include "../Debug/DebugDisplay.cs.hlsl"
TEXTURE2D(_DebugFullScreenTexture);
SAMPLER(sampler_DebugFullScreenTexture);
float _FullScreenDebugMode;
float _RequireToFlipInputTexture;

float2 SampleMotionVectors(float2 coords)
{
return SAMPLE_TEXTURE2D(_DebugFullScreenTexture, sampler_DebugFullScreenTexture, coords).xy;
return SAMPLE_TEXTURE2D(_DebugFullScreenTexture, s_point_clamp_sampler, coords).xy;
}
// end motion vector utilties

// SSAO
if (_FullScreenDebugMode == FULLSCREENDEBUGMODE_SSAO)
{
return 1.0f - SAMPLE_TEXTURE2D(_DebugFullScreenTexture, sampler_DebugFullScreenTexture, input.texcoord).xxxx;
return 1.0f - SAMPLE_TEXTURE2D(_DebugFullScreenTexture, s_point_clamp_sampler, input.texcoord).xxxx;
float4 color = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, sampler_DebugFullScreenTexture, input.texcoord);
float4 color = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, s_point_clamp_sampler, input.texcoord);
if (AnyIsNan(color) || any(isinf(color)))
{
color = float4(1.0, 0.0, 0.0, 1.0);

}
if (_FullScreenDebugMode == FULLSCREENDEBUGMODE_DEFERRED_SHADOWS)
{
float4 color = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, sampler_DebugFullScreenTexture, input.texcoord);
float4 color = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, s_point_clamp_sampler, input.texcoord);
float4 color = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, sampler_DebugFullScreenTexture, input.texcoord);
float4 color = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, s_point_clamp_sampler, input.texcoord);
float4 color = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, sampler_DebugFullScreenTexture, input.texcoord);
return float4(color.rrr / (color.rrr + 1), 1.0);
// Reuse depth display function from DebugViewMaterial
float depth = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, s_point_clamp_sampler, input.texcoord).r;
PositionInputs posInput = GetPositionInput(input.positionCS.xy, _ScreenSize.zw, depth, UNITY_MATRIX_I_VP, UNITY_MATRIX_VP);
float linearDepth = frac(posInput.linearDepth * 0.1);
return float4(linearDepth.xxx, 1.0);
}
return float4(0.0, 0.0, 0.0, 0.0);

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/DepthPyramid.compute


// Select the nearest sample
#if UNITY_REVERSED_Z
float minDepth = max(min(depths.x, depths.y), max(depths.z, depths.w));
float minDepth = max(max(depths.x, depths.y), max(depths.z, depths.w));
#else
float minDepth = min(min(depths.x, depths.y), min(depths.z, depths.w));
#endif

正在加载...
取消
保存