Jump to: Board index » General » Fusion

How do you use an ambient occlusion map?

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

joemart

  • Posts: 96
  • Joined: Wed Apr 14, 2021 3:16 pm
  • Real Name: Joseph Martire

How do you use an ambient occlusion map?

PostFri Dec 03, 2021 9:44 pm

I recently went into the https://3dtextures.me website to gather some textures for a project. I downloaded a number of different maps within the website:
BaseColor, Roughness, Normal, Height and Ambient Occlusion maps.

To my surprise, Ambient Occlusion was within the maps. In the tutorials that I've seen, the ambient occlusion is extracted by connecting the rendered result to the AmbientOcclusion node and then the Camera3D node is connected to it to create the effect. After this, you connect the AmbientOcclusion node to a bitmap and later to the masked input of a Brightness/Contrast node.

I'm not sure how exactly I would use the AmbientOcclusion map for the model that I downloaded. I'm sure it's something very simple, but I wasn't able to find anything in the internet that instructs on how to connect the AmbientOcclusion map to the model.
Offline
User avatar

Andrew Hazelden

  • Posts: 536
  • Joined: Sat Dec 06, 2014 12:10 pm
  • Location: West Dover, Nova Scotia, Canada

Re: How do you use an ambient occlusion map?

PostFri Dec 03, 2021 10:47 pm

There are several approaches you can go with in Fusion to use an ambient occlusion map.

If you have the free Steakunderwater Reactor package manager for Resolve/Fusion installed, I'd suggest you take a look at the "KickAss ShaderZ" toolset and explore the included surface material presets. The surface material collection uses only Fusion native surface materials nodes, and several of the example comps provided use AO maps.

Alternatively if you want to experience modern PBR surface material workflows inside of Resolve Studio/Fusion Studio v17, I highly recommend you check out LearnNowFX's gumroad website, and take a look at David Kohen's excellent AccuShaders plugin. It's a really well implemented material system upgrade that gives Fusion's 3D space a big boost with the addition of a Disney Principled PBR materials and even has enhanced HDRI/IBL support, and blurred reflections.

Either approach will get you started with using AO maps applied to your surface materials. :)
Mac Studio M2 Ultra / Threadripper 3990X | Fusion Studio 18.6.4 | Kartaverse 6
Offline

joemart

  • Posts: 96
  • Joined: Wed Apr 14, 2021 3:16 pm
  • Real Name: Joseph Martire

Re: How do you use an ambient occlusion map?

PostMon Dec 06, 2021 9:47 pm

Andrew Hazelden wrote:There are several approaches you can go with in Fusion to use an ambient occlusion map.

If you have the free Steakunderwater Reactor package manager for Resolve/Fusion installed, I'd suggest you take a look at the "KickAss ShaderZ" toolset and explore the included surface material presets. The surface material collection uses only Fusion native surface materials nodes, and several of the example comps provided use AO maps.

Alternatively if you want to experience modern PBR surface material workflows inside of Resolve Studio/Fusion Studio v17, I highly recommend you check out LearnNowFX's gumroad website, and take a look at David Kohen's excellent AccuShaders plugin. It's a really well implemented material system upgrade that gives Fusion's 3D space a big boost with the addition of a Disney Principled PBR materials and even has enhanced HDRI/IBL support, and blurred reflections.

Either approach will get you started with using AO maps applied to your surface materials. :)


I ended up following the guide I found in the "poliigon" url. As you said, there are many ways to approach this, I'm just wondering if multiplying the OcclusionMap with the DiffuseMap is one of those many ways? This is what they described in doing within the previously displayed URL when you scroll down to the AmbientOclussion section.



The presets from "KickAss ShaderZ" almost lit my computer on fire and made it explode and David Kohen seemed to have used his own custom PBR. I was thinking that I might implement this with the resources that Davinci Resolve has already implemented in.
Attachments
AOMap_Fusion.png
AOMap_Fusion.png (25.8 KiB) Viewed 1458 times
Offline
User avatar

