[DIGITAL BLIPS]
SPEAKER: Hey, everyone, and welcome back to another Unreal
Tips and Tricks series, where today we'll be showing you
how to composite your CG elements into backplate
with a matching HDRI.
OK, so let's get started.
I have a very simple scene setup here,
just a simple directional light, a skylight with an HDRI
override, and my three CG elements.
Now, the first thing that we want to do here
is enable a few settings in our project settings.
So let's go first to our Plug-ins tab in our settings
here.
And let's search for Composure.
And you want to make sure this is enabled.
It will prompt you with a restart,
but let's enable one last setting
which enables alpha channel support in our post-processing.
So let's go to our project settings.
And let's type in alpha.
And you want to make sure that the Enable Alpha Channel
Support in Post-processing is set to Linear Space Color Only.
Now, once those are activated, restart your engine,
and let the shaders compile.
All right, my shaders are done compiling.
Let's go to our Composure panel.
Now, in case you don't see it appear, simply go
to your Window tab, and select Composure Compositing.
This is going to enable me a new tab
here, which I'll be able to create a composition.
So let's do that right now.
Let's right click in the panel, create new comp.
And we're going to create an empty comp shot here.
Now, the first step is to add a new layer
in that comp for my backplate.
So what I'm going to do here is right click, add layer element,
and we're going to be choosing a media plate.
So let's click on that.
And as soon as we click on that, we
can see in the Details panel a few elements here to change.
And the first thing we want to change here
is the actual media texture compositing input.
So we're going to change our media source to a texture
input.
And all I have to do here is simply drag my backplate image
into that texture input.
Now, the second step is to overlay our CG elements
on top of the backplate.
So let's add a new layer element.
And this is going to be a CG layer.
Now, let's name this FG for foreground.
And an easy way of including or excluding
elements in your scene is by placing them into layers.
And this will help us later down the road
in our final compositing process.
Now, you can access the layers by going into Windows
and enabling Layers.
Now, let's select our three foreground elements
and once those are selected, let's right click.
And let's add selected actors to new layer.
And I'm going to be naming this FG also.
And by clicking on the eye icon, I can
toggle and untoggle to make sure my layers are working.
OK, so third step now is to create our shadow information.
So let's drag in a simple plane.
And let's place this just under the CG elements here.
And let's scale it just so it covers enough shadow
information.
And what we want to do here is actually place some walls here
on the side.
So I'm going to be pressing on my keyboard E for rotate.
And hold out, and click.
And this is going to duplicate one very easy for me.
And I'm just going to be placing that just right
at the back here.
And that's going to be our alpha channel.
And I'm going to be doing the same here on the side.
So again, E, Alt, and click.
And there we go.
So once we placed that on the side
here, what we want to first do and not forget
is deactivate cast shadows.
These are only here for the alpha information.
So select these two.
And let's make sure to disable cast shadows.
Now, what we want to do here is place our selected actors
into a new layer.
So select all three of them.
Go into the Layers tab.
Right click, Add Selected Actors to New Layer.
This is going to be our floor.
And with the same selection, let's create a new layer,
Add Selected Actors to New Layer.
And let's call this shadow.
And what we're going to be doing into the composure
is actually divide that information from the floor,
and only keep the shadow information.
OK, so now we have all of our layers set.
Let's actually set the Composure panel here.
So let's go into the comp, add layer, CG layer.
And I'm going to be naming this Floor.
And let's duplicate this.
And let's name this Shadow.
Now, if we click our Composure, there is nothing there.
And we haven't set any actors into the CG elements here.
So what we want to do here is click on the foreground.
And let's scroll down to the details here.
And in Composure what we want to do
is actually capture the right actor.
So for foreground, let's click on the plus (+) sign here.
And this is going to give me a dropdown.
And what we want to do is include our layer.
So we want to include that foreground
that we created earlier on.
So if I go here and click Foreground,
this is going to capture my foreground elements.
Now, let's do the same for the floor and the shadow.
So if I go to floor, and let's capture the element here.
And we simply want to include our floor layer.
And now let's go to shadow.
And for this one, we want to capture two actors.
So for the first capture actor, we're
going to include our floor layer.
And for the second one, let's include our foreground
elements.
Now, if we go to our main comp layer,
it is still displaying as empty.
And that's because we needed to read
our transform pass material, and tell it
what needs to be in front of the camera or behind,
or only keep certain information,
such as the shadow.
So let's create a new material.
Going to be going in my folder here,
and in the Materials folder.
And right click Material.
And I'm going to be naming this M_Composite.
And let's open this guy.
Now, the first thing that we want to do here for the shader
is actually set this to a post-process material domain.
So if we go into the left here in the material domain,
we can set that as a post-process material.
Now, let's start with the first node.
Let's right click here.
I can see that there is a Composure tab here.
And we're going to be using the Cver.
So now I'm going to be creating a texture parameter to these.
So right click and search for texture parameter.
And there we go.
And now we need to name this the same as our layers.
So I'm going to be starting with foreground
and name it FG, just like I did in my layers.
And I'm going to be hooking that RGBA node to the A.
Now I'm going to be using that same parameter for my other layers.
So I can actually duplicate this with Control-W on the keyboard,
and drag that here.
And I'm going to be naming this media_plate1, just as it's
written in my Composure layer.
And this is the backplate, OK?
Now, we got two other more, which is the floor and shadow.
So I'm going to be starting with the shadow.
And let's name this just as in the Composure layer.
And let's do the same now and duplicate this,
and name this Floor.
What will happen here is we're going to divide
the shadow from the floor.
So I'm going to be creating a node here from the RGBA,
and search for divide.
And I'm going to be hooking that RGBA to this one.
And that basically creates the shadow catcher.
Now, all we have to do here is multiply this
by the media plate.
And this is going to be hooked in the B layer.
Now, let's hook that node to the emissive color,
hit apply, and save the material.
Now, with my main comm still selected,
let's find the transform pass in the Details panel.
And let's create a new transform pass material
by clicking the plus (+) sign.
And let's expand this.
And all we have to do here is drag our new material
into that material slot.
And we should get the expected result.
So we have our foreground elements
on top of my backplate with the shadow catch material.
We can also specify a custom camera.
So I have a CineCamera actor in my scene already.
And I'm going to be targeting that camera.
Now, if I go to my Perspective tab and select the CineCamera,
and I can control the camera, and see the preview
in that little window.
So if I hide the actors and start panning around,
we're seeing that Composure result in that little window
all in real time.
I hope you enjoyed this Tips and Tricks,
and see you in the next episode.