浏览代码

Don't reject distortion on z when applying

/stochastic_alpha_test
Frédéric Vauchelles 7 年前
当前提交
e9e9db20
共有 2 个文件被更改,包括 1 次插入7 次删除
  1. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 7
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/ApplyDistorsion.compute

1
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


cmd.SetComputeTextureParam(resources.applyDistortionCS, resources.applyDistortionKernel, HDShaderIDs._DepthPyramidTexture, m_DepthPyramidBufferRT);
cmd.SetComputeTextureParam(resources.applyDistortionCS, resources.applyDistortionKernel, HDShaderIDs._CameraColorTexture, m_CameraColorBufferRT);
cmd.SetComputeVectorParam(resources.applyDistortionCS, HDShaderIDs._Size, size);
cmd.SetComputeVectorParam(resources.applyDistortionCS, HDShaderIDs._ZBufferParams, Shader.GetGlobalVector(HDShaderIDs._ZBufferParams));
cmd.SetComputeVectorParam(resources.applyDistortionCS, HDShaderIDs._GaussianPyramidColorMipSize, Shader.GetGlobalVector(HDShaderIDs._GaussianPyramidColorMipSize));
cmd.DispatchCompute(resources.applyDistortionCS, resources.applyDistortionKernel, (int)(size.x) / (int)x, (int)(size.y) / (int)y, 1);
}

7
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/ApplyDistorsion.compute


float mip = (_GaussianPyramidColorMipSize.z - 1) * clamp(distorsionBlur.x, 0.0, 1.0);
float4 sampled = _GaussianPyramidColorTexture.SampleLevel(sampler_GaussianPyramidColorTexture, distordedUV, mip);
float2 uv = float2(dispatchThreadId) * _Size.zw;
float depth = _PyramidDepthTexture.SampleLevel(sampler_PyramidDepthTexture, uv, 0).r;
float distordedDepth = _PyramidDepthTexture.SampleLevel(sampler_PyramidDepthTexture, distordedUV, 0).r;
//if (depth < distordedDepth)
_CameraColorTexture[dispatchThreadId] = sampled;
_CameraColorTexture[dispatchThreadId] = sampled;
}
正在加载...
取消
保存