6
$\begingroup$

I find that using depth of field (DOF) distorts the render pass masks, especially for very out of focus objects with a low f-stop (large aperture). I am trying to get around this by making a separate render layer with no DOF which I will only use for pass index masks. But I have not found a way to use no DOF on a specific render layer. So is it possible to tell blender to not use any DOF in a specific render layer, either directly or by using a different camera?

$\endgroup$
4
  • $\begingroup$ AFAIK this is not possible, however you could get around this by using a linked scene with only the camera unlinked. See blender.stackexchange.com/q/15286/599 and blender.stackexchange.com/q/3237/599 $\endgroup$
    – gandalf3
    Commented Nov 26, 2014 at 6:21
  • $\begingroup$ @gandalf3 That works great! One problem though: can I make it such that whenever I add an object in one scene it will be in both scenes? $\endgroup$
    – PGmath
    Commented Nov 26, 2014 at 23:53
  • $\begingroup$ AFAIK, no. But you can press Ctrl L link object to scene to link it, and with a python script you could probably automate that. $\endgroup$
    – gandalf3
    Commented Nov 27, 2014 at 6:04
  • $\begingroup$ @gandalf3 if you put the multi-scene solution in an answer I will be happy to accept it. It works like a charm! $\endgroup$
    – PGmath
    Commented Dec 1, 2014 at 18:14

2 Answers 2

7
$\begingroup$

You can use multiple scenes:

  1. Add a new scene by pressing the + at the top of the screen and selecting Link Objects:

    enter image description here

    This will link the objects into a new scene. This way modifying any object will change it in both scenes.

  2. In the new scene, select the camera and unlink it from the first scene by pressing U> Object Data. Then set the camera's aperture size to 0 to disable DoF. Note that the aperture must be set to radius for this to work.

  3. Then you can get the render results of both scenes in the compositor by using multiple renderlayer nodes:

    enter image description here

    Note that each scene has it's own compositing node tree, so it might be confusing if you have composite nodes in both scenes. I usually like to keep all the composite nodes in one scene.

If you add any new objects to one scene, they can be linked to the other scene by selecting them and pressing ⎈ CtrlL> Link objects to scene and then selecting the scene you want to link to.

$\endgroup$
-3
$\begingroup$

I presume you are using Cycles.

You should not use camera Depth of Field but instead use the Z value pass (enabled by default in your render layers) in the compositor (ex. with Defocus node).

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .