PBR Workflows | SIGGRAPH 2019 | Unreal Engine

PBR Workflows | SIGGRAPH 2019 | Unreal Engine

>>Sean Spitzer: Alright. How
are you guys doing today, good?
So we are on the very end
of SIGGRAPH here.
And I am going to talk to you
guys a bit about Materials.
It is a bit of an introduction,
so if you are not
familiar with it,
this should be
very helpful to you,
and the best pipeline practices
that you could do for Materials.
Let me open up
my PowerPoint here;
sorry we are falling
a bit behind.
I know, what?
So let us talk about
the workflow for PBR Materials.
And one question is going to be,
like, what is PBR?
It is Physically Based Rendering
that we have worked with
and developed with, with Unreal.
And you will see many
other software packages
going that route and working
those particular pipelines,
is what it is, it is
a combination of a Material —
you are going to be using your
Texture, the Material nodes.
You are going to be using
lighting —
it is all those things
combined together
to make your eye believe
that this Object is like it
is in the real world.
That is pretty much
what it is —
Physically Based Rendering.
So some of the rules
that it has to go by —
but oh, before I do that,
I should introduce myself.
I am trying to make sure
I get enough time,
because we are falling
a little behind there.
So my name is Sean Spitzer.
I have been teaching and working
in the industry for,
like, 20 years —
the teaching part
is a little shorter than that.
Also, I have worked
with several engine companies,
and this one is my favorite,
as you can tell.
I teach out
in the LA office,
out here the teaching education
portal that we have.
And we will talk
about that later on,
opportunities if you guys
live in the area,
you guys can take
some of our courses
and get some training in Unreal.
So Material principles —
let us talk about that.
Real-world applications
and breakdown.
So if you look at metallic,
in general,
the grayscale value on or off —
you have got a 0 or 1,
and 1 being highly Specular,
so you can actually
crank that up,
get super T2 metal,
you know, and so forth.
And roughness —
if you look at grayscale values,
they range from 0 to 1,
and should be Texture-driven.
Now you can literally
put a number
in that
in Unreal’s Material Editor,
or you can use a Texture,
which is more ideal.
And I will show you
how to do that,
where you can plug that in,
and visually you get
a better representation.
And a lot of these softwares
are 3D ones,
such as Substance and 3D Code —
you can paint
those variables in there,
you can paint that roughness
in there to get what you want.
And they also use
Smart Materials
to push that even more forward.
And Smart Materials mean
that you can dunk it,
you can paint it —
you will actually get something
that is like the real-world
that is already
pre-defined for you.
So in Unreal, what we are going
to do is,
we are going to build
a node system for that.
And I am going to show you
how using the Material Editor,
how we can build those nodes
and just pull those executions
across and apply that,
and then from there
we are going to start talking
about Master Materials
and Instanced Materials,
which is super important
when it comes to Unreal.
And what that concept means.
So the things that we are
going to be focusing on —
let me get a drink of water
so that I do not lose my voice
at the end of SIGGRAPH —
our core nodes we are going
to looking at is Diffuse —
we have abbreviations there,
albedo, a.k.a.;
Roughness and Normal.
And you will notice
in my little slide here,
we have Specular set to 0.5 —
that is a good default.
Now Specular —
everything in the real world
is going to have some sort
of light bouncing off of it.
But we want to, again,
push our shiniest,
our Material identification
of how that
is being reacted to light.
We want to do that
through our Roughness,
and you want to do that
a lot of times through Texture.
I just have a node in here
just to show you
that not only can I bring it
through a color or Texture,
I can actually plug
in a thing called a “constant,”
which we are going to look at
to push that strength
of that Object.
So let us go
and set it up real quick,
and I am going to show you
a little navigation
in the Material Editor.
Grab this guy, and let us
open up my Material node.
So you can see
an initial breakdown here,
I had to do this,
and I am going to show you
how to set these up
and how these work.
So let us go
to grab our Textures,
and make a new Material.
So to make a Material in Unreal,
I can right-click,
and a thing called
a Content Browser down here,
this gives me a list off
to the left,
which kind of looks like
a little outliner.
Then over here,
I can actually right-click
in the Content Browser.
I am in my Mud Sand folder,
and I can go in here and create
a new Material, right here.
We will call this
“Last Day Sand_M,”
for the Master Materials, this
is my Last Day Sand.
I have multiple collections
of sands — I love sand.
We are near Southern —
or actually, near the beach.
We are in Southern California.
So sand topic it is. Alright.
So we have got sand here
all set up.
Let us go and double-click
on them.
Now you will see in the Details
panel off to the right,
I have made this any
Material that I select
is going to show up
with the details in the scene.
So if I select this chair,
we are going to get
the Material info,
and all the other stuff.
But we have a new Material
that we are
going to double-click on,
and this is going to bring up
our Material Editor here,
and a little Material graph.
Let me get some water so I do
not lose all my vocal cords —
there we go.
So we are now going to
drag in our Texture.
There is a couple of ways
you can bring it
into your Editor here —
and I am working
with one monitor,
so I will try to keep this
a little bit squished,
you can see what I am doing,
and I will open it
in just a second.
One way we can do it is,
I can grab my albedo
and keep my finger
on the T-key —
this is the hotkey for that —
in the Editor.
And I can left-click,
and it will bring
in that Texture.
Another way you can do it —
and we will bring in our Normal
and our Roughness —
I will grab these, control-click
and just drag them
into the Editor itself.
There we go.
So we also have an
AO, so just for fun,
I will bring him in there.
I think I had left him behind.
Let us go ahead
and go to a full screen.
So I am going to show you
a little bit of a workflow here
to keep things organized,
because it is easy
to get confused
if your Material gets really
heavy and really huge.
One thing we are going to do
is drag our execution strings,
or RGB, which is the collection
of all these other nodes —
we are going to drag them
over into our base color.
Now I do not know
if you caught that for a minute;
when I pulled this over,
you will notice if I let go,
I get a topic list,
then I can choose from different
nodes that do different things.
Oh my gosh, look at it —
they are all here, holy cow.
Do not let this intimidate you,
but this is great,
because at Unreal,
what we want to do
is make you drunk with power.
We want you to be able to build
whatever you want,
whatever you need.
And we have a list of nodes
here to be able to pull from.
Quick water break. I feel like
I am running a marathon,
somebody hands me a water —
ah, keep going!
All right, so we have got
the Base
Texture set in. Let us go
and pull this guy over.
Let us get a roughness in place.
I am going to pull the execution
string for that,
pull in roughness.
Now, specular —
I do not want it
to look like the T-1000,
so I am going to go in here
and use a node called
a “constant.”
And this works like a little
variable we can punch in,
and you can control
how strong things
are going to be, and not be.
So I am going to go ahead
and keep my finger on the 1 key
and left-click —
there is a constant there.
It is at 0,
punch in the specular —
and you can see automatically
it flattens our sand.
But our sand
is kind of wet, right?
So we can do a half variable,
and let our roughness
push everything
to where it needs to be.
So I am going to do a 0.5,
and then from there,
we are going to do
a little AO —
so I am going to pull this over
for a second, grab the AO.
And I am going to grab that
execution string, this little —
I call it “execution string,”
it is a habit from Blueprint.
We can just keep that route.
So we just pull that guy right
into the ambient occlusion.
And then we have a normal map,
which is going to give us
a little bit more detail,
an optical illusion based on
our normal and RGB information.
Pull that in there, and then
we have got a little wet sand,
a little silicon-based shininess
going on there.
And we are going to hit Apply.
Now, you have got to hit
when you work with this.
Now, the cool thing about
these Materials,
and I will briefly want
to talk about this,
and I want to talk about
These Materials here — here is
the main driving Material
that we are plugging
all these other nodes into.
And in there, you can define
what kind of Material
you are working with.
If it is a clear coat, if it is
a subsurface type of Object,
like skin or plants,
you can play with that there.
It is really nice
to be able to do that.
And you also,
if it is a thin polygon
Object, such as like a plane,
it depends on the angle
you are looking at it,
but you really do want to turn
on two-sided,
just in case someone walks
around your thin Object.
So it there are a lot of
cool things you can do.
There is translucency
that can be complementary
with your subsurface,
depending on what your Material
and Object is,
and you also have usage control,
as well as you go down,
if you want to get
really super fancy,
which if we have time,
we might —
you can actually go
into your displacement map,
and you can actually
make it look like sand
is pushed off the surface,
as in raised
on that actual surface.
So we have got this all set up.
I will just hit Apply again,
because it thinks
I am doing something,
and I am not yet.
But let us talk a bit
about organization real quick.
There is a couple of ways
to organize things,
and I like to do this in Unreal
as much as possible,
especially when my Materials
are getting super complicated.
There is one way
you could actually go in here
and leave notes for yourself,
or even tag an Object
for what you want it to be,
or what you want it
to be represented,
or even work that needs
to be done on it.
I can call this guy
the “Diffuse.”
If someone is confused,
then maybe we can
call this a “Prime Diffuse.”
So maybe you have multiple
different nodes
all over the place,
and you are, like, hey,
oh, this is the one
I started out with.
I am going to keep note of that.
And you can pin it,
so when you scale away,
it stays big,
or you can just unpin it
and it is still
in that variable there.
Now, if you want to keep it
a bit more organized even then,
we can go in here
and say hey, all right,
so this is my specular.
And we can say shininess, we can
set this category as shininess.
I can highlight them,
hit the C-key,
and I can create
a comment for it.
We will call this
“Shiny Stuff of Justice,”
right there, there we go.
So that keeps things
organized for you.
And when you are moving around,
that is going to
connect and hold
all those nodes for you,
which is really nice.
And if you are, like, oh crap,
I had a little too much
to drink that night,
or I was too tired
and I put that
in the wrong spot —
you can take it out,
and then there you go.
You can actually eliminate it
and take it out there.
There you go, pretty sweet.
So keeping things organized.
And then if you do not want it,
you can kill it,
and it does not affect
your other nodes
that are in that spot.
Pretty cool.
So now that we have this,
let us go
and apply it to an Object.
I already have one in the scene.
You can say, ding, out of
the oven, kind of thing —
but I am going to actually make
a new Object.
We are going to do an alt
and move here,
to just quickly duplicate
that item.
And we are going to hit Apply
on that Material we just made,
Last Day Sand.
And we are going to
apply it to this guy
by simply dragging
it on that Object.
Pretty nice. There we go,
got it on that Object.
And we will avoid the bloom,
so we will actually
raise our camera here
so we do not get so much bloom,
and a good representation.
I have turned my lights
to default at this time.
So one of the things
I want to talk about also
when it comes to lights,
there is a thing that we
call making Master
making a Master Material
and the Instances
that work with it.
This is
a super important concept
when it comes to Unreal.
If you have
ever messed with Unreal
and looked at it, maybe you have
opened up a cool scene
you got at the Marketplace,
something that was free,
you will see,
oh man, why is he compiling,
like, a bazillion shaders?
Sometimes you will get ones
that are pretty heavy,
and you cannot help it —
it is kind of in that nature.
But when you are working
with your stuff,
and ideally in a scene
that you have opened,
you want to be able
to try to limit
that compiling
as much as possible,
because it is heavy.
It makes a scene big.
It is the light
reacting to these Materials,
you have all these
complicated Materials —
you want to make
a Master Material.
And from that Master Material,
you want to make a thing called
Instance Materials.
So what happens is, Unreal looks
at the Master Material,
only compiles that Material,
calculates its information
on that Material one time.
Then all the other Instance
Materials from it is free —
they do not cost anything.
They do not have to be compiled.
And that is the workflow
you really want to have
when it comes to Materials.
So when you have a big scene,
you can have it so I have.
I have four, maybe ten, even,
Master Materials.
But you have a ton, a ton of
other Instance Materials
derived off of those Materials.
They could be your prime,
and then the other ones
could be like the children.
it is for faster compiling,
and it is referencing it,
and actually
really is efficient.
So let us go ahead
and make that.
There are a couple of ways
you can do it.
One, I can go in here,
I can right-click
and pull up parameter nodes,
like a Texture parameter nodes,
and so forth.
But if you have
inherited a file —
and you can also do what I did,
whether you are dragging
the Texture
or it is already connected,
you can right-click,
and you say Convert
to a Parameter.
And we will call this guy
real quick, “_Diffuse Param”
and if we wanted
to control its color,
we can actually add
a color in there.
I am going to leave it
as it is right now,
because I will show you
some of that later.
Say we got a normal, but we want
to be able to control
maybe the strength
of the normal.
One thing you could do is,
we can use a node
called a Multiply.
Then you can type it in
for a search,
or you can use a hotkey,
where you keep your finger
on the M and you right-click,
and there is your Multiply.
The hotkey for a
constant, which you saw me
make this bad boy earlier —
keep your finger on 1,
and then you can —
did I say right-click?
Left-click, sorry about that.
Right and left, get them
mixed up a little bit sometimes,
at the end of the day.
So now, I can go in here
and connect my normal map
into the B channel,
and then my Constant node
into the A channel,
and I can connect it
to my normal map.
Now, when you do this,
you will notice it gets flat —
do not panic,
because we are going to
open up the variables here
so that we can control
how strong that is going to be.
So let us convert
the other ones.
And every time you use
a constant — water —
every time you use a constant,
you have to actually
convert him, too.
We will not be converting
any of these guys here
that act like Photoshop filters,
but we will be doing it
to these little constant guys.
And we will call this guy
“Spec Param.”
We will convert this guy here,
which is our roughness.
We will call this “Rough” —
I will just do underscore-R
because I am running
out of time.
We will call this “_N”
for normal map.
Normally I will just put
normal map strength,
and convert this parameter.
And we will call this guy
“Norm_Map”, the actual guy.
And then we have the AO.
I do not have to worry
about the AO,
so I am not going to worry
about that guy right now,
because I do not have one
to swap out right now for that.
So we hit Apply.
So now that we have done this,
we do want to make sure
whenever you convert
any of your constants,
you want to actually
create a default.
And on this default,
I am going to do 1.
You are going to see
that Material go back to normal
on the spec side.
Actually, it is too —
let us give it 0.5,
we want to keep it —
let us keep it low.
That will be our default.
Then we can control maybe
the max will be 1,
if you want it
to be like the Terminator —
make it shiny —
we can do that later.
Now, over here, we want to be
able to control his default.
Now, you are going to see
this guy go back to normal.
Sorry I am kind of
rushing through,
so make sure I do not
hold you too long,
as everybody starts to leave
and get food and beer —
I do not want to hold you
from your beer.
So you go over here,
and we have got
the slider max —
we will do maybe 5 right there.
That is actually —
these constants
that I have created make it
so that when I make my Instance,
I can go back and punch
in these numbers
and change these variables
on the Instance.
So we are opening up
these variables,
so that we have full control,
so we can, in our Instance,
from this master,
do amazing things.
I am going to hit Apply.
Now that we have got those
all set in,
let us make an Instance Material
from that Master Material
by right-clicking,
and we are going to
Create Instance Material.
I will just say Enter.
I am going to
drag him over here.
There is really cool stuff
that we can do now,
so let us go ahead and zoom
in a little bit.
We can control this Material.
As you see, as I double-click
on the Material node
that is representing
what is on that surface,
you will notice the interface
looks totally different, right?
We no longer have a graph,
because we do not really need
to compile anything.
We can now change
whatever we want.
I can open up these
parameters that I created.
I can mess over here
with our scaler parameter here
for our values for the
normal and the spec —
so if I want a stronger normal,
I can increase that.
And my spec, if I want to,
I can go higher,
so it gets shinier —
see that right there?
You can actually make
almost a different Material.
I can go flat with a normal,
go higher with it.
I can even add some
more multiplies to it.
Let me set that back to default;
that is the nice thing
about Unreal.
If you do not like it, you can
set it back the way it was.
It is fantastic.
So now watch this.
We have a sand Material.
We made an Instance
of that sand Material.
He can be changed, you notice
the parents not being affected.
We are going to import
a brick Texture real quick,
and we are just
going to swap it out.
So I am going to grab
the diffuse
for this brick
that I already have imported,
I am going to click on
that arrow and use the brick.
I am going to grab the normal,
select that normal,
use the normal.
So we now swapped
out the normal.
Now it is got this shininess
going on, right?
So let us actually
swap out a roughness.
I will select the roughness node
we have, grab this here.
Let us use that roughness.
And if we want
to lower that spec
that I was messing with earlier,
we can do so.
We can make it so it is totally
flat, like actual brick.
Did not have to recompile,
completely free.
The same Material with a new
Texture placed on top of it.
And you can actually
make a bunch of these.
And you do not
have to recompile.
He is the new guy on the block,
just kind of like it is
blocks — but it is a bad joke.
Anyway, but you can see
that it is there,
and you actually made a new one.
And you did not have
to recompile that bad boy.
Start wrapping it up?
So now, let us talk about
some training here.
You can see it has got
the same concepts here,
if you want to take
a picture of this.
Talking about swapping it out,
all your Materials,
keeping things reasonable.
And again, all these guys
are from the Marketplace.
If you have any more questions,
feel free to email me,
[email protected]
And we have an online portal.
If you go
to our online training,
you can actually earn
a badge and level up
and be even more XP-ish,
if that is a word —
I just made it up, there you go.
Then you go down here, and you
can see our LA Team here.
So again, we have classes
out here in LA.
If you guys are interested
in taking these classes,
please send me an email and I
will get things rolling for you,
so that you can be
a part of that.
All right, and there is
the awesome futuristic code
for your futuristic phones,
to take pictures of,
and have that data ready to go.
That is about it.
I hope you guys had a great week
and, right on!

7 Replies to “PBR Workflows | SIGGRAPH 2019 | Unreal Engine”

  1. I think some very basic concepts are missing here. For example, disabling the "sRGB" option in the roughness or other maps so UE4 read it as linear instead. Also multiplying the normal map for a scalar (wtf) when you should be using a lerp node that blends between the normal map and a 3 vector (R0,G0,B1), or using the "flatten normal" material function that comes with UE4. I want to think there was no enough time to explain this, but then I found out people doing these huge mistakes every day.

Leave a Reply

Your email address will not be published. Required fields are marked *