|
|
|
|
|
|
|
|
|
|
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; |
|
|
|