Join Craig Barr for an in-depth discussion in this video Building lighting as preview, part of Unreal: Architectural & Industrial Visualization.
- [Instructor] When building lighting for a visualization project within Unreal, it's important to work with a couple of different areas to visualize your lighting and to understand what's happening with your lighting. It's not as simple as just placing a light in the scene and manipulating it around. At the end of the day, you're baking or essentially rendering that light out to provide this light map effect to give your overall look, and this helps with performance and your overall visual quality of your scene. So let's take a look at how the settings work with objects, actors, within Unreal and how they relate to your lights.
Now this is important here because in a traditional 3D workflow, a lot of the overall lighting effect is driven really by two things, you have the light itself and you have your render settings. In Unreal we have another level of this, and that is because of the importance of light maps. Now as I mentioned previously, and we'll use this table here as simply as an example. If I take this table, double click on the Static Mesh, and bring in the Static Mesh Editor, you can see that if I click the UV preview here, we can see how the UVs are laid out in that, very simple.
And then on the Import Settings on this object, you'll see that Generate Lightmap UVs is there. That's on by default, so that it actually takes your UVs, uses those for textures, but it creates a separate channel, uses that same UV layout to provide a lightmap layout. And that's essentially baked lights that are composited over the textures, composited within the scene to give you this feeling of lighting throughout the environment throughout the scene. Now there are a couple things that we need to look at as to how that overall lighting is going to be affecting the scene, or for that matter, per object.
Now, each object has its ability to override the light map setting. So I'm going to click on the floor. This is actually, arguably the most important one within our scene. You can see the size of the floor here for our environment, but you can also see that we have a lot of these kind of hero shadows that are going to fall on the floor. Now, this is where we want to affect how the overall lighting effect or shadows are going to really look when we bake this. By default you can see that the default light map resolution is 64, which may seem small, but you have to remember what light mapping is.
It's essentially baking in the light. It's not a texture map where you need that uber-high resolution. In fact, I'd advise you, do not push the resolution too high. You can end up creating massive light maps, which are really hard on the scene and can end up being a big load time as well. Now just as a rule of thumb for this, what you do what to do is just be able to dial in or push it as far as you need to push it. Don't go above and beyond what you don't need. If you're not going to be zooming right in tight on these shadows on the floor, then I wouldn't worry about changing that either.
So with lighting here, we do want to check override the light map resolution here. You can see that that has changed in the Viewport. That's because we need to re-bake that essentially. We've added lights, we got to rebuild the scene anyways. So before we do that, let's actually build this in a preview sense. So we go to Build, and you can see that we have Lighting Quality still set at Preview. I'm going to hit Build Lighting Only. Now remember, this is going to be a little bit longer now because we have our sunlight and we have four spotlights placed throughout the scene.
As I mentioned, as you go further you'll see that I've actually gone ahead and put some other lights. There's one in the bathroom and we have something going on in the bedroom and that front entrance way as well just to provide some overall kind of finished lighting to the scene. We're building our lighting. We need to take a moment to actually apply that baked lighting. So you can see here, it's telling us that we have overlapping. Just ignore that for now. Everything is actually fine in the scene. And now, this is the look we're going to get. I want these shadows to be a little more crisp and where I can really see the effect of this on this floor down here specifically is this blocky look.
So this is where we want to look. Look at these pillars right here. This is a very blocky low resolution light map shadowing effect that we're getting. Let's turn it right around and actually zoom in. An area here a little bit more where we can really look at those light maps. There we go. So we can see how blocky that is. I'm going to click override the light map resolution, and I'm actually going to put this to about as high as I'd recommend that you go typically on this. Again, it depends on your hardware setup. I'm going to go to 1024, and the reason why I'm going to that is, well we'll see here with the shadows.
Let's go ahead and build the lighting out again. So I'm just going to do Build Lighting Only. And we're going to wait for that. We'll see in the bottom right hand corner it's building the lights. But we will definitely see a better effect on those shadows coming from those pillars or the section of the wall from the window frames that comes out over the floor. This is important to note that every object has its own ability to have a different light map resolution setting. It's actually very useful because the floor is arguably one of the most important of the shadows that are going to fall on that.
So that's probably where you'd want your highest resolution light maps. Things like the walls, you definitely want to bring the resolution up on there as well, even the ceiling if you have different lighting effects. The lower the resolution, the more blocky the shadow effect you're going to get. The higher the resolution, the more clean or more defined shadow effect you're going to get. And you can see that we're really starting to get towards that kind of overall shadow effect. Now, if we look at our walls here, I can see that that lighting is baking in, but it's a little bit blocky. Let's override that, but this time, let's not go up as high as 1024, maybe 256 will do.
And that's where we can certainly build the lighting out again to give that simple effect. I'll just do that here while we're taking a look at what's happening. And the important thing to note though is, object by object we can go in and we can set how the light maps are going to be built for those objects, 'cause it is using its own UVs at the end of the day here. So this is important to note, going to town and going crazy on every single object is totally unnecessary. There are areas where 64 is going to be fine. And there are areas where hero objects or areas where the camera may focus on most, where we're really going to want to dial into those overall shading, the overall light maps and the shadows as well.
So I'd strongly recommend that this is where you kind of evaluate your scene and some of the basics apply here of course, the floors, the walls, and any other kind of hero object. So we can see that we're starting to get a little bit better lighting going on those walls there as well. So we're going to leave that at that. That's a note on how to work with light maps, how to bake those in, and then we want to take a look at one more thing here. We want to take a look at these settings, these overall settings. So, what we want to be able to do with those light map settings there, we've got this 256 and we've used 1024 on the floor.
We want to make sure that our lighting is going to be baked properly within the scene. And as I mentioned about the light map resolution there, I would only focus on your hero objects in there. As of a note here, you see if I click the carpet, I've already set that to about 512. Some of these other objects here you can see that we're getting different settings. The countertop, for example, I've left to the default here at 64, but anything else that really needs any kind of nicer shadows or lighting, I've gone ahead and overridden that and cranked it up a bit. And if we take a look at the ceiling on these settings in here, you can see that I actually have that set here to the override light map.
I'm actually going to change that one because I definitely want that to be a little bit better, and our wall while we're at it because we're going to do another bake anyways. I'm going to put that one up to 512. So that's just a quick overview of how we can work with lighting, how we can build lighting, and the importance of overriding your light map value, but being careful to only override or only crank up that resolution, where it's really truly needed. It's easy to hop in and do it on everything, but it's unnecessary and it's going to bog down your scene to much. So, thanks for watching this.
In the next setting here, we're going to start to jump further into how we can get into better overall world settings with our render quality as well. Thanks.
- 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