No idea to be fair. I’d expect it to be roughly 4x the cost of coarse. I doubt that would be large enough to be profilable.
Overall, there few moves, that I don’t understand regarding PCSS in UE4. First being why the PCF bias used is only positive ? The technique itself kinda implies on it being both positive and negative. I agree that only positive bias safeguards you from some acne, but it also eats up the shadows, where they should be. I totally agree that clamping the bias at some point is a must, but should not be only positive.
Second is, why adaptive bias was used at all? Following the logic of conventional PCF implementation in UE4, it might be more consistent(not better, just more consistent) to follow the tradition and just use transition scale and flat bias.
Thirdly and lastly, why sobol random ? I might be biased here, but I was never able to pull a decent random out of it.
And as a general thought, what about using blocker search result to have reduced PCF sampling rate in ?
I think most of the answers are that implementation is still WIP. I will try replace sobol with something else.
For reduced sampling rate I am not sure if it’s worth it. There are already two early outs based on blocker search. If there are no blockers it skip all samples and there is no shadow. If all samples are blocked it will skip all the samples. Reduced sampling rate could be win without unrolling and variable loop counter.
Just found another optimization. Filter radius can be premultiplier to PCFUVMatrix. -2ALU per sample.
I replaced Sobol with simple spiral sampling. With per pixel rotation matrix premultiplied to PCFUVMATRIX. It’s not as good looking yet but it’s saves 300 assembly lines. This makes me wonder is sobol random worth it. With unrolled loop it’s easy to precalculate sampling points. Same optimization can be done to blocker search too. Need more testing.
This is the final form on spiral tapping. Every pixel is rotated peusdo randomly and samples are mirrored every other frame. Spiral offsets are precalculated and then rotated, scaled and mirrored with 2x2 matrix. So this method has no per sample overhead at all.
Indeed, if you didn’t have the images side by side you wouldn’t be able to tell the difference. Is the difference more obvious in other scenarios maybe?
Finally back at office. Profiled scene before and after softshadow optimizations with GTX 1080Ti. Single directional light with two cascades ShadowProjection time went from 1.51ms to 0.47ms. Non soft shadows cost would be 0.18ms.
The PR for TAA sharpening kinda conflicts with Epic’s perspective and intentions with TAA, Plus Epic was working on Temporal AA upsampling and dynamic resolution.