Join Craig Barr for an in-depth discussion in this video Building the lighthouse light, part of Unreal Essential Training.
- With the power of lighting in Unreal Engine 4, we've looked at how we can use basic lights to provide overall local effects within our scene, we've looked at how we can set up basic lighting to combine them together, for example, point lights and spot lights to provide some dynamic lighting on the headlights, and we've also looked at environmental lighting, or, how we can use an environment to provide global illumination to our entire project. But, now we want to look at something here with really dynamic lights in the sense that we're going to animate our lights, or, create a rig for the most important light in this scene, which is our lighthouse.
I'm going to select the lighthouse capital in the scene, and you can either do that by clicking on it in the ViewPort, or finding it here within the Outliner by searching "lighthouse_capital". So, once we have that selected, I'm going to hit 'F' to focus in on that lighthouse. And you can see that we have our nice lighthouse capital here. We need to create a lighting effect, that is, how this lighthouse is actually working in a rotational manner to provide the overall lighting effect that the lighthouse will provide in our scene.
Now, we're going to do this in a different manner. We've seen how we can drag and drop lights into the scene. We've also seen that at any time you can right mouse button click into the ViewPort and go to Place Actor, and you'll see that these three lights are available in here by just simply clicking on them from your right mouse button in the ViewPort. But, now we want to look at a different way of creating lights, and how we can interact with them in here. The way we're going to do that is, we're going to go back to our Basic setting, up here in the Modes panel, and we're actually going to create an Empty Actor.
So, if I left click and just drag that into my scene here, maybe we'll place it somewhere here around our lighthouse, you can see that that's actually not directly on there, but we can certainly place this close to somewhere around this lighthouse effect. I'm actually going to place this directly in the center. Let's frame in on that, I'm just going to loosely frame that in to the center of that lighthouse capital, that should be fine for what we need there.
I think that's going to provide a good center, maybe a tad bit higher. Now, we see we have this Empty Actor in here. I'm going to rename this here by just double-clicking on it and calling it "lighthouse_light". Now, you may be wondering how does this thing actually provide any light, well, it doesn't. But, an Empty Actor can be thought of as something as simple as a null or a locator that you may be familiar with in other 3D content creation packages. And, that's essentially what this is going to be. It's going to operate as something that's going to store all of our lighting effects or lighting components for this, and that's exactly what we're going to do, is work with components.
So, I have my lighthouse_light Empty Actor selected in here, and I'm going to add in a component. And what I want to actually do in here is add in a couple of different things. I want to add in some point lights, and I want to add in a spot light in this scene, as well. So, we can find those, you can see up here in the Common section here, but, just to show what else is going on in here, you'll see that there's all sorts of things in here; everything from audio, basic shapes, cameras, all the way down to different kinds of lights in here.
So, let's just first grab a simple point light, and you'll see it's going to stack it down into here, we'll leave that as "point_light", that's fine. And all we're doing with this point light is much like what we did with the car. When we did the car headlight setup, we wanted to have a point light that actually illuminated the local area, and that's exactly what we're going to do with this point light. We want it to illuminate the local area of the lighthouse capital here, so that we actually get that overall lighting effect on this.
Now, we're zoomed up close on this lighthouse, but, we're going to have to address scaling of this, so, we're going to really probably need to adjust things like, maybe the intensity of this. In fact, we want to make this quite bright, because this is going to be quite a bright light. I'm actually going to put this all the way up to 50,000. So, you can see we're getting a nice light effect on there as well. Now, the Attenuation Radius, it might be a little bit big for what we need, but we certainly want it a little bit bigger than that, so, maybe if we bring it in to something like 393 there, we'll round it down to 375 on that.
Now, our Source Radius, this is the radius of the overall size of the light itself, we can keep that around 15 in here, and now, Source Length, this is the length of the overall lighting effect that we're going to do. We're not going to see too much, I don't think, on this, until we add in some of our overall effects in here. We're seeing the light length there. We don't want to go right through that other side, so, let's put this down, maybe below 100, that might do exactly right there, and then maybe just make sure that we're placing this, I think, just on the outside of it is going to work just fine, and, if we deselect, or press Escape, that looks nice, we're going to see, well, of course we're not going to see the lighting sprite, but we are going to see that lighting effect, so, that should be fine for what we need to do there.
Let's go back in to our "lighthouse_light" Empty Actor here, and, now let's create a spot light into the place here, so, we want to add a component, go right down to your lights, and, let's add in a Simple Spot Light. We'll leave that as "SpotLight_1", and we'll see that we're actually facing the wrong direction on this, so, by looking at my feedback from my ViewPort, we'll bring it back to around -180, that's fine. Now, we'll translate this out, so it's outside of the light, probably even if it's just a little bit in is okay.
Now, we're really going to have to adjust the overall length and scope of this light here, and, of course, probably intensity is going to have to be cranked up for the scale of this environment. So, let's work with something here, the overall intensity that we have of this light, and we're going to leave that for right now, but, let's try to get something like the cone size here, we might want to define something like this, that's probably fine. That size of light right there, the interior cone, is probably fine, our internal cone, but, this Attenuation Radius, we're definitely going to want a longer light than that.
So, I'm definitely going to drive this out to something much larger. Let's actually zoom out by hitting 'S' and right mouse button. I want to get a kind of physical idea here by looking at it as to how long we think that needs to be. This is probably fine because we are going to fade that light off a little bit, and, we'll probably need to adjust the light intensity here one we add another component to this as well. So, now we've defined all these different things in here, let's take a look at anything else that we need in here, if we want to adjust anything like source, length, I don't think we need to adjust that.
We may want to work with our Light Falloff Exponent, but, we can actually leave that at eight, that's fine, just to clamp that down. Shadow Bias, I'm not going to adjust that on this just yet, not until we need to see any shadows on that lighthouse. Now, what we need to do here is, we built a simple setup in here that is actually just providing a light, but is not giving us any kind of light effect. Now, once we add things like fog, we'll really be able to see that lighthouse effect in here, and we'll be able to dial that in a little bit more in the ViewPort.
But, one of the things that we really are going to want to do here is add in something that's going to provide an overall little bit of an effect, and that is, we want essentially a Static Mesh to be added to this. So, if we bring in this Static Mesh, and then we can actually define what that Static Mesh is, so, if we click on the Static Mesh here, you'll see that we need to define what the Static Mesh is. You can actually bring this little dial-down menu here, and we can drag down through this until we come to what we want to find here, and I need to see what we have here; we have lighthouse, we have lightshaft, and that's exactly what we want.
The lightshaft is actually a little piece of geometry in here that provides something really interesting, so, if I grab this Static Mesh and, let's just bring this out here, and I'm going to zoom in, you can see the lightshaft there. It's a piece of geometry that's actually providing this kind of fake glow, now, it's facing the wrong way, so, I'm going to rotate this guy up to about -90, providing the ViewPort provides that feedback for me. There we go. And we're definitely going to need to scale this guy up, so, I'm going to grab the middle, I'm going to grab the middle of this guy and just kind of scale that up quite large, and, we can see if I maybe, I don't think we want to bring it up that big.
Let's move it out to this space. So, there's the size, or scope, of our lightshaft. We may want to make it a little bit bigger than that. I'm just going to use 'S' and right mouse button here to come out and take advantage of that dark background. I think that's going to provide a nice effect there, so, I'm just going to bring that right back to our lighthouse, in fact, that's probably a little bit too big for what we need, we'll bring it down closer to the size of the light. And, if we grab the lighthouse here, and just zoom back in, we'll definitely going to want to adjust this simple Static Mesh lightshaft, and bring it back in towards this.
I'm going to just scale that back a little bit. There we go. And, if we zoom out for that matter, we can see that we have this really cool light effect on here. I think it's still probably just a tad too big, I'll just bring that down a little bit, hit Escape. There we go. That looks pretty good. Now, right now it's a static effect. We have this light shaft and this Static Mesh piece of geometry, we have a point light effect on the outside, and we have a spot light effect effecting the overall inside of that light.
Now, what we can do, if we come back to our "lighthouse_light", is start to duplicate these guys. So, for example, the point light, I'm just going to go down to control + right click and hit Duplicate, or 'control + w', and actually bring that point light to the other side, so that we're getting the same overall effect. Just click my lighthouse to zoom in on that. Actually, click the lighthouse capital to zoom in on that, and then, go to our "lighthouse_light". We're grabbing this point light on this side, now, we want it on the outside, that's fine.
Let's grab our spot light, and hit 'control + w' to duplicate that. We're going to need to rotate this guy, right around to -180, that's about fine. Just drag it right to that edge, and, of course, we need to copy our Static Mesh, which is our lightshaft piece of geometry. So, we'll want to rotate that guy right around, too, as well, to -180, or 180 for that matter, that we can bring that right around, that's fine, and we'll just bring that in, and if I hit Escape, so that we're not selecting anything, we'll just make sure that we're lining up this lightshaft to be a little bit closer in.
So, where's my other Static Mesh? It needs to come in further there. There we go. And there we go. If I hit 'S' and we just right mouse button click out, we can see that we have this rather cool, simple little lighthouse effect here, and, a little bit later on we're going to get in to how we can drive the animation on that using something called Blueprint within Unreal. But, there we've set up a really cool little light setup in a different way. This is where we've actually created an Empty Actor, kind of like a null or a locator, and we've used components to drive or build the lighting under one little simple setup here.
Now, the cool thing about this simple setup in here is that we can do things like start to rotate this, whoops, I'm rotating that the wrong direction there. But, this is where we'll eventually drive how we want to rotate that overall effect of our lighthouse.
- 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