Update Global Distance Field Volume taking longer than usual

Hi everyone,

I’m currently part of a team making an open world game and parts of our world have time sinks in the GPU causing the overall framerate to go up.

The biggest culprit in these areas (or so it seems) is “UpdateGlobalDistanceFieldVolume”. It is spending about 20ms in here which is an incredibly long time.

Can anyone explain to me why our frame time is spending so long in here, and why we have so many clip maps. As I understand it, only newly visible areas or those affected by a scene modification need to be updated.

For a bit of context we have foliage, landscape, and a rain particle emitter (focused on the player).

Thanks in advance!

EDIT: After some further investigation, I have found that a non-shadow casting Skylight was causing this issue. However, it is my understanding that the distance field stuff is not used when cast shadows is turned off.

The global distance field is updated if any of the features using it are enabled:

  • Distance field particle collision
  • DistanceToNearestSurface material node
  • Shadow casting movable skylight

It also updates if Ray Traced Distance field shadows are enabled, but that’s a bug. You can workaround it by forcing global distance fields off with ‘r.AOGlobalDistanceField 0’.

I’ll assume you are actually using a feature that requires it. The global distance field is a cache around the camera that has to update if the camera moves a lot, or if you have a moving static mesh which has bAffectDistanceFieldLighting enabled. The bigger the static mesh, the more expensive the update will be. Use ‘r.AOGlobalDistanceFieldLogModifiedPrimitives 1’ to track down which objects it is and disable bAffectDistanceFieldLighting on them.

We have a rain particle effect that uses Distance Field collision (we need to use this as screen space is not suitable for spaces under ‘cover’).
We had a a non-shadow casting skylight in the level, and upon removing it, it got rid of this performance issue, with the rain particle effect still in the world.

Is this a potential bug, because it is not shadow casting. I’m going to investigate the world using the LogModifiedPrimitives command you have given me. Thanks for the reply :slight_smile:

So I put a skylight back in, set it from moveable to stationary and it has solved the performance issue. Could this potentially be a but as you told me Shadow Casting Moving Skylights cause it to be updated, however it appears that any moving skylight causes the update to the global distance field. Thanks for the hint that lead to the answer :slight_smile:

Hey DanielW, I have a similar issue in my project. However setting “affect distance field” under lighting in the mesh isn’t helping. Performance doesn’t change at all. Even though the distance fields are no longer visible when I go into visualize>mesh distance fields. Why is this?

hey wixZ , did you find any solution

also

  1. Iam getting full noise in scene when using distance field settings.
  2. when i go closer to any object it losses it shadows and occlusion and glows like subsurface shader

Hi friends, I troubleshot an issue for an entire day where my Global distance field updates were taking 20ms-80ms constantly and freezing my game. It happened seemingly out of no where and I had to tear everything apart completely before I found the source of the issue was my landscape. I could never find the setting that was causing the issue, I tried to tweak all of the settings to track down the source - it was not the material, or any of the AO settings (anywhere) , or the size of my landscape, or any of its parameters - it was not until I deleted my landscape and added a new (larger) landscape in that my Global Distance field update times were fixed (now always less than 1ms, even after a stress rebuild of the level)

So yeah, good luck!