Using Z-Depth Render passes in Fusion

This is question I get on a almost weekly basis, how can I use my Z-Depth pass in fusion. For those of us who have been compositing for some time it is a dead simple thing to do but for those of you who are learning to composite or even just new to Fusion or other node based tools you might find this useful. First off if you are rendering OpenEXR files then chances are your Z-Depth pass will already be in the file which means all you need to do is add a depth blur node to your flow (see below), you can test to see if the Z-Depth pass is already present by clicking in the viewer and hitting “Z” on the keyboard. If you are rendering it as separate file or as a render element then I will show you how to incorporate the channel into your flow below.

Z-Depth Pass
A couple quick notes about z-depth passes. First off I want to take a moment to mention that you really should be saving your z-depth passes at a minimum of 16bits per channel the higher the better. Secondly make sure the you have enough range in your z-depth pass, you will want to make sure the all of or most of your scene is visible in the channel. Sticking to those two point you will ensure you have a good amount of “play” in your pass for when it comes time to picking the start and end points of fog etc.

Z Depth pass and Base render
Base render on the left with its zdepth pass on the right Although the z-depth pass is very white is was saved in float as a EXR so there is plenty of range.

The Fusion Comp
The fusion comp is very simple. The process I use is the most basic it involves loading your beauty pass then adding a “Channel Booleans” to the flow (make sure the beauty pass is connected to the BG input). Now load your z-depth pass and pipe it into the FG input of the channel booleans.  Select the channel booleans and set the “Red”, “Green”, “Blue” and “Alpha” channel to “Do Nothing”. Now hit the “Aux Channels” tab, click the “Enable Extra Channels” radio button. Once the Auxillary channels are enabled select the z channel and set it to “Luminance FG”.

Channel Booleans Setup

Setting on the channel booleans node.

That process basically copy’s the z-depth pass to the z-channel of your flow which will carried all the way down your comp from this point on. This means that at any point in your comp you can access that Z-Depth information. A couple quick points you can view the Z-Depth channel by clicking in the viewer and hitting “Z” (You can push “C” to get back to colour) if you see a red “X” in the viewer then something has gone wrong as the view is unable to display a Z channel. If you see black you might want to try hitting the “Normalize Luminance” button which is the right most button at the bottom of the viewer, this will normalise the data so it can be viewed generally speaking you will only need to do this if your Z-Depth pass is in floating point, remember to turn it off otherwise your results will vary frame to frame. If you ever leave it on and do a couple hours worth of colour correcting only to realise your output is still being normalised, I guarantee you will only do it once!

Fusion Flow
Notice that teh z-depth loader is the top node that is being piped into the “FG” input of the channel booleans.

To quickly recap, we have copied our Z-Depth pass into the Z Channel of comp so that it can now be accessed. Lets move on and do something useful with it!

Depth Blur
There are many nodes inside of fusion that can take advantage of the z-channel. Nine times out of ten everyone wants to use there Z-Depth pass to create a DOF (Depth of Field) effect in post, so thats what we will concentrate on.

Luckily in Fusion this is very easy to do the Depth Blur node is very quick and easy to use and although it does not generate the very best effect allot of the time in can be used to enhance a scene, in any case it is one the building blocks to generate a really nice effect (That might be the focus of another tutorial?).

So lets go ahead and add a Depth Blur node by right clicking in the node view and selecting Add Tool -> Deep Pixel -> Depth Blur.

Fusion Add Depth Blur Screen Capture
Fusion Add Depth Blur node

You can now use the “Pick” focus point tool to set the focus area, you can also use the slider to for finner control.  Most of the controls are pretty straight forward the best way to get your had around them is play with them and check out the results. You can see the results of an example I prepared earlier below. Also try experimenting with the Fog node.

Base render with depth blur and fox applied to it.

Base render with depth blur and fog applied to it.

If you have any ideas for other 3d or 2d tutorials please let me know here. I hope that helps you out next time you are having trouble with Z-Depth Passes. If you do run into any trouble then post a comment! Happy Compositing!

Comments
16 Responses to “Using Z-Depth Render passes in Fusion”
  1. Nikita says:

    Thnx, man!
    It’s simple and clear, but I’ve already have been found this way by my self)

  2. AiB says:

    thankx…………..

  3. abhineet says:

    thx bro!!

  4. angelnuclear says:

    It´s clear, but … I´m using Fusion 6.2

  5. angelnuclear says:

    It´s clear, but …. I´m using Fusion 6.2 and there is no “Luminance FG”, there is “Lightness FG”, is it the same? When I hit Z to view my Z buffer it shows a white screen (the z buffer image shows all the grayscale). So when I do the Depth Field, all the image blurs, no depth of field ;(

  6. Dave says:

    Yep Lightness FG will do.

    Cheers,
    Dave

  7. Mark says:

    hey there angelnuclear, i have recently upgraded from 5.2 and to 6.2 and im having the exact same issue! is there a solution for what im doing wrong?

    thanks

    Mark

  8. André says:

    this does not work – trying the workflow for over an hour right now.

    using 16bit tiff (floating) and arranged it exactly as described.
    it just blurs the whole image – also if you click on “focal point – Pick” there’s nothing you can do (what is this silly function for?)

    doing the same in afx: 10 seconds – in fusion: hell of a settings/click and drag orgy with no result.

    very frustrating software…

  9. André says:

    gave it another try – rendered everything again to be sure that there is 16bit floating (single output, zdepth and rgb as .tif).
    what should i say?

    it – does – not – work!

    can’t figure out where the problem is but it seems to be fusion itself.
    adobe’s layer-based-chaos has no problem with that.

    maybe fusion needs an “extra on top special hidden mega hyper” – layer to work with that.
    i don’t know….

    me: 0 fusion: 1

  10. André says:

    ok – tried it in nuke also: works.
    just an .exr with a zdepth and done.

    nuke has other issues – and all of these issues that node-based-compositing software “offers” is completely erased by after effects.

    so i will no longer do the game of trial and error here and change back to the layer-based-workflow.
    which is – for me – much faster, more logically and smooth.

    for your article here: nice to see that it works for you and on your machine/fusion.

    regards,
    andré

  11. Dave says:

    Hi André,

    I am sorry to hear you could not get it working. Somethings have changed in the latest version of Fusion which may have been causing you some grief. I will update the tutorial in the coming weeks so it is a bit clearer.

    Happy composting.

    Cheers,
    Dave

  12. pls can you send me or share to in web how to make zdepth in fusion tutorials like

    http://daveandgoliath.com/2010/07/04/using-z-depth-render-passes-in-fusion/

    this is old version new version(6.4) is wrong

  13. sandeep kathait says:

    ohh man i am hving the same problem in 6.3,earlier it was working fine.hey dave …please share some fixes for this problem.

  14. Dave says:

    Ok so I guess I should create a new Z-Depth tutorial. Seems like a lot of you are having trouble with this updated one. Expect a new one in a week or so.

  15. happy:) says:

    can you create macro of convert 2D image or video in to 3D,

    this Zdepth merge techic use in macro

Trackbacks
Check out what others are saying...
  1. […] is AMAZING how often people ask me about this. I wrote a tutorial way back in 2010 about how to use Z-Depth passes in Fusion. To this day it still gets a lot of traffic. However, […]



Leave A Comment