Until Dawn: Pixel-Correct Shadow Maps with Temporal Reprojection and Shadow Test Confidence

Shin Ra

Newcomer
I started playing Until Dawn recently and in one closeup scene I noticed that the slower I moved the flashlight, the higher quality the shadow cast, almost like it built-up precision over time. I grabbed a couple of screenshots to check I wasn't imagining it.

MOTION
22049021389_721b4d2f8e_o.png


STILL
21614858413_c6ebc5c821_o.png


Guerrilla's Killzone: Shadow Fall engine's well known for it's temporal reprojection but I'd never heard about it being used for realtime shadow maps, mostly just AA and SSAO.

I did a little search today and here's the research I found on the subject: https://www.cg.tuwien.ac.at/research/publications/2007/Scherzer-2007-PCS/

Shadow mapping suffers from spatial aliasing (visible as blocky shadows) as well as temporal aliasing (visible as flickering). Several methods have already been proposed for reducing such artifacts, but so far none is able to provide satisfying results in real time.

This paper extends shadow mapping by reusing information of previously rasterized images, stored efficiently in a so-called history buffer. This buffer is updated in every frame and then used for the shadow calculation. In combination with a special confidence-based method for the history buffer update (based on the current shadow map), temporal and spatial aliasing can be completely removed. The algorithm converges in about 10 to 60 frames and during convergence, shadow borders are sharpened over time. Consequently, in case of real-time frame rates, the temporal shadow adaption is practically imperceptible. The method is simple to implement and is as fast as uniform shadow mapping, incurring only the minor speed hit of the history buffer update. It works together with advanced filtering methods like percentage closer filtering and more advanced shadow mapping techniques like perspective or light space perspective shadow maps.
Self shadowing of characters in the nooks of clothing and hair still gets a bit chunky but for the most part shadow quality is extremely high throughout the game.
 
From the guerrilla presentation
captureyqjc3.png


There's also something going on with the character/object silhouette (notice the outline, that basically changes in motion and has a very jittery effect)
untildawn_201508312138ouuf.jpg
 
There's also something going on with the character/object silhouette (notice the outline, that basically changes in motion and has a very jittery effect)
I've noticed that in screenshots. Is there a reprojection that's specifically targeting shadows, or are shadows (and perhaps other things) using some kind of noisy rendering that naturally gets smoothed out by a more general-purpose TAA?
 
Reprojection for sun light shadow map is trivial, as the projection is orthogonal and the sun direction is constant (or practically constant in games with dynamic ToD as the sun moves so slowly). In this case reprojection = 2d blit (scroll + scale).

Reprojected shadow maps have issues with mesh LOD changes. LOD change causes self shadowing issues (object surface becomes unlit for a few frames). Most likely there are tricks to hide this issue.
 
I've noticed that in screenshots. Is there a reprojection that's specifically targeting shadows, or are shadows (and perhaps other things) using some kind of noisy rendering that naturally gets smoothed out by a more general-purpose TAA?
What I suspect them to actually do is just reprojection of framebuffer and use only few samples and change their locations when rendering shadows, This causes some grain in moving on previously hidden areas, but does give improved quality.
Reprojection for sun light shadow map is trivial, as the projection is orthogonal and the sun direction is constant (or practically constant in games with dynamic ToD as the sun moves so slowly). In this case reprojection = 2d blit (scroll + scale).
Insomniac had nice presentation on subject.
http://www.insomniacgames.com/mike-day-siggraph-2012-csm-scrolling/
 
Back
Top