浏览代码

Merge pull request #719 from Unity-Technologies/Fix-downsample-Depth

HDRenderPipeline: Fix downsample depth to work with reversed depth
/feature-ReflectionProbeFit
GitHub 7 年前
当前提交
36673186
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/DepthDownsample.compute

5
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/DepthDownsample.compute


float2 offset = float2(threadUL) * 2.0f + 1.0f;
float4 depths = _Source.GatherRed(sampler_PointClamp, offset * _SrcSize.zw, 0.0);
// Select the nearest sample
#if UNITY_REVERSED_Z
float minDepth = max(min(depths.x, depths.y), max(depths.z, depths.w));
#else
#endif
// Write to the final target
_Result[dispatchThreadId] = minDepth;
正在加载...
取消
保存