浏览代码

Removed incorrect depth rejection related code

/stochastic_alpha_test
Frédéric Vauchelles 7 年前
当前提交
8706747e
共有 3 个文件被更改,包括 6 次插入15 次删除
  1. 7
      ScriptableRenderPipeline/HDRenderPipeline/Material/Builtin/BuiltinData.hlsl
  2. 12
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/ApplyDistorsion.compute
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassDistortion.hlsl

7
ScriptableRenderPipeline/HDRenderPipeline/Material/Builtin/BuiltinData.hlsl


velocity = inBuffer.xy;
}
void EncodeDistortion(float2 distortion, float distortionBlur, float depthRaw, out float4 outBuffer)
void EncodeDistortion(float2 distortion, float distortionBlur, out float4 outBuffer)
outBuffer = float4(distortion, depthRaw, distortionBlur);
outBuffer = float4(distortion, 0.0, distortionBlur);
void DecodeDistortion(float4 inBuffer, out float2 distortion, out float2 distortionBlur, out float depthRaw)
void DecodeDistortion(float4 inBuffer, out float2 distortion, out float2 distortionBlur)
depthRaw = inBuffer.z;
}
void GetBuiltinDataDebug(uint paramId, BuiltinData builtinData, inout float3 result, inout bool needLinearToSRGB)

12
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/ApplyDistorsion.compute


float2 distortion;
float2 distortionBlur;
float depthRaw;
DecodeDistortion(encodedDistortion, distortion, distortionBlur, depthRaw);
DecodeDistortion(encodedDistortion, distortion, distortionBlur);
// Discard pixels that are in front of the distortion object
float distordedDepth = LOAD_TEXTURE2D(_DepthTexture, distortedEncodedDistortionId).r;
/*if (distordedDepth > depthRaw)
return;*/
float distordedObjectDepth;
DecodeDistortion(encodedDistordedDistortion, distordedDistortion, distordedDistortionBlur, distordedObjectDepth);
DecodeDistortion(encodedDistordedDistortion, distordedDistortion, distordedDistortionBlur);
// Get source pixel for distortion
float2 distordedUV = float2(dispatchThreadId + int2(distortion * _FetchBias)) * _Size.zw;

2
ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassDistortion.hlsl


GetSurfaceAndBuiltinData(input, V, posInput, surfaceData, builtinData);
float4 outBuffer;
EncodeDistortion(builtinData.distortion, builtinData.distortionBlur, posInput.depthRaw, outBuffer);
EncodeDistortion(builtinData.distortion, builtinData.distortionBlur, outBuffer);
return outBuffer;
}
正在加载...
取消
保存