Bryan Ray

  • Posts: 2485
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: How do you use an ambient occlusion map?

PostMon Dec 06, 2021 11:18 pm

I usually multiply the combined shader and the Ambient Occlusion with a Boolean node, like so:

Code: Select all
{
   Tools = ordered() {
      diffuse = BrightnessContrast {
         NameSet = true,
         ViewInfo = OperatorInfo { Pos = { 356.667, 43.7273 } },
      },
      CookTorrance1 = MtlCookTorrance {
         Inputs = {
            ["Diffuse.Color.Material"] = Input {
               SourceOp = "diffuse",
               Source = "Output",
            },
            MaterialID = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 498, 44.9394 } },
      },
      Reflect1 = MtlReflect {
         Inputs = {
            BackgroundMaterial = Input {
               SourceOp = "CookTorrance1",
               Source = "MaterialOutput",
            },
            ["Reflection.Color.Material"] = Input {
               SourceOp = "latlong_spheremap",
               Source = "Output",
            },
            MaterialID = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 656.667, 43.7273 } },
      },
      AmOcc = Background {
         NameSet = true,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 747.333, -10.2121 } },
      },
      ChannelBoolean1 = MtlChanBool {
         CtrlWZoom = false,
         Inputs = {
            OperationR = Input { Value = 6, },
            OperationG = Input { Value = 6, },
            OperationB = Input { Value = 6, },
            BackgroundMaterial = Input {
               SourceOp = "Reflect1",
               Source = "MaterialOutput",
            },
            ForegroundMaterial = Input {
               SourceOp = "AmOcc",
               Source = "Output",
            },
            MaterialID = Input { Value = 3, },
         },
         ViewInfo = OperatorInfo { Pos = { 766.667, 43.1212 } },
      },
      latlong_spheremap = Background {
         NameSet = true,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 454.667, 109.182 } },
      }
   }
}


Sources there are all just Backgrounds. You'd replace those with your Loaders with the appropriate bitmaps.

Alternately, I might use a ReplaceMaterial to apply the AO directly to the geo and break that off into a second render, then use the result as a mask source for a color corrector in 2d.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

joemart

  • Posts: 96
  • Joined: Wed Apr 14, 2021 3:16 pm
  • Real Name: Joseph Martire

Re: How do you use an ambient occlusion map?

PostTue Dec 07, 2021 3:07 am

Bryan Ray wrote:I usually multiply the combined shader and the Ambient Occlusion with a Boolean node, like so:

Code: Select all
{
   Tools = ordered() {
      diffuse = BrightnessContrast {
         NameSet = true,
         ViewInfo = OperatorInfo { Pos = { 356.667, 43.7273 } },
      },
      CookTorrance1 = MtlCookTorrance {
         Inputs = {
            ["Diffuse.Color.Material"] = Input {
               SourceOp = "diffuse",
               Source = "Output",
            },
            MaterialID = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 498, 44.9394 } },
      },
      Reflect1 = MtlReflect {
         Inputs = {
            BackgroundMaterial = Input {
               SourceOp = "CookTorrance1",
               Source = "MaterialOutput",
            },
            ["Reflection.Color.Material"] = Input {
               SourceOp = "latlong_spheremap",
               Source = "Output",
            },
            MaterialID = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 656.667, 43.7273 } },
      },
      AmOcc = Background {
         NameSet = true,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 747.333, -10.2121 } },
      },
      ChannelBoolean1 = MtlChanBool {
         CtrlWZoom = false,
         Inputs = {
            OperationR = Input { Value = 6, },
            OperationG = Input { Value = 6, },
            OperationB = Input { Value = 6, },
            BackgroundMaterial = Input {
               SourceOp = "Reflect1",
               Source = "MaterialOutput",
            },
            ForegroundMaterial = Input {
               SourceOp = "AmOcc",
               Source = "Output",
            },
            MaterialID = Input { Value = 3, },
         },
         ViewInfo = OperatorInfo { Pos = { 766.667, 43.1212 } },
      },
      latlong_spheremap = Background {
         NameSet = true,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 454.667, 109.182 } },
      }
   }
}


