ADoF Near Gaussian Blur

  • Elimina
  • Topic Author
More
7 years 9 months ago - 7 years 9 months ago #1 by Elimina ADoF Near Gaussian Blur was created by Elimina
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:

Last edit: 7 years 9 months ago by Elimina.
The following user(s) said Thank You: Popi, Snow

Please Log in or Create an account to join the conversation.

  • Marty McFly
More
7 years 9 months ago - 7 years 9 months ago #2 by Marty McFly Replied by Marty McFly on topic ADoF Near Gaussian Blur
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.
Last edit: 7 years 9 months ago by Marty McFly.

Please Log in or Create an account to join the conversation.

  • MaxG3D
More
7 years 9 months ago - 7 years 9 months ago #3 by MaxG3D Replied by MaxG3D on topic ADoF Near Gaussian Blur
Have you seen that Marty? (page 22-44): www.crytek.com/download/Sousa_Graphics_Gems_CryENGINE3.pdf

Page 43 is specifically about near DOF.
Last edit: 7 years 9 months ago by MaxG3D.

Please Log in or Create an account to join the conversation.

  • Marty McFly
More
7 years 9 months ago - 7 years 9 months ago #4 by Marty McFly Replied by Marty McFly on topic ADoF Near Gaussian Blur
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.
Last edit: 7 years 9 months ago by Marty McFly.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.