My findings on Distance Field Ambient Occlusion & Soft Shadows

For our project I did some initial research into Distance Field Ambient Occlusion (4.3) and Ray Traced Distance Field Soft Shadows (4.5) and see how (if at all) this could fit into the game.

The details on how to set this up are available on the documentation pages so I left that out and focused on results and my personal findings.

Full post: Distance Fields in Unreal Engine - Tom Looman

Soft Shadow (with sweet hardness fall-off)

Distance field Ambient Occlusion

Read the full post at my blog

Can’t wait for 4.5! :X

Thanks Tom! Loved the blog post, I’ve been using DFAO but haven’t messed with the visualization yet.

What kind of performance hits did you notice with soft shadows?

Thanks! I haven’t profiled the performance on soft shadows yet, but didn’t notice any impact when using it on a directional light and/or pointlights - will need to do some proper profiling soon.

Thanks for trying it out and posting your results Tom.

This has been improved quite a bit in 4.5, meshes no longer need to be closed. Non-closed meshes may not produce the full amount of occlusion though, because they can fail to create a negative region in the signed distance field which would have caused occlusion.

The original 4.3 implementation is probably 20% faster in 4.5 and another 30% faster than that in what will be come 4.6. It’s still much slower than I would like though, the goal is for mid-spec machines to be able to run it.

Note that if you increase LightSourceAngle on the directional light you can amplify the soft shadows look, although it costs more.

Almost all leaking type artifacts come from the distance field being generated at too-low of a resolution. You can increase this with DistanceFieldResolutionScale on the static mesh. The default settings are quite conservative to keep memory usage down, the idea being that artists will increase resolution where necessary but most of the time it should work ok.

You can enable ‘Use Inset Shadow’ on skeletal meshes and they will create a per-object shadow that is composited in with the ray traced shadows, to get the best of both.

The Ray Traced Distance Field shadows doc will be published soon, probably right after 4.5 release.

Thanks ! Great info, I’ll update the post when 4.5 hits.

The occlusion on the test wall was actually great, we should have more art in-game soon to give this another spin.

Wow! The post is awesome, love the comparation images and the quality is really increased, the cave scene was impressive how the shadow became realist compared to the without Ray Traced Shadows.

Amazing work and amazing post!

Thanks mate! All credits to DanielW for the real work :smiley:

This still only works with directional lights, right?

Or is it possible to get this working on other light types as well?