Page 1 of 1

DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 12:19 pm
by Dennis Fassbaender
Hi everyone,

this time im trying to find out how to have post-dof using EXR-Files exported from blender.
I have seen a tutorial on youtube where some one explains how it works using a luminance-map and the chanel-booleans-tools.
That will not work with my file :( because i cannot find "luminance FG" in the aux-chanel-list.

What i have:
An EXR File including passes like "z depth" and "z mist".
Z Depth gives me a complete WHITE Image wehil
z Mist gives me a "maybe-usable" deph map.

Ive tryed various combinations but still cant get it working.
Last thing i´ve tryed was to use the channelBooleans to load the MistZ-Pass and deliver it vias Aux-channels to the z-buffer ... maybe im thinking and doing wrong.

Ill attach the EXR and COMP, hopefully somone can explain how that can work :)?
EXR + COMP can be downloaded here:
https://www.dropbox.com/s/r7ihvkpqz652j ... R.rar?dl=1

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 2:53 pm
by Ryan Bloomer
In your zDepth, do your values go over 1? try using the "show normalized image" on your Display View. It's a little icon next to the 1:1..... after doing that does it show a greyscale image?

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 3:48 pm
by Dennis Fassbaender
when checking normalized image:

z Dephth gives me a black&white image - no gray-gradients or something like that.
z Mist givs me gray gradients.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 3:54 pm
by michael vorberg
Your second image seems to be the right way. Now you have the depth in fusions z channel
You can check this if you turn on subviewer with color inspection. If you no hover your mouse of the viewer you should see the values changing

No you could use the depth blur node and set it to use the z channel, pick your focal point and play with the other values

Fusion expects negative direct distance to the camera. This means values get bigger and bigger the further away
You can check this by rendering a z channel from fusion render3d

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 4:23 pm
by Dennis Fassbaender
Great Michael - as i can see there is truely some depth and i found out that i can use it directly without additional tools.
The only thing i do not like yet, is that the "infocus"-Object has a soft-border - like it is glowing.
How can i fix this? Ive tryed to use less blur, but i will never fix it 100percent.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 4:48 pm
by Eric Westphal
By design, a z-channel does not have any antialiasing. You RGBA-render *does* have AA.
Hence those border-like artifacts.

As said, it's basically the tech-specs of a z-buffer.
Because a pixel belonging to an object can either be close to the camera, or far away.
If you had two objects, one close to the camera, one far away, overlapping each other,
how would antialiasing on the edge work?
Actually not too well, as it would create pixels that are "half way between" close and far.
(which, obviously, would be incorrect...:-))

Fusion does support AA for all channels in it's own renderer.
However, you might be better off to export EXR with WorldCoordinate channels,
project the RGBA image onto a Camera-Image-Plane,
displace that plane with the WorldCoordinates,
and render the DOF in Fusion itself.

Cheers.

Eric.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 5:00 pm
by Dennis Fassbaender
Interesting. Thank you for the technical informations!
As i dont know how to output world-coordinates out of blender- can someone tell me how the right workflow is looking like?
In future id like to use animations and be able to change the focuspoint in postproduction.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 5:06 pm
by Chad Capeland
Dennis Fassbaender wrote:Interesting. Thank you for the technical informations!
As i dont know how to output world-coordinates out of blender- can someone tell me how the right workflow is looking like?
In future id like to use animations and be able to change the focuspoint in postproduction.


You could also just output your scene geometry.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 5:17 pm
by Dennis Fassbaender
You mean exporting the 3d-scene as 3d-scene?

Passes avaiable see screenshot.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 7:58 pm
by Chad Capeland
If you save out the geometry, you don't have to set up proxy meshes. But if you output the passes, it's fairly easy to track changes without much of a system.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Mar 25, 2016 9:14 pm
by michael vorberg
You have to create a shader for the world coordinate pass in blender cycles (and once you have figured this out you can enjoy the whole world of fusions position tools)
Not in front of a computer but I try to explain it:
Geometry - > position - > Emission color
Render that with 1sample and no clamping

You should already keep in mind that you should switch the green and blue channels because of Y up against Z up coordinates

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Sat Mar 26, 2016 12:26 am
by Dennis Fassbaender
I do not realy know what i can do, now.
In Blender is no option to export "world coordinates".
I just have a z pass and a mist pass.

- Im not sure HOW to connect the DepthBlur node. Connecting anything to the "blur image" input does not do anything.

- Also i have the question: Do i need channelbooleans or not? It is to deliver something to the z buffer but is that needed when my EXR file has z information inside?

- As i can read the z pass isn´t antialiased. While the mist pass is an antialiased z pass.
So, why do i have a little bit of blurry edges on the object that is in focus?

Why cant we find deeper information for fusiontools in the web? I just found a toollist with discriptions, but it does not tell me what inputs and outputs a node have.

