0
$\begingroup$

I’m doing an enormous render for a poster and I have an image with pretty shallow depth of field. I’m trying to make a material pass so I can play with colors when compositing, but I can’t get the DoF of the Materials pass to match the DoF of the main image.

Without the defocus node the blurry section is just black or white dithered pixels. Once I add the defocus node, it just blurs everything, even the sharp areas.

Should I be just doing the depth of field for both the main mage and the material pass in the compositor? Right now I have the DoF of the main image done in the Camera tab.

enter image description here

$\endgroup$
5
  • 1
    $\begingroup$ Are you creating the DoF in the compositor with the Defocus node? Or using the camera settings? You need to stick to one system and use the same for both the material pass and the main color pass. Can you show us the node setup? $\endgroup$
    – Mike Pan
    Commented Feb 11, 2018 at 18:19
  • $\begingroup$ I’m using the camera settings but the extra camera passes don’t have smooth ramps from black to white. It just has black and white dots, so I tried to add the deficus node, but it just adds the defocus on top of the dithered image. Is there a way to get a smooth grayscale ramp on the camera passes when using the DoF in the camera settings. I’ll upload some screenshots when I get a chance. $\endgroup$ Commented Feb 11, 2018 at 18:37
  • 1
    $\begingroup$ ID passes by design are binary (a pixel can only belong to one object): developer.blender.org/T51121 Defocus node should do what you need it to do, please share your blender file or at least a compositing node setup. I suspect you are using defocus wrong. $\endgroup$
    – Mike Pan
    Commented Feb 11, 2018 at 21:23
  • $\begingroup$ I added a screenshot of a sample render. Top is the main image. It's got a DoF on it (left side is a little blurrier) via the camera tab. Below is the materials pass. The defocus node is muted. When I unmute the defocus node it just blurs that. I basically just need the chrome masked out from the background and I can't get the pass to match the DoF. I assume I'm doing something wrong or missing something. $\endgroup$ Commented Feb 11, 2018 at 23:29
  • $\begingroup$ For defocus to work correctly it needs to access the depth data. So you need to plug the 'Depth' output into the 'Z' input for the defocus node to correctly blur the image. $\endgroup$
    – Mike Pan
    Commented Feb 13, 2018 at 1:29

1 Answer 1

1
$\begingroup$

Pasting the correct answer here for visibility.

All ID passes (materials and object ID) by design are binary (a pixel can only belong to one object): developer.blender.org/T51121 This means you cannot use the ID passes when motionblur, depth of field, or transparency is involved. In your case, you can use the dofocus node on the material pass to create the DoF as a postprocessing step, which CAN create a blurry mask for you to use.

For defocus to work correctly it needs to access the depth data. So you need to plug the 'Depth' output into the 'Z' input for the defocus node to correctly blur the image.

$\endgroup$

You must log in to answer this question.

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