Depth Of Field & Blurry Alphas


(Bitgem) #1

I have been experiencing problems with using the DOF feature for models that use alpha transparencies. Alpha planes are rendered blurry at much closer distances from the camera than the solid models. The problem is particularly obvious here. https://sketchfab.com/models/f748daa0404d443c944d4dc3a1bab092 (zoom out to see the border where the transparency starts). Maybe I am doing something wrong or missing some setting?


(Rémy Bouquet) #2

Hello, you should try to use dither transparency mode.


(Bitgem) #3

Thanks for the tip! I did try that and it works quite well on static models... but does not seem to agree well with animated ones. The dithering becomes quite noisy (changed it to dithered now so you can see what I mean)


(Rémy Bouquet) #4

Yeah.. that's the trade off with dither.
Not sure there is a solution to your problem though, alpha blending and dof don't play well together for technical reasons. Dither works ok with dof on static models. I'm afraid you hit the corner case combination of dof + transparency + animation.


(Bitgem) #5

Alright, then I'll just scrap the animation and set a camera limit. Problem solved! :slight_smile:


(Stephomi) #6

Transparent pixels will use the depth available behind them.
Since there's nothing behind your transparent pixels, it's considered "far away" and thus is fully dof'd.

Since you are using a flat color background, you can put an opaque quad (with same color as your background) below your transparent quad.
Maybe it's not worth the hassle, but it might work in this particular case.


(Bitgem) #7

Ah that's a great tip. I'll give that a try. Thanks!