Join Craig Barr for an in-depth discussion in this video Lighting with light actors: Headlights, part of Unreal Essential Training (2016).
- Working with lights in Unreal Engine 4, of course, brings our materials and our game assets to life but it can also provide dynamic effects within a scene, so we want to take a look at a simple little setup here of taking advantage of two of the basic lights and how we can use that in the scene in context with one of our models here. In this case, we're going to hook up the headlights to this car. So, I'm just going to select the car and hit my F hotkey to frame it in or focus it in, and then what I want to do is define how the lighting is going to affect this car here.
Now, we're going to put some simple little lights inside the actual, or near the headlights here, to provide a bit of a beam effect for this vehicle. So, let's start by grabbing a simple Point Light, and I'm going to drag this into the space here, and I'm just going to put it near the car for now because I am going to actually bring this in. I'm just going to hit F on the lights, so I'm working in context with that light. And I want to stick this here, very near the actual headlight.
And the reason is I want to actually light the headlight here in the environment, so that we're getting that kind of nice lighting effect in there. And what we'll do is let's dial in some of the settings for this simple Point Light here. So we might want to, first of all, name this Point Light by double-clicking on it here, to right, RT, HL for headlight Point Light. And now we're going to bring in some of the settings here. So, let's take a look at some of our settings here for a simple Point Light.
Overall, the brightness is probably going to be a little bit too bright, especially seeing as we're going to layer that. So let's just dial that down a bit, something like that is probably fine. And maybe we might want to give this a little bit of color on this as well. So, let's hit for our color and maybe bring it out of the middle there too. Something towards, maybe the blue. Just a little bit, that's fine. And then what we might want to do is address the, take a look at our attenuation radius to see if that needs to be overall effected.
I think we're actually okay with that setting because I do want it to have a bit of a falloff here, around the surrounding area. And I'm just going to make sure that's in the middle of that light. So, while we're zoomed in there, we'll just bring this in closer. We're starting to get that reflection off the bumper, which is nice and that works out fine. Now what I'm going to do with this light here, I'm simply going to right-click on the light in the World Outliner and go to Duplicate. You can see that control W is the hotkey for that as well.
Now, you can see that I'm quickly dragging the silver to the other headlight. By doing this, I'm preserving the settings that I've already set up for that light. If we zoom around and tumble around, we'll see that we have a nice overall effect on that. Now let's create some simple spotlights. So, same idea, I want to drag that in close to my headlight on the vehicle. We'll just kind of place this in a NIR. That light, that's fine. Now, you can see it's pointing down, so that's not going to help us.
We're going to want to rotate this around. So, I'll hit the E hotkey, and maybe just start to rotate this light up. We can see that it's off focus, so we'll just come above and we'll just kind of dial that in to be, maybe pointing down a little bit, really. And then, we'll bring this back towards the light. Now, we're going to need to adjust things, like the intensity and probably play with a bit of the cone shape on here. So, let's take a look at what we can work with here on the spotlight. So, the overall intensity, I'm not seeing a lot of effect there.
There we go, we're starting to see it now. So, we might not want to bring it up that bright, but maybe something like this, so that we can at least see it in the environment. Then let's work with the overall cone. So, I'm going to start with the outer cone here. Maybe we do make that a little bit larger, and then, our inner cone. This might be a nice idea to keep it down around this area here, so that we can actually define that or see that, especially when we add some of our post-processing effects, like fog, so that we can come back and adjust that as needed.
Now, with the color again, let's match it to that Point Light, so that everything kind of works together. I'm not going to apply the exact same values, but maybe something along the lines of just a little bit of an off blue. And there we go, and let's zoom out and see what we have for this here. We might want to change our attenuation radius to be just a little bit longer on that, and that's fine. I'm actually going to adjust the pointing of that, so that it's kind of coming out a little more straighter. There we go, and I think that will work.
Actually, if we just deselect that, hitting the escape hotkey, we can see that'll work. And I think once we put in some fog in here, we can see how that translates through the fog and we can always come back and adjust that as necessary. So, a couple things, we duplicated the Point Light over, and I'm going to do the same with the spotlight here. So, let's grab our spotlight and let's first of all, name this. Name it the same naming convention. RTHL Spotlight. Now, we had duplicated this one, this Point Light, so while we're here, let's fix that name to be LT, for left.
It doesn't have to be a two, that's fine. Now we want to duplicate this, so I'm going to do this in my Outliner by Edit, Duplicate. We'll bring that in, I'm going to hit the F key, alt and tumble around. Let's see that we do need some adjustments to place that. There we go. So, we're kind of centering that on the light. And there, we now have two very simple headlights that are built with a combination of a Point Light to provide some lighting overall on the vehicle itself, and a spotlight to broadcast forward.
And again, I think that we'll be able to see this really nice effect once we start adding some of our post effects to the environment there as well. One of the last things I wanted to point out here in setting up lights, specifically within the environment, is also how the lights are going to interact with the materials. So, I want to introduce something very simple in here. We can find this actually overall in all of the All Classes, or simply by going to the Visual Effects area in here. And what I want to do is take this Box Reflection and what this Box Reflection Capture is going to do if I bring that into the environment, you'll see this little sphere and if I let go, it's going to bring in this big box.
Now, take a look at the car. You'll see that when I bring that over top, we're seeing reflections on the car. And what this is, is that we don't want reflections, maybe, on the entire environment, but we want to contain them just around this vehicle. So, we're getting nice reflections from the surrounding environment and surrounding lighting to affect only this vehicle. So, we need to shape the overall size of this box in here. So, we may want to do something like, first of all, probably scale this down to something a lot smaller, let's half this scale and maybe for this go down to something like this size here.
What we can do, we're going to need to rotate this as well. So, we'll hit my E in there, so we'll click in our scene and just hit E to rotate that in something like that. And then let's translate that and make sure it's over top of the car, there we go. Now, the box is a little bit tight in there. I'm going to bring this down. There, we're starting to see these nice reflections happening there. This middle value here, I'm wondering if we want to make that a little bit wider.
That's fine. And I think that's going to provide exactly what we want there. So, the difference with this here, if I translate this out, we see that we don't have any reflections going on, but now we can contain these reflections or dial in how we want them to work with the surrounding lighting and materials and other objects here, based on this box that we've brought into the scene. So, that's a Box Reflection Capture, and we've also seen how we can set up a quick headlight setup or headlight rig, using a simple Point Light and a simple spotlight to provide an overall lighting effect to our scene.
- Customizing the Unreal UI
- Creating a new project
- Creating landscapes
- Blocking out levels
- Assembling a scene
- Working with materials and lights
- Adding post-processing effects
- Defining bodies of water
- Adding atmospherics, foliage, and wind
- Working with the Blueprint editor
- Creating cinematics
- Monitoring performance
- Packaging a game for distribution