Since my PSU failed a few days ago, I got a chance to revisit some of the older games I own that are installed on my laptop. Although Modern Warfare 2's post processing is god awful, it gave me an idea for ADoF that would further mimic real life DoF.
In real life the near blur/bokehs are transparent and blurred on edges where the near out-of-focus areas meet the in-focused areas. For example, in this picture the bike seat is blurred around the edges and is blurred in the in-focused areas such as the fence and the handle bars:
Modern Warfare 2 has a similar system where they use a fast blur to mimic this on objects in the foreground when aiming or in spectator mode. The blur is used to blur the foreground and background together by adding a blur that is extended several pixels out. Although this also blurs the in-focused areas surrounding the foreground, it is still a good simple replication of this effect in real life.
Would it be possible to add a Gaussian blur over the near DoF in ADoF to mimic this effect? Right now ADoF just cuts off the bokeh shapes/blur when the out of focus objects meets the in-focus areas.
Alternatively, UE 4 has a similar system where instead of using a Gaussian blur the bokehs just bleed onto the rest of the image instead of being cut off. This is probably the more difficult route but still interesting none the less. I would not suggest doing this as the Gaussian blur technique sounds more plausible. Just to show you what it looks like because it is an interesting approach:
I know about this and I know how to do it but I haven't come up with a good solution that runs fast enough. I talked to a lot of people and no one ever used near blur so I just abandoned it. Maybe, when I revisit DoF but not right now.
The simplest way (and the way it's usually done) is the one like in CoD. How the UE4 DoF does what it does, I have no clue tbh.
I think I have read every DoF and AO paper there is, thanks. This paper is almost useless because it just throws random concept names, everyone can come up up with those, making them look good is the difficult part. Nvidia names the same problem here. Scatter as gather is, at least from my tests, ineffective. Problem with usual DoF approach is that a pixel should spread its colors onto others depending on whether it's in focus or not, but blurring in pixel shader works the other way round, it samples pixels around and scatters their color into itself, assuming that the pixels you sample have the same blur intensity (otherwise their color wouldn't land on our pixel here). Means that we have to discard a shitload of pixels. Long story short, I won't be bothering with DoF anytime soon. Now I'm waiting for kingeric to be triggered by this discussion.