Download

The state of Distance Field GI in 4.8

Hey Daniel you said to look at the sizes of the Kite demo as if it was available somewhere? What tile size did that use?

Daniel, Those changes you haven’t checked in yet read something like this right? I couldn’t help but notice this on the master branch :smiley:

Sounds like a pretty nice improvement overall(despite the temporarily broken DFGI). Need to think of a good hacky method to transition to a different GI method for indoor areas without losing dynamic support perhaps.

Thank you again for the excellent answers Epic Staff!!

Is there any way to mitigate the leaking issues? Do I just need to use very thick walls? If so, what level of thickness do you think would be needed?

And just to be 100%, completely, crystal clear, the (theoretically) best technique for my use-case example would be to use HFGI and DFAO, and I assume also using CSM/DFSS (Distance-Field Soft Shadows) for shadowing, and then using regular point/spot lights for indoor lights. Man that sounds really complicated…are there any plans to consolidate the various GI and Lighting/Shadowing techniques available to make the system simpler to use, or should we pretty much expect using 3-4 techniques if we need dynamic lighting?

Thanks again for all your helpful feedback!!

It will be released in 4.8, sorry forgot it wasn’t out yet. I don’t know the answer to the tile size, will see if someone else does.

Yep latest DFAO optimizations are now in master. Note these are NOT in 4.8, which has already branched. I could have chosen to merge it to 4.8 but it seems too risky, these are big changes.

The primary thing in the latest changes is performance improvement - 3.8ms for DFAO on PS4. I would consider DFAO to be generally usable on mid spec hardware now, including large outdoor foliage scenes.

Yes, they will be enabled as they come online independently.

Unfortunately no, the heightfield GI uses only local shadowing (AO) so it inherently leaks. Maybe later we will make volumes that you can place down to explicitly mask out outdoor lighting.

Yes

Yeah sorry about that. It’s kindof inevitable if you want to push quality and performance though. Each technique only provides a narrow solution, due to the constraints that hardware puts on us.

Daniel, a few weeks ago there was an extensive discussion about masking Skylight indoors:Can you disable a skylight in certain areas? - Rendering - Unreal Engine Forums

While there have been some half working solutions to the issue, is there any chance that we’ll either see a Skylight Masking volume or a “remote” postprocess setting that allows PP volumes to apply their effects on the area they overlap in screen space, without the need to be inside of them?

It would be nice to have a solution like that. I’d also like to use a volume to switch to a different GI method for indoor areas(such as VXGI if it really manages to beat the pack to multiple bounce lighting), I imagine it wouldn’t be too hard to attach volumes to place-able building assets.

It would be especially neat if we had a new use for lightmass to detect light leaking on meshes and procedurally generate blocking volumes/shapes which could then be attached to assets as you place/build them in the level.

More great info, as always! I am curious then about these “masking” volumes; if those were used in an indoor area, how would that interact then with a window? Would the lighting outdoors, seen through the window, be broken/look crappy? Would the lighting coming indoors from outside be messed up or look bad? Would these things just need to be faked instead? As far as I can tell, HFGI piggy-backs on DFAO’s calculations right, just like DFGI? Are all these techniques run through the skylight?

On a side note, is there a place where someone who isn’t a rendering engineer (or programmer for that matter) but has some technical know-how could go to understand what exactly Distance Fields are and what are the differences between AO and shadowing, etc?

This from nvidias GPU Gems:
Overview of Signed Distance Fields

A signed distance field is represented as a grid sampling of the closest distance to the surface of an object represented as a polygonal model. Usually the convention of using negative values inside the object and positive values outside the object is applied.

Also ambient occlusion is what the name suggests, the occlusion of ambient light e.g light from the sky/surrounding environment , shadowing is simply the occlusion of direct light sources such as the sun, a light bulb etc

So that would mean that HFGI (and DFGI?) only calculate GI based on ambient shadowing? Wouldn’t that be pretty inaccurate? Or am I just missing something?

No. All distance fields approximate is the occlusion of a mesh, meaning that it can be used for any effect that requires information of an objects occlusion, e.g shadows , ambient occlusion and global illumination. Distance fields are simply an alternative way to represent a mesh that makes it easier to do certain effects.

To see what distance fields look like, add a mesh that has a a distance field baked to it in the editor, then go to view>visualize>mesh distance fields

Ok that makes a lot more sense. Distance Fields are a way to represent a mesh which make effects dealing with occlusion easier. That is actually really awesome! I’m curious if anyone other than Epic has actually played with them for the purpose of shadowing in an actual game/game engine. Time to do some research!

Thanks for the help JECOGames!!

No problem:) when I first heard about them they were kinda confusing too, they’re not an be all end all solution though, since they only work for non animated models you still need to use more classical shadowing techniques in conjunction with them.

There’s a pretty decent visual representation of how distance fields work on the DFAO page
Distance Field Ambient Occlusion | Unreal Engine Documentation?

Thanks for the update and info!

Something I’m a bit unclear on though - are any of the proposed GI systems going to work well indoors with point and spotlights? I’ve been following the GI Alternatives thread for a while now, but nearly everything (LPV, HFGI, and DFGI as it stands now) focus almost exclusively on outdoor scenes using Direct lights. So far I haven’t seen anything proposed that would give nice GI in an indoor environment where a player could switch lights on and off or shine a flashlight around a room.

The problem with indoor lighting is that it requires 3 or more bounces to look great

I found this Realtime Dynamic GI + Reflections + AO + Emissive plugin - AHR - Work in Progress - Unreal Engine Forums

This guy is working on something pretty good :slight_smile:

Does anyone know how the cheap bounce option in dfao compares to heightfield and distance field gi , how diferent are both techniques ?, I know that the former is meant to be a lot lower quality , but i dont know if it would realy make a diference if used outdors and if posible only on the distance by combining it with another solution such as ahr to take care of the close part of the scene.

Any progress on dfgi?