-
DIY depth of field
My math(s) isn’t up to this.
I have a camera pointing at a bunch of 3d layers to which I want to add depth of field. The default depth of field looks pretty horrible (they’re stark black and white so the box blur effect is obvious). I tried using the lens blur effect with a custom map, but when the layers move in 3d this stops working, plus it takes ages to calculate. So, I thought I’d improvise – applying a gaussian blur effect to each layer, than determining how much to blur it by its distance from the camera’s focal plane, multiplied by a slider value. It’s imperfect (and wouldn’t work for a layer that’s almost at 90 degrees to the camera of course, where the back is significantly further away than the front) but it’ll do.
The problem is that I can’t work out how to calculate a plane which is normal to the camera direction (centred on the point of interest) and then the shortest distance from the target layer to this plane. Any ideas?