Thank you guys for helping me :)

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Sat Mar 26, 2016 1:47 am
by Chad Capeland
The mist pass is wrong. That's why there's Z Coverage passes. Because a blend between near and far isn't middle. It's some near and some far.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Sat Mar 26, 2016 6:53 am
by Eric Westphal
In terms of the WPP, have you tried this resource?
http://blender.stackexchange.com/questi ... -pass/7398

In terms of Fusion on the web, there used to be a *huge* online resource called VFXPedia.com
with lots of community-generated tips, tricks, examples, etc.
Unfortunately BMD took it down when they acquired eyeon.

It was rescued from extinction by the fantastic folks at steakunderwater:
http://www.steakunderwater.com/VFXPedia ... =Main_Page
Might not be the latest version, but there's still a wealth of information there.

Cheers.

Eric.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Sat Mar 26, 2016 6:34 pm
by Dennis Fassbaender
Great thank you for the informations.
I got it, rendered out the positionmap from blender.

Now, what is my node setup to go?

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Thu Mar 31, 2016 8:39 pm
by Dennis Fassbaender
So, please. I cant figure out how to use my world-map to control DepthBlur.
Would someone explain please :)?

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 2:37 pm
by Ryan Bloomer
I don't have a 3D scene set up to show quickly, but maybe you can reverse engineer this example. The loaders are just an RGB beauty and position.

Code: Select all
{
   Tools = ordered() {
      RGB = Loader {
         Clips = {
            Clip {
               ID = "Clip1",
               Filename = "RGB_0014.tif",
               FormatID = "TiffFormat",
               StartFrame = 14,
               Length = 73,
               LengthSetManually = true,
               TrimIn = 0,
               TrimOut = 72,
               ExtendFirst = 0,
               ExtendLast = 0,
               Loop = 1,
               AspectMode = 0,
               Depth = 0,
               TimeCode = 0,
               GlobalStart = 0,
               GlobalEnd = 72,
            },
         },
         NameSet = true,
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1470.73, 233.89, }, },
      },
      Position = Loader {
         Clips = {
            Clip {
               ID = "Clip1",
               Filename = "position0014.tif",
               FormatID = "TiffFormat",
               StartFrame = 14,
               Length = 73,
               LengthSetManually = true,
               TrimIn = 0,
               TrimOut = 72,
               ExtendFirst = 0,
               ExtendLast = 0,
               Loop = 1,
               AspectMode = 0,
               Depth = 0,
               TimeCode = 0,
               GlobalStart = 0,
               GlobalEnd = 72,
            },
         },
         CtrlWZoom = false,
         NameSet = true,
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1467.25, 142.722, }, },
      },
      DepthBlur1 = DepthBlur {
         Inputs = {
            XBlurSize = Input { Value = 4, },
            FocalPoint = Input { Value = 528.571428571429, },
            DepthOfField = Input { Value = 728.5714286, },
            ZScale = Input { Value = 47.6190476, },
            Input = Input {
               SourceOp = "RGB",
               Source = "Output",
            },
            BlurImage = Input {
               SourceOp = "ChannelBooleans1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1662.87, 232.865, }, },
      },
      ChannelBooleans1 = ChannelBoolean {
         Inputs = {
            ToGreen = Input { Value = 0, },
            ToBlue = Input { Value = 0, },
            EnableExtraChannels = Input { Value = 1, },
            ToZBuffer = Input { Value = 0, },
            Background = Input {
               SourceOp = "Position",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1651.6, 141.68, }, },
      },
   },
}

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 5:03 pm
by Dennis Fassbaender
Nice Ryan- thank you.I´ve loaded my files into the loader, but it will not work.
I upload the world and the rgb map to DropBox- would you please check it and tell me what is wrong?
https://www.dropbox.com/s/za6u26x5nro7p ... t.rar?dl=1

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 5:34 pm
by Ryan Bloomer
any chance you can use .zip I don't have unRarX..... if I find time between production I'll take a look

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 5:58 pm
by Dennis Fassbaender
Of course here it is:
https://www.dropbox.com/s/mb2uwlxpyna0m ... t.zip?dl=1

Thats nice :) Thank you!

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 8:20 pm
by Ryan Bloomer
Try this Dennis,

The scale is pretty small, so the sliders are really touchy... best to manually put in values... or create a macro to work with a smaller scale. If you want to use the "pick" feature in the focal point make sure you're grabbing from the position pass not the RGB render. IE. load the channeBooleans in viewer 1 and use "pick" from that view.

Hope that helps.

