PDA

View Full Version : Depth of Field & ways of doing it


mindsample
09-07-2009, 10:47 AM
Hi there,

I am working on a fully animated shortfilm and we are currently trying to establish a pipeline for reliable, high quality depth of field. Rendertimes and flexibility are an issue, so it appears at our current state of knowledge that a 3D DOF is not feasible. A 2d approach seems obvious but results were not very encouraging. (transparency issues, strong foreground blur creates artifacts, object boundary issues)

From my experience in feature vfx we usually used floating point depth passes in conjunction with a a compositing package defocus as a standard. The results were almost always acceptable, however personally I never really liked the look of it. On the other hand we rarely ever dealt with CG elements which were "completely" out of focus, i.e. really close to the camera - something which would obviously occur a lot if you work in full-cg animation - so it was actually always quite a subtle effect.

I never worked in animation, only in vfx, so I am not 100% sure how this is usually approched in feature animation?

In your own experience, what is a good way to get good results for DOF. Please keep in mind aspects such as rendertime, quality, flexibility etc. Do you have any preferred pipeline? Any preferred applications?

We are using maya and mental ray and currently shake as a compositing package, however there is no particular reason for the use of shake other than a good familiarity with it - if there is a reason to change app, we'd be happy to do so.

Many thanks!

csmallfield
09-07-2009, 10:57 AM
I don't think that there is a way to achieve the quality of 3D DOF with a 2D pass, you can get something that looks nice, but not perfect. Pitfalls include, DOF in reflections don't work properly, artifacts etc.

There is a reasonable way to get something inbetween, in terms of quality without too much of a render hit. Render your animation without it, then make a pass in which you project your full comp as an image sequence back on to the Geometry, with the ambient light of the textures at 100% and the diffuse at 0%, render this with DOF. You are getting the full quality render, but the DOF is just rendering a texture without the need for raytracing or any lights at all, so it renders fairly quickly. This can work for motion blur as well.

It still doesn't solve the reflection issue, and it adds another step to production, but it's a hack I've used on commercials.

In animated features, I'm pretty sure Dreamworks and Sony do a post process, but they have teams of coders and compers to fix it till it's perfect, not sure on their techniques. But Pixar I'm fairly certain does nearly everything in the render. Renderman is pretty fast with it.

-Chris

mindsample
09-07-2009, 11:07 AM
Christopher,

- thanks fo rthe reply



There is a reasonable way to get something inbetween, in terms of quality without too much of a render hit. Render your animation without it, then make a pass in which you project your full comp as an image sequence back on to the Geometry, with the ambient light of the textures at 100% and the diffuse at 0%, render this with DOF. You are getting the full quality render, but the DOF is just rendering a texture without the need for raytracing or any lights at all, so it renders fairly quickly. This can work for motion blur as well.


That sounds very interesting - I never heard of this technique. Once you have rendered this pass how do you mix it with the existing composition?



In animated features, I'm pretty sure Dreamworks and Sony do a post process, but they have teams of coders and compers to fix it till it's perfect, not sure on their techniques. But Pixar I'm fairly certain does nearly everything in the render. Renderman is pretty fast with it.
-Chris

I would like to hear from people (without breaking ther NDAs) how bigger animation studios approach this. I just hope its not a matter of just having the farm-power to go all the way an do it in 3d no matter what.

I never really worked with renderman - for an average scene with a few lightsources, shadows and some raytracing - how much faster would you say (subjectively) is renderman with DOF compared to what MR produces?

ThE_JacO
09-07-2009, 11:45 AM
Hey Thomas, long time no see :)
This really belongs to the lighting/rendering forums, not in GD.

mindsample
09-07-2009, 11:47 AM
hey raf, no worries, move us over! :)

csmallfield
09-07-2009, 11:53 AM
It actually is your final comp. The idea is that it's the last step. If you change your comp, then re-project the updated comp on the geo and render it out again. It's not an elegeant solution, so it may not be the best thing to setup a pipeline around, but it's a workaround I've used.

As for Renderman's speed increase, I'm really not sure. I just know that Renderman uses some trademarked algorithms that make motion blur and DOF not as intensive and that there are a lot of renderers waiting for that trademark to expire. I think really the thing to do would be to setup a simple scene, and compare for yourself. I'm sure getting a license of renderman would be tricky for testing purposes, but you could learn a lot about the differences by trying it out in several renderers. Sorry I can't be much more help than that. It's the limit of my experience with this topic :)

-Chris

mindsample
09-07-2009, 11:57 AM
thanks again - alright, so the final comp is replaced by the blurred render of the final comp projected onto the scene. Interesting. I cant really imagine what that would look like so I guess I need to try it (unless you have an example you could throw my way?)

as for renderman - I have limited access to it, just never had the time & need to go for it (yet) so I will try it out.

p.s. brilliant matte painting! good work!

