Jump to content
  • Advertisement
Sign in to follow this  

Proper Depth of Field... again

This topic is 698 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



This is my first thread so please be gentle ;)


I'm posting it because I can't seem to find any solid info on a particular algorithm, namely Advanced Warfare Depth Of Field method by Jorge Jimenez - http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare

From what I've been able to find on the net, it's the only approach that can create smooth transitions between near and far blur. It also calculates both fields in a single pass and doesn't require separate buffers for each layer. For example Crytek's version requires ~5 additional textures and still mixes them together inaccurately (although "non-linearly", whatever that means). Jorge's post is quite old which is even more surprising that nobody talked about it.


His approach is based the following steps:

1) calculate CoCs,

2) generate a tiled CoC tex,

3) generate a tiled neighbor max CoC tex,

4) weight and classify pixels as foreground or background (this part is tricky because you can't think of it as front and back blur, more like "almost-everything" [BG] and "what's-going-to-be-placed-on-top-of-that" [FG]),

5) sample both layers in a single pass and store the results for FG and BG in separate buffers based on CoC and the mentioned classification,

6) calculate FG Alpha,

7) combine BG and FG buffers based on the calculated Alpha,

8) there are a couple additional optimization (downscale/upscale) and quality (median) passes but I wish to make it work in full res first so I'm not digging into them just yet.


The problem is that even though the overall result looks really nice, a problem occurs when a blurred object is supposed to bleed onto the focused area - well, it doesn't :P (you can clearly see the foreground object's edge on this screen shot - http://oi65.tinypic.com/inz58y.jpg ) Jorge states that it is capable of doing this and the videos embedded within the pptx indeed show this effect in action.


So my question is, has anyone had any luck with this algorithm? Or maybe you know some other one (not based on Compute Shaders, I need to make it work in OGL3.3) that can generate a smooth transitions between front and back blurs (the "growing edges" effect)?



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!