Code: Select all
{
   Tools = ordered() {
      Loader2 = Loader {
         Clips = {
            Clip {
               ID = "Clip1",
               Filename = "C:\\Users\\Owner\\Desktop\\Fusion_ForumHelp\\DepthTest\\DepthTestB_0200.exr",
               FormatID = "OpenEXRFormat",
               StartFrame = 200,
               LengthSetManually = true,
               TrimIn = 0,
               TrimOut = 0,
               ExtendFirst = 0,
               ExtendLast = 0,
               Loop = 0,
               AspectMode = 0,
               Depth = 0,
               TimeCode = 0,
               GlobalStart = 0,
               GlobalEnd = 0,
            },
         },
         CtrlWZoom = false,
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            ["Clip1.OpenEXRFormat.RedName"] = Input { Value = FuID { "Composite.Combined.R", }, },
            ["Clip1.OpenEXRFormat.GreenName"] = Input { Value = FuID { "Composite.Combined.G", }, },
            ["Clip1.OpenEXRFormat.BlueName"] = Input { Value = FuID { "Composite.Combined.B", }, },
            ["Clip1.OpenEXRFormat.AlphaName"] = Input { Value = FuID { "Composite.Combined.A", }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1559.8, 274.681, }, },
      },
      DepthBlur1 = DepthBlur {
         Inputs = {
            Filter = Input { Value = 2, },
            XBlurSize = Input { Value = 8.0952381, },
            FocalPoint = Input { Value = -2.56204557418823, },
            DepthOfField = Input { Value = 2, },
            ZScale = Input { Value = 1, },
            Input = Input {
               SourceOp = "Loader2",
               Source = "Output",
            },
            BlurImage = Input {
               SourceOp = "ChannelBooleans1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1813.14, 255.975, }, },
      },
      ChannelBooleans1 = ChannelBoolean {
         Inputs = {
            ToGreen = Input { Value = 0, },
            ToBlue = Input { Value = 0, },
            EnableExtraChannels = Input { Value = 1, },
            ToZBuffer = Input { Value = 0, },
            Background = Input {
               SourceOp = "Loader3",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1805.87, 125.79, }, },
      },
      Loader3 = Loader {
         Clips = {
            Clip {
               ID = "Clip1",
               Filename = "C:\\Users\\Owner\\Desktop\\Fusion_ForumHelp\\DepthTest\\DepthTestB_World_0200.exr",
               FormatID = "OpenEXRFormat",
               StartFrame = 200,
               LengthSetManually = true,
               TrimIn = 0,
               TrimOut = 0,
               ExtendFirst = 0,
               ExtendLast = 0,
               Loop = 0,
               AspectMode = 0,
               Depth = 0,
               TimeCode = 0,
               GlobalStart = 0,
               GlobalEnd = 0,
            },
         },
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            ["Clip1.OpenEXRFormat.Channels"] = Input { Value = 1, },
            ["Clip1.OpenEXRFormat.RedName"] = Input { Value = FuID { "Composite.Combined.R", }, },
            ["Clip1.OpenEXRFormat.GreenName"] = Input { Value = FuID { "Composite.Combined.G", }, },
            ["Clip1.OpenEXRFormat.BlueName"] = Input { Value = FuID { "Composite.Combined.B", }, },
            ["Clip1.OpenEXRFormat.AlphaName"] = Input { Value = FuID { "Composite.Combined.A", }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1471, 137, }, },
      },
   },
}

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 8:39 pm
by Chad Capeland
Ryan Bloomer wrote:Try this Dennis,

The scale is pretty small, so the sliders are really touchy... best to manually put in values... or create a macro to work with a smaller scale. If you want to use the "pick" feature in the focal point make sure you're grabbing from the position pass not the RGB render. IE. load the channeBooleans in viewer 1 and use "pick" from that view.

Hope that helps.

