Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/DistanceFieldLightingPost.cpp
jason hoerner d15b1426d0 Scene Capture Cube: fix for severe artifacts in volumetric cloud rendering, and possibly other artifacts. The artifacts are caused by the temporal volumetric cloud effect not having a separate history per cube map face.
* Each cube map face gets its own FSceneViewState.  The downside is that it potentially could add a lot of extra memory.  So some memory optimizations were made to compensate.
* Global distance field data is shared for all cube map faces.  This data is only dependent on the view origin, which is invariant for the cube map faces.  A mechanism was added to allow cross view state data sharing for shared origin views.  This saves 8.5 MB, and improves perf.
* Disabled distance field lighting temporal AO for cube map capture.  The AO history texture in the view state is dependent on the Scene texture extents, which is typically the front buffer size, which then gets multiplied by 6.  For a 1080p front buffer, this is 24 MB, while for a 4K front buffer, this is 96 MB, regardless of the resolution of the cube map capture itself.  A 256x256 cube map capture, including all the auxiliary state, is otherwise only around 9 MB, so this is an order of magnitude increase.  A comment in the function "DistanceFieldAOUseHistory" has more details on how this could be fixed, by using the view rect rather than Scene texture extents for the history texture -- for the 256x256 case, it would reduce the incremental memory cost to 768K.

With the memory savings from disabling distance field lighting temporal AO, this change is more or less memory neutral if the Scene texture extent (front buffer) is 1080p.  A net increase of 590K.  With a higher resolution front buffer, it's a subsantial memory win.

#jira UE-151717
#rnx
#rb tiago.costa daniel.wright
#preflight 629f6a27233ae0a8f8f99932

[CL 20614815 by jason hoerner in ue5-main branch]
2022-06-11 19:06:03 -04:00

32 KiB