Join Craig Barr for an in-depth discussion in this video Pre-lighting, part of Unreal: Architectural & Industrial Visualization.
- [Male Instructor] Setting up lighting in a visualization project in Unreal Engine 4 is very important. We've spent the time to build some textures. We've spent the time to put materials on our nice assets. Now we really want to bring it to life with the lighting and really get the overall effects of our materials that we've put together here. You may notice as you're building that you have Preview written all over your scene. That's simply because what it's telling you is that you're viewing preview lighting but you need to build that lighting so that you can see the overall effect.
You'll typically get this as you add new actors, or props, models, whatever they may be, to a scene. Change materials with different textures or whatever it may be. This is where you're typically going to be asked to bake the lighting. Now we're just going to begin to build the lighting here or how we can work with the lighting. So we'll cover right now how to work with the basic overall lighting setup which is going to be our sunlight, and how we can start to bake the overall preview of that lighting. So what I want you to do, if you have access to these exercise files in this scene, you'll see that I'm using Chapter 07_01.
I've organized everything into folders. Now yours might come in default with the props folder open. It tends to save like that for some reason. If you can go to the lighting folder here and just click that. Bring your view into something like I'm viewing here. It's pretty easy to just have this hardwood floor right in the center. We're going to work with this simple lights source, the default that we setup our file with. I'll click that. We can see that we have some settings in here. The most important thing that we want to start with is manipulating this into something that represents a nice sunlit environment.
I'm going to hit my e hotkey with that light source selected. I want to start to rotate it. I'm going to look right through the window in here and we're going to see that we have some lighting effects coming through that window. I'm actually rotating this down so that the aperture, or the pointing, of this light is actually pointing down in this direction. We're going to actually bring it up a little bit more. So we get these kind of long shadows coming into our environment. I'm going to even go further than that. Because I want this to build up towards the furniture there. Maybe something like that is fine. Right over the edge of that carpet.
Now we can see the overall effect of that light. This is a preview of that light. The real-time shadows that we're getting in our environment. That's starting to really give a nice effect I like the look of the pillars coming through from the windows. We can certainly change that direction of lighting as well. Something to consider, you can also animate this of course to provide an interesting lighting effect. Let's work with this for now. Now let's go in and actually work with the intensity or some of the details here. The default intensity on this is at 10.
This is where you can start to change that overall intensity. If you wanted a different time of day, for example, or if you wanted to really make this pop and bright. You can leave it at 10. I'm going to bring mine down more towards 8 or maybe 7.5 is fine. To be a little more mid-to-late morning type of sunlight that's coming through. Maybe we have a little bit of haze going on outside so it's not as bright within here. Now the one thing that we do also want to check here in the event we want to work with any kind of fog or atmospheric effects, is to check atmospheric sunlight so that we're using this as our sun essentially.
This is our overall sunlight. So we're going to leave it at this because now we have our basic, daytime environment here set. That's what this is. We're going for a daytime look. Nighttime, of course, you wouldn't use this lighting setup. You'd go for a different look. Maybe some moonlight or something. We're going to go with this sunlight effect. Now let's look at the basics of how we can build this lighting so we can get rid of these preview things. First thing I want you to do, just a couple little tips here when you're working in Unreal. We have the light selected. First just hit escape. That deselects everything within the view port.
Now you can see that we have all these icons in here. We have the player thing. We have spherical refraction, or actually that's the skylight icon. There's our first-person perspective that we can walk around the environment. Let's get rid of that, or get rid of the view. The way you can do that is you can either hit the g hotkey, or you can actually see this down in here with Game View. So if I click that, gets rid of those icons. G is the hotkey to bring those back or get rid of them. I use that quite a bit. I'll go back and forth between having my icons if need to see them or hiding them.
This includes, when I say icons, everything like lights or anything else in the scene as we work. That's important because we're going to be adding some lights here as we go forward. Now that we have our preview, our basic light in here and we have a preview setup, let's build the lighting for that. So we're going to of underneath this build tab, click the little arrow and take a look at lighting quality. The default's going to be set to preview. Leave that for now. We'll work towards production later. All we're concerned with right now lighting quality is set to preview, that's the default. They do that for obvious reasons.
Keep your scene light. Keep the performance high. Of course all of this is going to depend on your hardware configuration. Higher hardware configuration is, the higher you can push the lighting and overall rendering effects. Let's go to build lighting only. I'm just going to click that. You're going to get this little build status window that's going to come up. This shouldn't take too long. Depending on what you're doing in the scene, again, depending on our hardware configuration. Also depending on the number of lights you have in a scene. This is a good part to talk about the importance of scene performance here as the lighting is building as you can see in the bottom right-hand corner.
The more lights you have, the longer the build time. The higher the settings you have, the higher the build time of lighting. What do I mean by build? What's going on within this? There's our lighting build complete. What we can actually do now to test this out, we can go ahead and play this in our environment if we wanted to do that. Once our lighting is built it will actually apply this to the scene in the form of a lightmap. We're going to talk about that very quickly here. You may get an error window here. Something that's telling you about your UVs. We have a lightmap UV overlap here by 2.7% on the window frames.
I'm not going to worry about it. You shouldn't either. You might get a ton of these different things. They are important, especially if you get into large overlapping areas. You don't want to have that because you'll get very dark spots on your lightmaps. What's a lightmap? A lightmap is actually a second set of textures that is essentially composited within your scene to provide the look of lights that the faking of lights within a scene. This is huge for performance. Baking your lights into your scene is the big trick of any kind of game engine to really provide a nice look and better performance for your overall visualization project here as well.
So we've baked in a simple light into our scene. We've looked at how we can do that with a preview of building that lighting. We've also understood that the more lights we have the bigger the build time is going to be. We'll leave that like that. I'm going to go ahead and move on to more advanced lighting where we want to add some secondary lights. But, overall right now, basic sunlight and basic lighting preview built into the form of a lightmap for our visualization project.
- Defining project goals
- Creating an Unreal Engine 4 (UE4) project
- Adjusting first-person project settings
- Creating effective assets
- Exporting assets for UE4
- Importing assets into UE4
- Placing assets in a scene
- Adding and editing collisions
- Working with textures
- Creating a basic material
- Adding a post-process volume