Sources there are all just Backgrounds. You'd replace those with your Loaders with the appropriate bitmaps.

Alternately, I might use a ReplaceMaterial to apply the AO directly to the geo and break that off into a second render, then use the result as a mask source for a color corrector in 2d.


I usually multiply the combined shader and the Ambient Occlusion with a Boolean node, like so:

I think your way is better, I wasn't 100% sure of what I was doing.

Also, I thought you could only use an Ambient Occlusion after it rendered the result.


Alternately, I might use a ReplaceMaterial to apply the AO directly to the geo and break that off into a second render, then use the result as a mask source for a color corrector in 2d.


I thought that's how I already had it, I use an AmbientOcclusion that connects from the Renderer3D and this creates a bitmap that later connects to a brightness/contrast node and it let's me control the how dark/light the occlusion is. I don't use a ReplaceMaterial though, how would you include a ReplaceMaterial node and where?
Attachments
AO_.png
AO_.png (29.11 KiB) Viewed 1407 times
Offline
User avatar

Bryan Ray

  • Posts: 2485
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: How do you use an ambient occlusion map?

PostTue Dec 07, 2021 5:36 pm

The setup you're showing is if you need to generate the AO yourself. If you already have an AO map, it would look something like this:

Capture.JPG
Capture.JPG (45.05 KiB) Viewed 1357 times


ReplaceMaterial overrides the material assignment. If you plug the AO map directly into it, it serves as a simple Lambert with Diffuse assigned. That copy of the camera is there to create a white background. Plug a simple white Background into it, and in the Image tab, make sure Enable Image Plan is ticked, and set the depth to some arbitrary value that's further away than anything else in your scene. This technique is also useful for establishing a background for the purposes of Z depth and World Position render elements, which you might as well also export with your AO pass, if you plan to use them.

The Renderer should have Lights and Shadows turned off. The result will be similar to using the Ambient Occlusion node, but the anti-aliasing should be much better, and it will be faster.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

joemart

  • Posts: 96
  • Joined: Wed Apr 14, 2021 3:16 pm
  • Real Name: Joseph Martire

Re: How do you use an ambient occlusion map?

PostTue Dec 07, 2021 11:06 pm

Bryan Ray wrote:The setup you're showing is if you need to generate the AO yourself. If you already have an AO map, it would look something like this:

Capture.JPG


ReplaceMaterial overrides the material assignment. If you plug the AO map directly into it, it serves as a simple Lambert with Diffuse assigned. That copy of the camera is there to create a white background. Plug a simple white Background into it, and in the Image tab, make sure Enable Image Plan is ticked, and set the depth to some arbitrary value that's further away than anything else in your scene. This technique is also useful for establishing a background for the purposes of Z depth and World Position render elements, which you might as well also export with your AO pass, if you plan to use them.

The Renderer should have Lights and Shadows turned off. The result will be similar to using the Ambient Occlusion node, but the anti-aliasing should be much better, and it will be faster.


