Welcome, Guest.
Username: Password: Remember me

TOPIC: ADoF Near Gaussian Blur

ADoF Near Gaussian Blur 1 year 2 months ago #1

  • Elimina
  • Elimina's Avatar
  • Offline
  • ΞLIMINΛ
  • Posts: 342
  • Thank you received: 367
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: 1 year 2 months ago by Elimina.
The administrator has disabled public write access.

ADoF Near Gaussian Blur 1 year 2 months ago #2

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 836
  • Thank you received: 881
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: 1 year 2 months ago by Marty McFly.
The administrator has disabled public write access.

ADoF Near Gaussian Blur 1 year 2 months ago #3

  • MaxG3D
  • MaxG3D's Avatar
  • Offline
  • Posts: 36
  • Thank you received: 5
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: 1 year 2 months ago by MaxG3D.
The administrator has disabled public write access.

ADoF Near Gaussian Blur 1 year 2 months ago #4

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 836
  • Thank you received: 881
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: 1 year 2 months ago by Marty McFly.
The administrator has disabled public write access.