3 ms·
A couple notes: 1. For blur, rather than the ARM approach, these days I recommend just going with the Jimenez blur filter [0]. It's basically the same thing, b
by Jasper_ 3y ago
A couple notes:
1. For blur, rather than the ARM approach, these days I recommend just going with the Jimenez blur filter [0]. It's basically the same thing, but with smarter choice of weights, and the quality is better. You could also do the full scatter-as-gather DoF I suppose, but I think that's going to be too expensive without compute.
2. FXAA could be described simply as "detect edges, use blurred version at edges", but the key is that it's picking a direction based on the edge detection, and then samples a few points on that line to blur together. Basically, it's trying to carefully blend over the edge, rather than just blur everything together. That's the secret sauce behind FXAA, tbh, and why your isotropic blurred image doesn't quite cut the mustard.
[0] http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare http://www.iryoku.com/next-generation-post-processing-in-cal... , see PPT, slides 152-171
- fidotron 3y agoThanks for that! Regarding your second point, I have it in the shader comments to explore directional blending if at all possible. The problem is a large proportion of the play sessions are on Android devices in LATAM (while conversely most of the feedback is iOS and desktop players in North America) and these things really are going to struggle if more sampling is introduced. Luckily the physical pixels on such devices are small, so the bad side of this shows up far more on desktop machines than on mobile ones. I had a nightmare making screenshots for this post due to everything in the pipeline wanting to resample the images, and I think Medium did so as well at the end. A few months ago I did extend the dual filtering blur to support bilateral blurs, for the purpose of upscaling masks from neural networks in video conferencing, and using that kind of idea it may be able to generate preprocessed intermediaries that represent the direction so that the net amount of sampling remains low.
- Jasper_ 3y agoAlso, while looking at your Which Way Round, I notice you're using cascade shadow maps with 4 cascades, which seems a bit overkill considering I can only spot 2 cascades on the page. It seems you're also rendering depth to an RGBA8 map? I'm a bit confused why, because WebGL definitely supports depth maps and comparison samplers. You should get a free PCF by using a linear comparison sampler, which will make your texture filtering look a bit linear.
- fidotron 3y agoCompatibility. Those features do not work on different mobile devices (depth maps on iOS for example). On top of that things like some Malis will return different levels of precision from what you ask for. The whole area of image and depth format support is a nightmare. You rightly point out that this causes the shadow maps to be the bane of my existence. Consequently my biggest hope for WebGPU is to be able to get rid of many of these device level inconsistencies and do things like reverse the z-buffer. Edit to add: the configuration of cascades is not optimal in the context of these games but I am using these as tests for potential future things which would need that number of cascades. At some point I decided I had to stop playing with shadow buffers and just release something!
- Jasper_ 3y agoEver since Apple rewrote their WebGL backend in Safari (and even a bit before then), it's been fine. I even do a 5-tap PCF which works just fine on iOS for me.