@chap-unity I put Claude on this and the issue seems entirely fixed.
In case its helpful, here’s the summary:
Volumetric Clouds — fix dark-speckle flicker on alpha-clipped edges (ghosting reduction)
File: Packages/com.unity.render-pipelines.high-definition@<hash>/Runtime/Lighting/VolumetricClouds/VolumetricClouds.compute
Kernel: ReprojectCloudsRejection (the WITH_REJECTION path of REPROJECT_CLOUDS, used only when Ghosting Reduction is enabled)
Location: inside the #ifdef WITH_REJECTION block of REPROJECT_CLOUDS (~line 98).
Problem: At thin alpha-clipped foliage edges against clear sky, the checkerboard depth classification can leave a sky-classified center pixel with zero neighbors of matching classification. The neighborhood min/max box is then never initialized and stays inverted (min.w = 1.0, max.w = 0.0). ClipCloudsToRegion → clamp(history.w, 1.0, 0.0) collapses transmittance to 0, forcing an opaque pixel (black where there is no cloud light) that locks into temporal accumulation → dark flicker speckle.
Change: Count valid neighbors during the 3×3 gather and only call ClipCloudsToRegion when at least one was found.
Diff:
#ifdef WITH_REJECTION
float4 lightingMin = float4(FLT_MAX, FLT_MAX, FLT_MAX, 1.0);
float4 lightingMax = float4(0, 0, 0, 0.0);
+ int validNeighborCount = 0;
for (int y = -1; y <= 1; ++y)
{
for (int x = -1; x <= 1; ++x)
{
CloudReprojectionData data = GetCloudReprojectionDataSample(threadCoord, int2(x, y));
if ((data.pixelDepth == UNITY_RAW_FAR_CLIP_VALUE) == (currentSceneDepth == UNITY_RAW_FAR_CLIP_VALUE))
{
lightingMin = min(lightingMin, data.cloudLighting);
lightingMax = max(lightingMax, data.cloudLighting);
+ validNeighborCount++;
}
}
}
- previousColor = ClipCloudsToRegion(previousColor, lightingMin, lightingMax, validityFactor);
+ // Only clip against the neighborhood when we actually gathered one. [see comment in file]
+ if (validNeighborCount > 0)
+ previousColor = ClipCloudsToRegion(previousColor, lightingMin, lightingMax, validityFactor);
#endif
Risk/side-effects: When no valid neighbor exists (rare, single-frame), the reprojected history is trusted un-clamped — at most a pixel of mild ghosting on that frame, versus a locked-in black flash. No API or signature changes; no other files touched.
Verified against HDRP version: 17.3.0 (com.unity.render-pipelines.high-definition@760a5b94e0f4).