How do I get a correct z-depth pass using cutout opacity in the standard surface shader?

How do I get a correct z-depth pass using cutout opacity in the standard surface shader?

Sabine_FÃ_reder
Not applicable
1,637 Views
2 Replies
Message 1 of 3

How do I get a correct z-depth pass using cutout opacity in the standard surface shader?

Sabine_FÃ_reder
Not applicable

When I use a standard surface shader with a matte plugged into cutout opacity, I get a z-depth pass where that opacity is ignored. Therefore the z-depth pass is not usable for post DOF as the areas behind the object will not be blurred. Is it possible to get a correct z-depth pass with cutout opacity? Or does anybody know a workaround for that?

0 Likes
1,638 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

As far as I know, the z-depth AOV only considers geometry attributes and not material attributes. So unfortunately opacity won't carry over.

Depending on how complicated your scene is, you could try setting up multiple Takes (foreground, mid-ground, background) and composite them all back together again in your preferred compositor. You could rebuild a complete z-depth pass by compositing the z-depth AOVs of each separate Take by using the alphas of the beauty passes (or custom masks... whichever you prefer) to cut each z-depth layer out.

0 Likes
Message 3 of 3

Anonymous
Not applicable

@Sabine Füreder You can go with Deep exr workflow or create a sampler info node and connect point camera to a surface shader's color input and you get the camera info

0 Likes