Unreal Global Distance Field

Hey all! Anyone have leads on technical info about Unreal’s Global Distance Fields? I know what they are and how to use them – more looking for info on:

  • How do you control the resolution?
  • What’s the memory impact?
  • What elements are included? (Looks like it’s only static meshes, but I’d like to know the specifics)
  • How do you add elements to be included?

Using it for collision avoidance in Niagara. Before I dive in and start reading the engine code, figured I’d ask around.

Thanks!

Ok! Answering some of my own questions…

  • The r.distanceFields.* cvars control various things
  • If you change the resolution, it’ll print memory usage stats
  • Each mesh has its own SDF (controllable in the static mesh editor)
  • The global field is a down-sampled composite of all the mesh SDFs. If a mesh isn’t showing up, need to increase the mesh SDF resolution.
  • It’s only static meshes; but, since it’s computed per-frame (it’s sort of a render pass), moving static meshes are included.

Hope that helps if anyone stumbles upon the same question! :slight_smile:

2 Likes

Thanks for sharing m8! :slight_smile:

1 Like