playmesumch00ns
09-07-2009, 01:08 PM
As for Renderman's speed increase, I'm really not sure. I just know that Renderman uses some trademarked algorithms that make motion blur and DOF not as intensive and that there are a lot of renderers waiting for that trademark to expire. I think really the thing to do would be to setup a simple scene, and compare for yourself. I'm sure getting a license of renderman would be tricky for testing purposes, but you could learn a lot about the differences by trying it out in several renderers. Sorry I can't be much more help than that. It's the limit of my experience with this topic :)

-Chris

RenderMan has lightning-fast DOF because of the Reyes algorithm, which isn't patented. A cheaper alternative than PRMan is 3Delight which allows you a free licence for non-commercial use.

lazzhar
09-07-2009, 01:15 PM
RenderMan has lightning-fast DOF because of the Reyes algorithm, which isn't patented. A cheaper alternative than PRMan is 3Delight which allows you a free licence for non-commercial use.
It's free even for commercial use, but you can only use 2 cores and cannot use in a farm.

mindsample
09-07-2009, 01:20 PM
Thanks for that - it appears to me - and I might be wrong - that Renderman is the renderer of choice for animations. I know both MR and RM are used for vfx, but is mental ray ever been used for a large scale feature animation?

In your personal opinion, going for a full CG approach where motion blur and DOF and displacements are more important than physically accurate GI and reflections, which renderer should be my choice?

I am thinking renderman but as I said earlier I have plenty of MR experience but almost no RM experience ...

playmesumch00ns
09-07-2009, 04:19 PM
In your personal opinion, going for a full CG approach where motion blur and DOF and displacements are more important than physically accurate GI and reflections, which renderer should be my choice?

I am thinking renderman but as I said earlier I have plenty of MR experience but almost no RM experience ...

Then that should guide you as well... you need to consider how long it will take you to get used to another renderer. Download 3Delight, have a play for a few days with it before deciding if you think you can accomplish what you need with it.

If fast 3d motion blur, dof, displacement and subdivision surfaces are more important to you than raytracing, then renderman is the obvious choice providing you can use it to get what you want. Neither 3Delight nor PRMan are that slow at raytracing these days, and point-based colour bleeding kicks the crap out of final gathering anyway...

Oh and the phrases "physically correct" and "mental ray" should never be used in a sentence together :)

mindsample
09-07-2009, 04:25 PM
Since your last reply I already started using 3ddelight and a trial of renderman for some tests and already more or less out of the box my results are much more desirable and about 3,5times faster. DOF really is the big selling point for me so I think my choice is made. Even if I discover a downside later on, for me personally there is no point in approaching a cg film without a "real" lens feel, and doing it in post just never would deliver that. So 3d DOF it is, and Renderman is to be purchased ...

Mic_Ma
09-08-2009, 01:08 AM
Hi there. Have a look at Mantra too, its micropolygon engine works with a reyes-like algorithm, the DOF is very fast and you get unlimited render tokens, and really flexible shading.

mr Bob
09-08-2009, 07:25 AM
I was also going to add Mantra handles DOF and motion blur very well indeed .....

b

sundialsvc4
09-08-2009, 01:58 PM
There are other renderers which implement this algorithm, such as Aquis, but obviously "the whole thing has to fit together" in relation to whatever workflow/pipeline you now have. You've got the proverbial "Smokey and the Bandit problem": a long way to go and a short time to get there ... :D

As for me, I'd love to see example shots and/or tutorials (links to...) with regard to several of the techniques described in this thread. The projection technique sounds very interesting. But even so, when the thread says "this is more pleasing than that," I'm thinking to myself, "show me, please, 'this' and 'that.'" :)

ganzo
09-14-2009, 07:36 PM
I don't know if this will work for you, but you could try to use the p_z mental ray shader from the shaders_p package made by a dude named "puppet". Its also a depth pass shader but different than an overall zdepth pass. It has got distance parameters similar to how you might set up 3d DOF. I used this in conjunction with nuke and think it provided fairly decent results. Its also another option you might try out and just see if the quality fits your needs.

mindsample
09-17-2009, 12:46 PM
Thanks guys - I think in the long run there is no way of doing this other than in the actual render (at least for what we want to achieve) and renderman seems to be providing everything I want for this so I will be sticking with it for now. After 5 years of Mental Ray its time to move on, or at least stop being monogamous. (http://www.google.co.uk/search?hl=en&ei=tyGySsKyDpSL4Ab6sKGtDg&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=monogamous&spell=1)

israelyang
09-19-2009, 03:08 AM
mindsample
Given that in animation many elements are usually rendered separately, for studios that do DOF in post, they'd have the ability to blur extremely close up elements separately without artifact.
But yes the most ideal route would be having those calculated in 3d if can be done efficiently echoing other posters.

csmallfield
your technique sounds very interesting, thanks for sharing.

CGTalk Moderation
09-19-2009, 03:08 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.