Depth of field and render times

Hi there,

I noticed a strange behaviour of Krakatoa while using DOF and particle rendering method.
Let’s assume I have my camera outside of particle object, but pretty close, so that particles are filling almost entire frame.
Then I start approaching the subject and entering into the particles volume with DOF.
There’s a huge gap in performance: when camera is outside, rendering time is 5s. At some point when camera (not the target) enters the volume, the rendering time drastically increases (up to 10 minutes). I am shooting at ƒ/2.8 and 14mm, perspective projection.
Now I found a workaround for this: When I set the camera near clipping to about 10-20 it does not affect what’s visible on the frame at all, but cuts down the rendering of a problematic frame from 5-10minutes down to 10 seconds.

I think you could look into that because it could be a good optimization point for DOF rendering methods. Maybe worth it to incorporate it in future releases.

Best,

Drawing a particle out of focus involves calculating its circle of confusion and filling that with multiple samples. So if a particle is literally in front of the camera, the circle of confusion could potentially cover the whole screen, and you could end up with millions of samples drawn for just one particle.
Obviously, we cannot make a decision for you when to stop drawing a particle, that’s what clipping planes are for in the first place. Max defaults to 0 to infinity, and it is up to you to set these clipping values to optimize render times and what you see.
So I suspect we won’t add any automatic clipping, because some users might want to render everything the camera sees, regardless of the render time.

What we should do is DOCUMENT this behavior. :wink:
Thus I will add it to the Wish List as a documentation issue…