>> How you doing, guys? My name is Sean Spitzer.
I am one of the trainers here at Unreal Training Center
out here in LA.
I have about 20 years’ experience working in real-time.
I've worked with multiple engines,
and I have to say that this one is he best.
At least I think so. Let me show you why.
We are going to be talking about the Fundamentals of Ray tracing
in Unreal.
let's take a look at this up close.
I am going to run you through how to set it up,
how to get everything working in the way
that you need it to get it started,
and then I am going to show you some of the ins
and outs of how to control your lighting and your shadows
and how to work with some of the control
that you have with Specularity and so forth.
Pretty much what we are going for
when we made this ray tracing tool -
we really want to have it so that you can have little
to no hesitation working in it, so it is a smooth transition,
and you actually get the visual fidelity
that you would in regular ray tracing.
let's go ahead and look at how to set that up in Unreal.
First up, what you need to do is we can go to “Edit,"
“Project Settings."
In “Project Settings," you want to go in here
and you want to search for ray trace.
You can either scroll down and go to your rendering
under your “Engine” right here. Or you can just type it in.
This is awesome if you can type right.
My typing was all over the place there.
You can look up ray trace and make sure it is turned on.
Another step you need to do also - when you turn that on,
Unreal is going to prompt you and say,
hey man, you need to restart.
What you can do is wait on that, just to make sure
everything else is in the right spot.
Just keep in mind you will have to restart for it
to actually work.
Once we have done that, we also want to go to “Windows”
which is underneath “Platform." Go to “Windows” here
and under “Default HRI,"
you want to turn on “Direct X12."
You are going to make that turned on.
A few of the things that I like to do
- when I work with ray trace,
sometimes I will have some baked lights way in the background.
My primary hero Objects are going to be raytraced,
because I want it to look good.
There is no hesitation. I am focusing on those guys.
There are a few other things you can do
to really get yourself to have a really nice output.
It also helps a little bit with ray trace here too.
One of them is called G Buffer.
With our G Buffer, you want to set your “Engine Rendering”
to “High Precision Normal." This will complement both types.
Another one you want to do is for your reflections,
you want to set your reflections to 1024 right there.
Really helpful to be able to do that.
That is going to give you some better output.
Again, that is catered a little bit more towards the baked type.
let's go ahead and close this out for a second.
This right here, ladies and gentlemen,
is a ray traced environment.
This is pretty much what you get in game.
You would think I am in Game Engine right now,
but I am not. I am in the Editor,
so I am not actually hitting play,
is what I mean to say.
I am not in Play Mode. I am in Editing Mode.
We are getting a nice reflection here.
You will see that our reflection is not limited by the visibility
of where my Camera is positioned,
such as a screen space or even the circular reflection
which is based on a circular shape or the box one.
Each one of those have a limitation.
But this particular one - I am in here,
and you can see in real-time the reflection I am getting.
Really nice, really good output there.
Let me hit the “G” key.
These notes - I will keep them on screen
so you can actually see them a little bit more.
Again, we want to do all these things to set it up.
The next thing we want to do
is take a look again at our precision normals
when we talked about the reflections.
But we also want to look at our control for our lights.
That is super important to be able to control
the softness of your shadows.
let's go ahead and look at that real quick.
Again, these are on the screen there,
so if you want to take a picture
or you are video taping in any way.
One of the lights we are going to look at first
is our spotlight here.
All these lights, when you first have them in the scene,
the one thing you need to do is make sure that they are movable.
All of your lights need to be movable.
What that does is this is going to update in real-time.
Normally, when you work in Unreal,
if you are familiar with it,
when you work with Unreal and you move a light around,
Unreal, if it is a stationary or static will say, hey,
you need to rebuild your lights. We do not have to do this here.
This is on the fly. This is updating.
By default, when you open up Unreal,
you will see that actually will have options to be able
to make sure that your light is casting ray trace.
All of these will be on by default
except when it comes maybe to the Sky Light.
Just double check your lights when you work with it.
In the skylight, you just go in the same area,
and again, you make sure that it is casting ray trace shadows.
I will go back up here.
I closed it on accident. let's open that up again.
You will scroll down and you will see
“Cast Raytraced Shadows” right there.
This will give us the best accurate quality.
I just wanted to make sure I pointed that out.
They do need to be movable.
With that set into place, let's go ahead and play
with some of the shadows here for our spotlight.
In our spotlight, we are going to go in here
and we are going to mess with our source radius.
As we mess with this, you will notice get softer.
See that right there?
Really cool in real-time there. Really nice.
One of the lights that Unreal really likes is the Rect Light.
It looks like an area light, acts like an area light,
but this is called the Rect Light here.
This is a really nice type of light
that we have made that caters to ray trace.
It gives us physical control, this light,
and as we move it around, as we scale it up,
it actually acts like an expanding light.
It is pretty nice.
As you close it down and make it smaller,
you will see your shadows get sharper.
You can soften it and close it here.
It is trying to simulate cinematic lighting
as we play with this. You can see the barn doors.
We can make those wider. Really nice.
Then we also have height, make it higher.
This is a really great light to use.
Again, as I move it around,
you see it is going to update in real-time.
To mess with this guy, a good thing to keep in mind
is your barn doors
are really going to help you with the drop off
and the softness of some of the aspects of our Rect Light.
Hopefully I do not lose my voice here.
Let me get a shot of water.
There we go. Much better.
The Point Light also has that same feature.
If we have a Point Light in here -
again, we can just drag one in if we need to,
or we can just grab one that is existing,
floating around in our scene. He is way in the bottom here.
We can move this guy over. He has the same type of control.
When you play with him, again, you will be messing -
he is not super strong, but you can again,
mess with your source radius to soften up those shadows.
Let me just put them back really quick.
I just want to point that out. He has the same type of control
that you would get over here with your spotlight.
Again, the favorite light is this Rect Light
who he is phenomenal, does great work. Look at that.
Just bump it up, move it down,
updating it in real-time, hit the “G” key.
This is exactly what you are going to get in game.
See a reflection there.
let's play with the light a little bit,
some of the cool things that we can do with the lights.
A cool feature that we can play with
is right here under our Source Texture.
I can load a Texture that I have already created
and drop it right into that “Source Texture” slot.
The cool thing about this,
we can simulate what it looks like in real life.
As it projects, you are going to get that whole office light
kind of feel going on.
Go ahead and move it back a little bit.
It is a little too close.
Then we can play with some of his properties
here such as his barn door, and we can mess with the scale.
Messed with my attenuation on accident.
There we go.
You can get kind of the light that you are looking for.
Pretty nice. All this is real-time.
We are going and tweaking this guy out
and we are getting instant results.
Some of the other things you could do -
let's go back to my slides.
let's look at the Post Process Volume,
because this guy is really great.
We have actually added some more features to that
Post Process to cater to our ray trace,
and I will show you some of the things
that you can do to actually play with your sampling.
I have got a little bit of a breakdown here
in how to work with that.
let's go to my Post Process Volume.
Got to be able to type "post process," that's important.
We are going to open this up here.
We have ray trace options.
I have my Ambient Occlusion Ray Trace.
let's open this, you guys can see it a little bit better.
It's set to 2.
We have our Ray Trace Global Illumination.
Mine is set to 1. It is doing a really good job.
You are more than welcome to play with some of these,
but remember there is a limit on some of your balances here.
Just like regular Global Illumination,
once light leaves a point of interest and bounces around,
it loses energy so it does not get quite as strong.
You get kind of the same kind of principles there.
Just keep that in mind.
We also have again, ray trace reflections.
Let me get another drink of water here, sorry.
In the ray trace reflections here,
we also have a Max Bounce.
I have just default 1 and 1, and then my roughness is 0.6.
These are actually working pretty well.
Again, you will see a little bit of pixilation,
because this is updating on the fly.
This is kind of the nature of working with ray trace.
But as we get more and more generations,
it is getting smoother and better and even sexier.
This is one is 4.22.3,
so we have 4.23 that just came out,
and we have previews constantly connecting with that.
This guy is getting just awesome.
I am loving every part of this guy right now.
Now let's go on.
You can see some of the bounces,
some of the stuff you can play with, things to keep in mind.
But there are also some really cool features
when working with ray trace
that we can use in the console command
to get ourselves a little bit better visuals.
let's get a little bit closer to Crunch here.
Look at his chest plate here up close.
Let me move back a little bit. Again, this is all raytraced.
Look how nice that looks. Very beautiful. Very nice.
If we want to make this look a little bit crisper,
we can go to the console command we can do Tonemapper.
In that Tonemapper, I am going to pull this up
and I am going to type in “Sharpen."
We are going to sharpen once.
You will see it get a little bit crisper there with that.
You can even go higher, but you have got to be careful.
The higher you go with that, it can get really pixelated.
let's go ahead and turn that off.
Go back to the Tonemapper, we will do “Sharpen 0”
and we will hit enter. Let me go ahead and zoom out.
Again, you can get higher with that number.
A lot of these,
when you are working with the console command,
you will notice when I hit the console command
and I go in here and I start typing these up -
say we just type in “ray trace,"
there is a lot. There is a lot we can do.
There is a lot of cool stuff,
but who wants to type that all the time, right?
Not so great, not so wonderful. To be able to handle that,
what we have is you can use the Blueprint Editor.
You can say “Event Begin on Play”
and you can use the “Execute Console Command” in there.
You can specify what you want it to do.
The numbers that you saw me punching in, 1 or 0,
or maybe in this case we have ray trace reflections
with a max ray distance. We can punch in 500.
That right there will actually control automatically
where we are, distance to things.
You can play with these and you can actually get
some really good automated stuff
so you do not have to constantly go in the console
and start typing them in all the time.
This is pretty helpful tool to be able to do so.
Let me go alt + tab back to this guy.
Some things to also keep in mind -
again, when I use ray trace -
I will emphasize what I said before.
A lot of times my hero
Objects, I will keep them ray traced,
the things that are Objects of interest.
Some stuff in the background - because Unreal does
an amazing job with baking your lights.
I will have that stuff baked in the distance,
stuff that is not so important.
But it still does a wonderful job.
It is just a nice little marriage
of working with these two together.
As I am baking them,
I am going to make sure that all of my lights -
I always do this by default before I make them movable.
Again, you have got to make sure your lights are movable.
A lot of times I will go in here by default.
Because if I am doing that combo,
I will go in and make sure
that my lights are casting area light shadows.
If we scroll down just a little bit under “Lightmass,"
you will see “Use Shadows for Stationary Lights."
You will turn this on just in case you decide
to switch them too, back
and forth between stationary and ray trace.
I just think it is a good idea to do that just in case.
You will get confused,
why is Unreal telling me to rebake my lights?
It is because you turned it from movable to something else.
This little prompt will help you keep on point
for having good lights all the way across the board.
It does not really affect our ray trace,
because you will see it is grayed out right now.
But it is just a good practice to have in mind.
You will notice we have some decals
working in here really nice.
Even my emissives are working great.
If I hit the “G” key, you will see some really nice
glow off of these guys on these boxes.
Really cool. Hit the “F” key to get a little bit closer.
Look at that. Really nice global illumination.
I have got a little bit of emissive coming off there.
It is giving me some little Material lighting going on.
Pretty cool.
Let's see here, let me go back to my notes.
All these Assets are brought to you by Jonathan Fredrick.
It is permanently free on the asset store.
If you guys have any other questions,
feel free to email me.
I will be floating around the pods today.
I will be sitting there for a while,
and then every once in a while you will see me get up
and maybe talk to some more people.
I am available for your questions.
I am putting myself out there to help you out.
I have been teaching for many years
and working in the industry.
You name it, I have probably tackled
that particular situation or problem.
We also have an online learning portal that you can check out.
You can start tracking your own learning path
and you can earn badges. It is all ready to go there.
Also, like I mentioned earlier if you guys heard me,
we have an LA Training Center out here.
If you are interested, feel free to email me
and I will make sure you get all the information you need.
There is a little doodad, I like to call it, on the screen.
It is a futuristic type thingy.
You guys can take a picture of that, put it on your phone.
I am the same person on my YouTube channel too.
Exact same, dumb jokes and everything.
It is pretty cool.
Cool man! Awesome! Thank you for coming.
I hope that gave you a good view of how this all works.