Skip to content

Commit eef7248

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.5] [HDRP] Fix volumetric clouds white flickering when camera is moving with close alpha clipped geometry
1 parent 26424d6 commit eef7248

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

  • Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting

Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/BilateralUpsample.hlsl

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ void BilUpColor3x3(float highDepth, in NeighborhoodUpsampleData3x3 data, out flo
124124

125125
float TotalWeight = combinedWeightsA.x + combinedWeightsA.y + combinedWeightsA.z + combinedWeightsA.w
126126
+ combinedWeightsB.x + combinedWeightsB.y + combinedWeightsB.z + combinedWeightsB.w
127-
+ combinedWeightsC;
127+
+ combinedWeightsC
128+
+ _NoiseFilterStrength;
128129

129130
float4 WeightedSum = data.lowValue0 * combinedWeightsA.x
130131
+ data.lowValue1 * combinedWeightsA.y
@@ -134,25 +135,15 @@ void BilUpColor3x3(float highDepth, in NeighborhoodUpsampleData3x3 data, out flo
134135
+ data.lowValue5 * combinedWeightsB.y
135136
+ data.lowValue6 * combinedWeightsB.z
136137
+ data.lowValue7 * combinedWeightsB.w
137-
+ data.lowValue8 * combinedWeightsC
138-
+ float4(_NoiseFilterStrength.xxx, 0.0f);
138+
+ data.lowValue8 * combinedWeightsC;
139139

140140
float WeightedDepth = dot(data.lowDepthValueA, combinedWeightsA)
141141
+ dot(data.lowDepthValueB, combinedWeightsB)
142142
+ data.lowDepthValueC * combinedWeightsC
143143
+ _NoiseFilterStrength;
144144

145-
// This branch shouldn't be needed if we do the neighbor analysis mentionned in BuildRay
146-
if (TotalWeight == 0.0f)
147-
{
148-
outColor = float4(0, 0, 0, 1);
149-
outDepth = UNITY_NEAR_CLIP_VALUE;
150-
}
151-
else
152-
{
153-
outColor = WeightedSum / (TotalWeight + _NoiseFilterStrength);
154-
outDepth = WeightedDepth / (TotalWeight + _NoiseFilterStrength);
155-
}
145+
outColor = WeightedSum / TotalWeight;
146+
outDepth = WeightedDepth / TotalWeight;
156147
}
157148

158149
// Due to compiler issues, it is not possible to use arrays to store the neighborhood values, we then store them in this structure

0 commit comments

Comments
 (0)