MSAA doesn't seem to work properly with local fog volumes - 5.8.4

I narrowed down a problem to do with volumetric local fog volumes and MSAA when using the forward renderer.

I had an error pop up only when I had a local fog volume actor in the scene, and MSAA was enabled.

Repo steps:
r.MSAACount 0 — no error.

r.MSAACount 2 — error returns.

r.LocalFogVolume 0 with MSAA enabled — no error.

Removing the Fog actor from the level — no error

I never got this error when using 5.7 and 5.6.

Error below:

Ensure condition failed: OriginX <= OriginMax && OriginY <= OriginMax && OriginZ <= OriginMax [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Math\DoubleFloat.cpp] [Line: 19]
Found precision loss while converting matrix to GPU format, verify the input transforms. This error usually indicates the view transform is invalid, or the PreViewTranslation/ViewOrigin was not set up correctly.
Stack:
0x00007ffea6f4fac9 UnrealEditor-Core.dll!UnknownFunction
0x00007ffea645bb01 UnrealEditor-Core.dll!UnknownFunction
0x00007ffea645b9b2 UnrealEditor-Core.dll!UnknownFunction
0x00007ffec38c6a77 UnrealEditor-Engine.dll!UnknownFunction
0x00007ffec38c706c UnrealEditor-Engine.dll!UnknownFunction
0x00007ffe9b7f1fd9 UnrealEditor-Renderer.dll!UnknownFunction
0x00007ffe9c0e44d2 UnrealEditor-Renderer.dll!UnknownFunction
0x00007ffe9acbb84b UnrealEditor-Renderer.dll!UnknownFunction
0x00007ffe9acf5e5e UnrealEditor-Renderer.dll!UnknownFunction
0x00007ffe9bd8d9ba UnrealEditor-Renderer.dll!UnknownFunction
0x00007ffe9bd4d2a0 UnrealEditor-Renderer.dll!UnknownFunction
0x00007ffe9bd695a7 UnrealEditor-Renderer.dll!UnknownFunction
0x00007fff3db69908 UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff3db3c5ac UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff3db59b91 UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff3db6a1b3 UnrealEditor-RenderCore.dll!UnknownFunction
0x00007ffea6105e1e UnrealEditor-Core.dll!UnknownFunction
0x00007ffea60f8bfe UnrealEditor-Core.dll!UnknownFunction
0x00007ffea60f8efe UnrealEditor-Core.dll!UnknownFunction
0x00007fff3db8a1a9 UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff3db8a8e4 UnrealEditor-RenderCore.dll!UnknownFunction
0x00007ffea6830658 UnrealEditor-Core.dll!UnknownFunction
0x00007ffea6829f85 UnrealEditor-Core.dll!UnknownFunction
0x00007fffcbc7cd87 KERNEL32.DLL!UnknownFunction
0x00007fffcca2caec ntdll.dll!UnknownFunction

Hello there @SpazzGibbon!

That’s an interesting find, I followed your steps in another 5.8 project of mine, and got a similar Ensure, not the same though:

Ensure condition failed: DepthStencilRenderTarget.DepthStencilTarget->GetNumSamples() == NumSamples [File:D:\build++UE5\Sync\Engine\Source\Runtime\RHI\Private\RHI.cpp] [Line: 1432]

Stack:
0x00007fffc0f6ba4f UnrealEditor-RHI.dll!UnknownFunction
0x00007fff78955fcb UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff78a2fde6 UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff78a2f6b2 UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff78a0ea6c UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff789d20f6 UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff78957bf8 UnrealEditor-RenderCore.dll!UnknownFunction
0x00007fff2cb43047 UnrealEditor-Core.dll!UnknownFunction
0x00007fff2cb42da4 UnrealEditor-Core.dll!UnknownFunction
0x00007fff2cb6a1ee UnrealEditor-Core.dll!UnknownFunction
0x00007fff2cb2e905 UnrealEditor-Core.dll!UnknownFunction
0x00007fff2cde1854 UnrealEditor-Core.dll!UnknownFunction
0x00007fff2d290658 UnrealEditor-Core.dll!UnknownFunction
0x00007fff2d289f85 UnrealEditor-Core.dll!UnknownFunction
0x00007ff8376fdda7 KERNEL32.DLL!UnknownFunction
0x00007ff83889ee4c ntdll.dll!UnknownFunction

They may be different, but both your error and mine show up under the same conditions, and go away when disabling MSAA or the local fog volumes.

Since the issue reproduces on two different setups, and you didn’t get it in 5.6 or 5.7, it does point to a possible issue in 5.8, most likely in how the engine renders local fog volumes with MSAA. So I suggest submitting a bug report, with your repro steps and both ensures from 5.8, mentioning the versions where it worked.

In meantime, I think you can work around it by switching the Anti-Aliasing Method to TSR or TAA, or by using Exponential Height Fog instead of the local volume. Also, check if the fog actually looks wrong with MSAA on, or if it’s only the message in the log. Ensures don’t stop the editor, so if it renders fine, it may be safe to keep working while it gets fixed.