Fix Volumetric Fog to not flicker on temporal blend when resizing the screen or changing quality

This commit is contained in:
Wojtek Figat
2026-01-27 13:56:26 +01:00
parent 143d714037
commit 305296883d

View File

@@ -167,8 +167,13 @@ bool VolumetricFogPass::Init(RenderContext& renderContext, GPUContext* context,
(float)_cache.GridSizeZ);
auto& fogData = renderContext.Buffers->VolumetricFogData;
fogData.MaxDistance = options.Distance;
if (renderContext.Task->IsCameraCut || renderContext.View.IsOriginTeleport())
if (renderContext.Task->IsCameraCut ||
renderContext.View.IsOriginTeleport() ||
(renderContext.Buffers->VolumetricFog && renderContext.Buffers->VolumetricFog->Size3() != _cache.GridSize))
{
// Don't blend with history on camera cuts or teleport or resizes
_cache.HistoryWeight = 0.0f;
}
// Init data (partial, without directional light or sky light data);
GBufferPass::SetInputs(renderContext.View, _cache.Data.GBuffer);