Hello, blender artists. So, I’ve been playing with Maya lately, and have been specifically trying out the render layers. Recently, I discovered a really powerful way to create depth-of-field: a zdepth layer.
For those who don’t know, zdepth is a render of the image which is completely grayscale, and each shade of gray corresponds to the distance the object is from the rendering camera. There’s 256 shades of gray (of course). So for example, if the object is really far away, the object would be dark, maybe with a tone of 23, whereas if it were close, it would be something light, like 235.
Using this layer, you just pop it into your beauty pass layer’s channels in photoshop (or after effects, as it were), use Filter>Blur>Lens Blur and choose the shade of the object you want to focus on, and suddenly, you have depth of field!
So what I’m wondering, is if there’s any way to do this in Blender. I haven’t stumbled across a way yet. I’m wondering if anyone knows a way to cheat it, maybe using nodes. Any ideas?