Code: Select all
{
   Tools = ordered() {
      Loader2 = Loader {
         Clips = {
            Clip {
               ID = "Clip1",
               Filename = "C:\\Users\\Owner\\Desktop\\Fusion_ForumHelp\\DepthTest\\DepthTestB_0200.exr",
               FormatID = "OpenEXRFormat",
               StartFrame = 200,
               LengthSetManually = true,
               TrimIn = 0,
               TrimOut = 0,
               ExtendFirst = 0,
               ExtendLast = 0,
               Loop = 0,
               AspectMode = 0,
               Depth = 0,
               TimeCode = 0,
               GlobalStart = 0,
               GlobalEnd = 0,
            },
         },
         CtrlWZoom = false,
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            ["Clip1.OpenEXRFormat.RedName"] = Input { Value = FuID { "Composite.Combined.R", }, },
            ["Clip1.OpenEXRFormat.GreenName"] = Input { Value = FuID { "Composite.Combined.G", }, },
            ["Clip1.OpenEXRFormat.BlueName"] = Input { Value = FuID { "Composite.Combined.B", }, },
            ["Clip1.OpenEXRFormat.AlphaName"] = Input { Value = FuID { "Composite.Combined.A", }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1559.8, 274.681, }, },
      },
      DepthBlur1 = DepthBlur {
         Inputs = {
            Filter = Input { Value = 2, },
            XBlurSize = Input { Value = 8.0952381, },
            FocalPoint = Input { Value = -2.56204557418823, },
            DepthOfField = Input { Value = 2, },
            ZScale = Input { Value = 1, },
            Input = Input {
               SourceOp = "Loader2",
               Source = "Output",
            },
            BlurImage = Input {
               SourceOp = "ChannelBooleans1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1813.14, 255.975, }, },
      },
      ChannelBooleans1 = ChannelBoolean {
         Inputs = {
            ToGreen = Input { Value = 0, },
            ToBlue = Input { Value = 0, },
            EnableExtraChannels = Input { Value = 1, },
            ToZBuffer = Input { Value = 0, },
            Background = Input {
               SourceOp = "Loader3",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1805.87, 125.79, }, },
      },
      Loader3 = Loader {
         Clips = {
            Clip {
               ID = "Clip1",
               Filename = "C:\\Users\\Owner\\Desktop\\Fusion_ForumHelp\\DepthTest\\DepthTestB_World_0200.exr",
               FormatID = "OpenEXRFormat",
               StartFrame = 200,
               LengthSetManually = true,
               TrimIn = 0,
               TrimOut = 0,
               ExtendFirst = 0,
               ExtendLast = 0,
               Loop = 0,
               AspectMode = 0,
               Depth = 0,
               TimeCode = 0,
               GlobalStart = 0,
               GlobalEnd = 0,
            },
         },
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            ["Clip1.OpenEXRFormat.Channels"] = Input { Value = 1, },
            ["Clip1.OpenEXRFormat.RedName"] = Input { Value = FuID { "Composite.Combined.R", }, },
            ["Clip1.OpenEXRFormat.GreenName"] = Input { Value = FuID { "Composite.Combined.G", }, },
            ["Clip1.OpenEXRFormat.BlueName"] = Input { Value = FuID { "Composite.Combined.B", }, },
            ["Clip1.OpenEXRFormat.AlphaName"] = Input { Value = FuID { "Composite.Combined.A", }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1471, 137, }, },
      },
   },
}


DepthBlur needs camera position (Z), not worldspace position. You can convert them, but you'd need to do that first.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 8:53 pm
by Ryan Bloomer
Thanks for the clarification Chad,

camera position is represented in a Zdepth pass separately or can be converted from a wpp through a channelbooleans by issolating the Z axis channel only, in his example, the RED channel.

Is that correct? Making sure I converted the data correctly, and fully understanding the tool.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 9:00 pm
by Chad Capeland
No, it's absolute world position, not relative to the camera. It's only correct at exactly one point in space, where absolute and relative overlap. If the camera moves, it will no longer work.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 9:20 pm
by Ryan Bloomer
It continues to work if you have an animated world position pass from the 3D render that matches the Beauty pass, and then you could animate the focal point (like rack focusing in the real world) right?

Can you render a 3D beauty pass animation with a camera move, import that 3D scene to fusion, and feed the animated camera to the depthBlur and it can solve the rack focus in fusion with out having to animate the focal point property (and not have to render a wpp animation)?

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 9:39 pm
by Dennis Fassbaender
Works great - i understand, now.

Thank you alot for helping me with that :)! Great forum!

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 10:45 pm
by Chad Capeland
You aninated objects in the scene or the camera position? Because a camera pan or orbit would break it pretty quickly. You can do funny billows / tiilt-shift effects, but it will be difficult to predict intuitively.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Fri Apr 01, 2016 10:59 pm
by Ryan Bloomer
Thanks Chad,

Makes sense, i'll play around with it some more. I've only really ever needed the effect without a camera move. I certainly like moving more control to comp than having to solve it in 3D.

Re: DepthBlur with EXR-Files? (Blender)

PostPosted: Thu Oct 07, 2021 3:47 pm
by Phönix 64
Hello, I just found this post in trying to solve the same issue and got it working. The problem is that Blenders Depth and Mist pass goes from 0 upwards so for example 0 to 100000 but FUsions or at least Davinci Resolve Fusions goes from 0 down so 0 to -100000. So what I did is I used a channel boolean to multiply my depth pass with the foreground alpha which I provided as -1, to get that just type -1 into the alpha of a background, and that fixed the fog node for me. Hope it helps.

Screenshot 2021-10-07 174556.png
Screenshot 2021-10-07 174556.png (262.53 KiB) Viewed 2732 times

Screenshot 2021-10-07 174539.png
Screenshot 2021-10-07 174539.png (31.16 KiB) Viewed 2732 times

Screenshot 2021-10-07 174458.png
Screenshot 2021-10-07 174458.png (339.96 KiB) Viewed 2732 times