We’ve been doing a lot of R&D on photocapture/facial scanning, but we’ve compiled a list of in-house shaders that we’ve built or experimented with along the way for client jobs campaigns. In the spirit of iq’s weekly shader toy release, I’m going to try to release a new toy shader once a week and/or implement a common technique that’s missing from Unity (RLR/SSDO/etc).
Screen space shadows calculate (very cheaply) dynamic shadows. We can compute 12 taps for every pixel relatively fast (~1ms on 1280x800). The problem with this technique is that it creates a lot of artifacts because it’s in screen space (shadows tend to pop in and out at the edges because only objects within the view can cast shadows so once an object goes out of the view, there’s no longer any shadow cast).
I prototyped this quickly just to see how manageable it would be and I still feel it’ll be great for self-shadowing on character faces, especially since it’s very cheap (we’re aiming for 60 fps so we only have 16ms time budget). Combined with static shadow maps + faked GI, and I think we’ll have a cinematic experience on our hands.
The artifacts you see here are coming from the terrible depth resolution from using Unity’s packed depth/normal texture combined with a bug in the shader, but generally these screen space shaders cast a lot of high-frequency sample noise. On Sunday, I’ll put in an edge aware blur and drill down into some shader debugging.
A SSDO implementation would be fantastic. I’m not a tech guy and maybe its performance intense but compared to how much the visual quality could be improved, I just don’t get why SSAO is still the standard. Keep us updated !
Thanks; SSDO’s up next. I was implementing it and ended up detouring into screen space shadows. Once I sort out the noise issues with the shadowing, it’ll be easy to just sample along different directions other than the light direction for SSDO
Realtime Local Reflection. Im working on SSDO now I would love to get some feedback and help from ikrima! After SSDO I wanted to try SSR hopefully we can both achieve this.
Didn’t realize there was an nvidia example; should look that up. I based it off of a slide I saw from the Crytek guys presentation about using screen-space shadows. For SSDO, there was a Siggraph presentation that I’m following.
Variance Shadow Mapping: Fast filterable soft shadows
My first inclination was to implement Variance Shadow Maps because they are very fast. VSMs use a probability distribution function to compute shadow visibility. The idea behind them is that we want to separate the shadowing function terms into occluder terms (things that go into shadow-map) vs the receiver terms (the scene you’re rendering) because this allows us to perform pre-filtering on the shadow map (Gaussian blur, mipmapping, bilinear/trilinear sampling, etc, all are things prevent aliasing, biasing problems such as shadow-acne, etc) The initial insight for this technique came from computing volumetric shadows (Deep Shado Maps by Locovic Veach).
Light bleeding when depth complexity is high or multiple overlapping occluders
Peter panning
Both can be reduced by light reduction techniques and clamping variance to a minimum value but it gives the shadows a “fatter look” that may or may not fit the aesthetic of your game.
Real time shadows are still an annoyance in real time graphics. Surprisingly, even the latest next-gen games use a multitiude of shadowing techniques to compensate for each one’s shortcommings. (Crytek shadow techniques: http://www.crytek.com/download/Playing%20with%20Real-Time%20Shadows.pdf)