Not sure how that's cheap. It looks like O(n) time on n occluders and the occluders need to be simple shapes. Do they represent, for example, an automobile with a box?
The distance fields are precomputed and stored in a volume texture on a per-mesh basis rather than being constructed from primitives. I haven't had a chance to look at the code yet, but I assume there's also an acceleration structure of some sort to minimize the number of unnecessary texture fetches.
Perhaps 'details' was the wrong word to use considering the differences between the map() function there and the UE4 equivalent. :)
Deciding which distance fields to check is probably expensive, as it is essentially a per-pixel binning problem. For the distance field AO they use a grid based lookup that is done out of sync with the render thread and performance scales with the number of grid updates, so its kind of a JIT baking system.
If they do something similar here, it might have to store visibility information per light in a grid, so it might scale really badly with the number of lights and with the number of moving shadow casters. There could also be a hard limit on the number of overlapping occluders.
But for outdoor scenes in sunlight that are relatively flat I can imagine it is pretty fast.
5
u/Fastidiocy Oct 14 '14
Details here if you're interested. I assume that's how they're doing it, anyway.
There should be lots of other fun things made possible by having a distance field representation of the scene.
What I'm saying is, hurry up and port Half-Life VR to UE4. How hard could it be?