I'm not sure what I'm missing, I'm sure it's something regarding the values I've put in.

Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         Inputs = {
            GlobalOut = Input { Value = 299, },
            Width = Input { Value = 1280, },
            Height = Input { Value = 720, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
            TopLeftGreen = Input { Value = 1, },
            TopLeftBlue = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 715, -16.5 } },
      },
      Camera3D1 = Camera3D {
         Inputs = {
            AoV = Input { Value = 19.2642683071402, },
            ["Stereo.Mode"] = Input { Value = FuID { "Mono" }, },
            FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" }, },
            ApertureW = Input { Value = 0.831496062992126, },
            ApertureH = Input { Value = 0.467716535433071, },
            IDepth = Input { Value = 1253, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 4, },
            ImageInput = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            ["MtlStdInputs.Diffuse.Nest"] = Input { Value = 0, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 9, },
         },
         ViewInfo = OperatorInfo { Pos = { 880, -16.5 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput2 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "Camera3D2",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 880, 49.5 } },
      },
      Renderer3D1 = Renderer3D {
         CustomData = {
            ToolVersion = 2,
         },
         Inputs = {
            GlobalOut = Input { Value = 299, },
            Width = Input { Value = 1280, },
            Height = Input { Value = 720, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "Merge3D1",
               Source = "Output",
            },
            RendererType = Input { Value = FuID { "RendererOpenGL" }, },
            ["RendererOpenGL.AntiAliasing.Channels.RGBA.HighQuality.Enable"] = Input { Value = 1, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Supersampling.HighQuality.RateX"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Supersampling.HighQuality.RateY"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Multisampling.LowQuality.SampleCount"] = Input { Value = 2, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Multisampling.HighQuality.SampleCount"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Supersampling.HighQuality.RateX"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Supersampling.HighQuality.RateY"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Multisampling.LowQuality.SampleCount"] = Input { Value = 2, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Multisampling.HighQuality.SampleCount"] = Input { Value = 3, },
            ["RendererOpenGL.AccumQuality"] = Input { Value = 32, },
         },
         ViewInfo = OperatorInfo { Pos = { 1045, 49.5 } },
         SubInputsData = {
            RendererOpenGL = {
               Version = 1
            }
         }
      },
      Merge3D2 = Merge3D {
         Inputs = {
            SceneInput2 = Input {
               SourceOp = "Camera3D2",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 770, 214.5 } },
      },
      Renderer3D2 = Renderer3D {
         CustomData = {
            ToolVersion = 2,
         },
         Inputs = {
            GlobalOut = Input { Value = 299, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "Merge3D2",
               Source = "Output",
            },
            RendererType = Input { Value = FuID { "RendererOpenGL" }, },
            ["RendererOpenGL.AntiAliasing.Channels.RGBA.HighQuality.Enable"] = Input { Value = 1, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Supersampling.HighQuality.RateX"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Supersampling.HighQuality.RateY"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Multisampling.LowQuality.SampleCount"] = Input { Value = 2, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Multisampling.HighQuality.SampleCount"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Supersampling.HighQuality.RateX"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Supersampling.HighQuality.RateY"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Multisampling.LowQuality.SampleCount"] = Input { Value = 2, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Multisampling.HighQuality.SampleCount"] = Input { Value = 3, },
            ["RendererOpenGL.AccumQuality"] = Input { Value = 32, },
         },
         ViewInfo = OperatorInfo { Pos = { 935, 214.5 } },
         SubInputsData = {
            RendererOpenGL = {
               Version = 1
            }
         }
      },
      BrightnessContrast1 = BrightnessContrast {
         Inputs = {
            Lift = Input { Value = -0.8, },
            Gamma = Input { Value = 0.5, },
            Contrast = Input { Value = -0.33, },
            Low = Input { Value = 0.3, },
            Input = Input {
               SourceOp = "Renderer3D2",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1100, 214.5 } },
      },
      Bitmap1 = BitmapMask {
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            MaskWidth = Input { Value = 1280, },
            MaskHeight = Input { Value = 720, },
            PixelAspect = Input { Value = { 1, 1 }, },
            UseFrameFormatSettings = Input { Value = 1, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Image = Input {
               SourceOp = "Renderer3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1210, 49.5 } },
      },
      Camera3D2 = Camera3D {
         Inputs = {
            ["Transform3DOp.Translate.Z"] = Input { Value = 1.81949182056831, },
            AoV = Input { Value = 19.2642683071402, },
            ["Stereo.Mode"] = Input { Value = FuID { "Mono" }, },
            FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" }, },
            ApertureW = Input { Value = 0.831496062992126, },
            ApertureH = Input { Value = 0.467716535433071, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 3, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 8, },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 280.5 } },
      }
   }
}

Return to Fusion

Who is online

Users browsing this forum: No registered users and 35 guests