We are seeing an issue with GAOGlobalDistanceFieldCacheMostlyStaticSeparately.
With this enabled, we constantly have large GlobalDistanceField updates happening every frame. But when disabled, we only have GlobalDistanceField updates when the camera moves (and these are smaller updates). This happens both in editor and in game for us and can be seen within both `stat GPU -> UpdateDistanceFields` and `r.GlobalDistanceField.Debug.ShowStats 1`.
It seems counterintuitive that caching static objects separately makes the Global Distance Field update cost higher. When looking at a GPU capture, the vast majority of the costs seem to be from Heightfields:
- CompositeHeightField Clipmap:0 (16 calls)
- MarkHeightfieldPages Clipmap:0 (16 calls)
It seems to me that when GAOGlobalDistanceFieldCacheMostlyStaticSeparately is enabled, Landscapes/Heightfields around the camera have their GDF data invalidated every frame and I don’t understand why.
I’d love to hear if this is a known issue, or some insight into why this would happen.
Update: This seems to be caused by `GlobalDistanceFieldData.DeferredUpdatesForMeshSDFStreaming`. I have also found that this seems to only repro when I have a large amount of data loaded in WorldPartition. It does not repro by default in a low fidelity scene (our engine or vanilla 5.5).
If SDF meshes are failing to stream in (due to a bug or low memory?), could that be causing an infinite loop of forced GDF updates?
Aha, found it.
This is happening due to `r.AOGlobalDistanceField.RecacheClipmapsWithPendingStreaming`.
For some reason, this CVar puts us in an infinite loop of recaching.
Hello,
Thank you for reaching out.
I’ve been assigned this issue, and we will be looking into this recaching Global Distance Field loop for you.
Hello,
Thank you for your patience.
We are still working on reproducing the issue, and will get back to you.
Hello,
We have been unable to reproduce the infinite loop of Global Distance Field updates you are describing.
For our test case, we took City Sample, disabled “r.RayTracing”, and added a landscape under the entire city (“Big_City_Lvl”).
After loading about half of the city, we tested all permutations of the CVars “r.AOGlobalDistanceFieldCacheMostlyStaticSeparately” and “r.AOGlobalDistanceField.RecacheClipmapsWithPendingStreaming”, but did not see any combination that lead to heightfield updates when the camera was stationary.
Is there any further information you can share that might help us reproduce the issue?
Another Licensee has opened a ticket about a similar issue. Keep in mind this ticket is not in English:
[Content removed]
Okay, I have reproed this with Big_City_Lvl in Vanilla 5.5.4. Bit difficult to add a repro project as my zip file was massive. But I will add a video and post the ini settings I changed:
`// DistanceFields weren’t supported by default in the project, so had to toggle this on
r.DistanceFields.SupportEvenIfHardwareRayTracingSupported=1
// Half resolution Distance Fields
r.LumenScene.GlobalSDF.Resolution=124
r.DistanceFields.BrickAtlasSizeXYInBricks=64
r.DistanceFields.BrickAtlasMaxSizeZ=16`
Hello!
We are seeing the same issue, however we have only noticed it when playing split-screen and the two players are far apart. This is in an open world with a lot of content active.
r.AOGlobalDistanceFieldCacheMostlyStaticSeparately 0 removes the frequent large distance field updates, but adds an overall noticeable performance impact when the issue is not occuring.
r.AOGlobalDistanceField.RecacheClipmapsWithPendingStreaming 0 removes the frequent distance field updates, but presumably has artifacts as per the description of it.
r.AOGlobalDistanceField.FastCameraMode 1 reduces the update time, but the distance field updates still seem to happen as often.
I hope this gives some more information to help track down the issue.
Hello,
Thank you for the replies.
We have been able to reproduce the issue as described in City Sample, and are looking into it.
Hello,
Thank you for reporting this. I have opened a bug report:
The tracker will be visible after it is approved internally at Epic Games and is publicly accessible.
If you have any further questions, please let us know.