Pro DOF Trick


Did you know that it is possible to get proper Depth Of Field inside of c4d? One that handles alpha channels, reflections, transparency, motion blur, HAIR correctly, with no need to composite in another program?

Crazy talk!

Not exactly, you just have to think ‘outside of the box’
These images are straight out of c4d, no processing…

Anyone care to guess how I’m dong it? :wink:

First hint: No plugins or modules needed for DOF. Works with older versions of c4d.


How? tweaked own dof?! :wink:


Magic ofcourse…so obvious. :stuck_out_tongue:


Hmmm, maybe he’ll just tell us… and then someone can pick it apart. :stuck_out_tongue:


Let me guess: you don´t look directly through the camera - instead you look at a slighty blurred mirror, which will blur reflected objects according to their distance…


Im thinking it might have something to do with loading a world space/camera space gradient shader directly into one of the channels in the hair material?


Ilay: Nope, no tweaking necessary
Umblefugly: Excellent guess :wink: Not magic.
JoelD: Nope. Works with all materials and modules including hair, but it doesn’t require any of them.
LordSaddler: You are getting warm. But its even easier than that.

It only works with blurring objects off into the distance from the focal point outward.
Its not especially fast, but I’ve had luck tweaking it and getting OK performance.
Works correctly with all materials, transparency, reflectivity, etc.


Place the objects and camera within a cube or sphere with blurry transparency turned on?

EDIT–what? that cant work :stuck_out_tongue:


I think that is the trick, at the c4dlounge marijn was able to do just that.


my guess is that you have read an old dof tutorial by Per-Anders.


Here we go:



Yes --however, one of the rules was that no post compositing was needed.

(btw, thats still how I do much of my DOF)


DING! DING! DING! We have a winner. Congrats Joel. Thanks for playing everyone.

Here’s a scene file to see how it works.

Daan, I’ll check out that other forum. Do you have a link? I did a quick search before posting this, an didn’t see anything. Still it doesn’t surprise me that someone thought of this before, its been right under our noses for a long time.

To get it going with hair you need to change some settings in the hair render options.


thanks…i think, i saw somewhere it(tip)…(not pro in attach, but test)
Jonah, have you try something with remo spectral?..


@ Ilay, nice image was that made using this technique? If you find a link where you saw this before pls let me know. I am curious about spectral but don’t own it.

@ JoelD, BTW your prize is $1,000! I’ll send the check, it is in Zimbabwean dollars of course, so that works out to 2.65745 US Dollar (USD).


whoah! huh? what? DOH I won?

Well, you’ve helped my choose my next vaca spot…


Same, but cube-based(non-spherical lens) as many phys.sim.rooms(dpit effex, remo ft and t4d’s container)

BTW, Jonah, is first GREEN(peace) Man at your pic? (yeti’s tales remind) ;)))


Definitely an interesting approach, though not sure if it would be the best solution for animation. You miss out on things like blooming and rack focus.

This thread also reminded me of Peranders old posts. Nice to read those again.


Yeah, that was me, but it’s all in Dutch (on, so I don’t think the posts are of much use to most people over here. I used this technique to make the render below. I was unable to do this any other way, because of the hair and the alpha leaves. Funny to see someone came up with the same thing! But yeah, if you think of it, it’s pretty logical.


Cheers Marijn. Excellent image!

Maybe i am partial, but i really like the look of this form of blur, it just appears more ‘real’ to my eye.

The maxon folks or moderators here could probably shed some light on why this is. I suspect that the algorithm of transparency and reflection blurs use take many samples per pixel at slightly different angles and averages them. This would explain why its grainy at low settings. If this technique could be fooled to work as a foreground blur it wold totally kick ass because that is where the fuzziness around the edges of object causes real problems with z-blurs.