Distance Fields and Ray Traced Shadows

Hey, I’ve been reading a lot about DFAO and Ray Traced Soft Shadows but I’m still not really sure of when they should be used.

Are they something that should just be used with dynamic lighting and scenes? Or are they usable with static lighting too - or a mix of the two?

For example, an interior space with mostly stationary lights baked with Lightmass, with some dynamic lights which the player can turn on and off.

I assume Ray Traced Soft Shadows will be useless on the stationary lights, but work well for the lights the player can interact with? I also assume that DFAO would be useless in this circumstance.

However, are Ray Traced Soft Shadows useful for large-ish landscapes with baked lighting, to mix with the Cascade Shadow Maps?

Sorry for all the questions, despite reading all of the documentation - I still am unsure of actual use cases for these techniques.

Thanks in advanced.

Any news about just switching to only tracing the global distance field and thus boosting performance a lot? I mean, for detail you’d have to store global at a higher resolution than now, but as long as you’ve got like, .125 or even .2 meters as the min resolution (min Z camera distance dependent) anything smaller could easily be filled by SSAO…

I wonder if there’s some clever way to do “negative” SSAO to correct for low res SDF overoccluding? Edit- Also, parallel uniform tracing a global SDF could be a huge win for distant shadows.

Hmmm, the resolution might be too low for global and direct shadows. But just looking at the numbers for indirect shadowing, there’s no reason to do per object for that. You decide the texel (voxel? whatever volume nomenclature is) resolution for global distance fields. Uniform GPU access to a single data structure has to be faster than accessing multiple per object structures, and since it’s occlusion only I don’t see memory as being a problem.

Thanks for the presentation, it answered a lot of questions I was about to ask! But I do still have one problem. In the Kite Demo CSM were replaced at a certain distance with Distance Field Shadows, but in Fortnite, Distance Field Shadows seem to be active 24/7. I understand why the Kite Demo used CSM at close range, but as for Fortnite… I’m a tad confused. In engine, Ray Traced shadows are only active on Epic quality. So if you set a movable Directional light to use them instead of CSM, then on all lower qualities, you lose all shadows. Is there a way to make the engine switch between the two based on quality settings? Because Ray Traced shadows look fantastic up close for most uses, and I would like to use them in that way.

Thank you for the link. Very interesting read…although I’m not sure if it answered my questions.

Or, I didn’t understand enough of it for it to answer them, anyway. Rendering / technical art certainly isn’t my expertise.

I get from the PDF that it is very useful for very large, open-world games where lightmass would require massive amounts of memory to store lightmaps. In this case Cascade Shadow Maps would be used for up-close up object shadowing to retain the animated shadows, whilst Distant Field Shadows would be used for the distant areas. What about smaller scale landscapes with baked lighting, however?

I’m still unsure on using it in the scenario I outlined. A fully indoor scene with no directional light - just baked lighting with the odd movable light, which the player can turn on or off.

Also, I should apologize for the word “useless” in my original post. Of course, distant fields are fascinating and useful tech that has had a lot of work put in to it - what I meant was not viable in this specific scenario :slight_smile:

Thank you very much for the reply. Sorry you had to spell it out for me!

I’m a bit confused bit DFAO. It says in the doc that ‘‘Only Static Mesh Components, Instanced Static Mesh Components, foliage and landscape are supported for causing occlusion.’’ but baking a whole forest is a pain. I thought it could be used for movable foliage.

What would be the best way to make a realistic forest with all movable trees on an overcast day (without direct sun) and still have some sky occlusion. I’ve manage to do something decent with a static skylight+hdri and a very very weak directional light and by adding a bit of AO in the post process volume. I feel like it’s not dark enough under by huge snow covered firs tho!!!

How does DFAO handle shadows of distant landscapes that are casting very near to the camera (think very long shadows near sunset)? Or should I continue to crank up far CSM for that?