Advertisement

Dof Near Blurring Technique

Started by July 21, 2019 08:54 AM
1 comment, last by Dawoodoz 5 years, 3 months ago

My question is about blurring the "near" section (coc is negative).
I read Hammon article in GPU Gems 3 but I want to know if that's still the "go to" method for blurring the near area to avoid the harsh silhouette.

My DOF effect is implemented as follows:
1. Split the image to "far" and "near" based on coc sign. Also downscale through bilinear interpolation in between samples at the same pass.
2. Far plane (premultiplied with coc) - gather approach based coc size followed by a "flood fill" small filter to extend the bokeh.
3. Near plane (non-premultiplied; no need to avoid bleeding) - Gaussian blur in 2 steps.
4. Composer blend between 3 images using smoothstep function of the coc.

 

I would also like to hear recommendations for:
1. the composition stage (better idea to merge)
2. If somebody has a recommendation for reducing the number of total passes.
3. Any scatter (instead of gather) approach for the "far" area blurring.

Thanks!

 

The simpler way with less artifacts
If you can decide which items to make blurry in advance, just apply alpha dividing separable blur in the near layer and merge the two layers. If the background isn't blurred at all, there's no need for clipping a non-separable blur kernel against foreground edges for directed blur. Some players are also annoyed by depth-of-field effects in game-play because it can cause eye strain when trying to focus on the image back and forward. Only use full intensity blur temporarily for cut-scenes or when the player is hurt badly.

Full ray-tracing (too much for RTX 2080 cards)
The next D.O.F. method is probably ray-tracing from multiple camera locations focusing on the same point, causing the parallax to keep it sharp. This would give correct half-circle blurring around edges but takes a lot of processing power. This is still not completely realistic, because light has wave-lengths between RGB which are visible in chromatic aberration, but random wavelength ray-tracing would be overkill for something that can be faked easily with more blur.

Edge detecting hybrid ray-tracing
There's a method for hybrid ray-tracing by only doing it along the seams, but getting 30 FPS would not be worth the effect even if it's faster than full ray-tracing. Just have to wait for faster GPUs.
http://nathanbiette.com/DOF.html

This topic is closed to new replies.

Advertisement