Join Adam Crespi for an in-depth discussion in this video Placing lights in fixtures, part of Unreal Engine: Architectural Visualization.
- Materials and lighting really go hand-in-hand in design visualization. We can't really show one well without the other. The lighting, let's say in an all white space, just doesn't look right; and materials without light sort of look, well, kind of dull. We really need good materials to show the lighting and good lighting to show our materials. Now that I've got the materials fairly dialed in, at least as far as I think I can go, I'm ready to get some lighting in my scene beyond that default daylight. I've put the brick on, on the outside and the inside, made sure that the slate floor and wood floors look good.
Gotten the white concrete on the stairs and so forth. Everything in here is ready to go with its appropriate roughness and secularity, and I'm going to get some spotlights in those cans to begin. What I'll do is organize a little bit, turning off a few things so I can see a little bit clearer. I'll open up this world outliner and what we can see in here, sorting by type, is that I've got a whole bunch of different things going on, and there's all my geometry. What I'll do is pick ceiling_loft and scroll all the way down here to the bottom of windows, hold shift and click on it.
This selects all the geometry, and then I'll turn it off. Then I'll come back up and go by label instead because they're alphabetical, and I can find my lamps overhead. I'll scroll down and we'll see them in here. Here is lighting-cans, and I'll turn it back on. We can also search up here if we need, looking for lighting, and it starts to find all those different things: our static mesh actors, our lighting folder and so forth.
Now that I've got these here, I'm going to get in and put some spots in, and I don't mind I've got the door blueprints in there as well. What I'll do is go over the left side and under my different classes, I'll choose lights, and we can see in here, opening up this window, we've got a directional light, a point, a spot and a sky. We already have a sky going on just providing that skylight bounce in here. Point light, as the name suggests, are points that emit light in all directions. So I'm gonna reserve their use for the pendants over the stairs.
A directional light is great for the sun, and I'm going to leave one in the scene for that. So I'll use spotlights for these surfacemount cans. I'll drag one in and press F to frame in on it. Now I'll pull down the content browser and the left side modes window so I get a little more real estate here. What I can do is either align these as well as I can to the perspective, or click on the different viewports here under perspective and choose orthographic and top.
I'll also go under show and turn off the grid. Now I can see in here pretty clearly what's going on with this particular light. I'll zoom in and there's the light, and I'll look where its centerpoint is and align it onto that can. I'll get as close as I can. There's not really a difference between an inch or so off that we can tell. Then I'll hold alt and clone it over to the next one. I'll work my way through these very quickly. It may be worth some naming at this point.
I'll name this first one CanSpot01. The second will become CanSpot02, and when I clone it, I'll end up with 3. We can always switch around how we see this label and get those lights in the right place. I'll pan over, hold alt and clone that over to the next can light. I'll work my way through here, alt cloning up to those fixtures.
And we see a red X appear. What this shows us is that this light may have issues displaying because I'm starting to get more lights than I should on a particular surface. We'll deal with that in a minute. First, I want to get all my lights in, and that brings me to an important rule in lighting. Don't judge the light until you see all the light in the scene. What I see a lot is that people want to get all of the different lights looking good singly and then say, okay, how does it look altogether? Really, what we should do is get lights in everywhere and then say, okay how does this look? You can't really judge one light on its own unless a space is lit by one light.
So in this case, this lobby being lit by multiple pendants could have all those pendants in before we do any judging on the lighting. The big thing with lighting as well, whether it's in a game engine or in a rendering, is fairly straightforward. Fixtures should look like the lights are on, and light should be coming from the fixtures. People miss this a lot in their quest for this theatrical lighting and rim light and so forth.
The big deal is really, do the lights look like they're on and is there light coming from them? That really reinforces the lighting in the scene and lets us have a little play with the theatrical lighting we're after. These are our practical lights and getting those in is important. Now I've got all the pendants, or rather, the surfacemount cans in for the lobby. What we can see in here, if we go into a front view, is they're a little bit low. I'll select them all, CanSpot01 through 12, and move them up to just under the fixture.
Again, with these lights, it's important that we don't clip through the geometry. We want to make sure that, that's just under that can because inside there, that lens right here has an emissive surface so it looks like it's on. We'd rather have the lights just under the fixture to avoid any accidental giant shadowing and instead have them look, well, like the fixtures are on nicely. We really can't tell a couple inches difference but it will make a world of difference in lighting artifacts in our scene.
Now that I've got these in, I can adjust them as needed. When we have multiple lights selected in here, they function somewhat like instances of a light or if you're familiar with Maya, like we're dealing with like attributes in the channel box. If you're a 3ds Max user, light instance nicely and that's kind of how these behave. In our lights then, we've got a cone, inner and outer angle and attenuation radius and a source radius and length, as well as intensity and light color. What I'll do in this light, actually all of these, is bring that inner cone angle up, maybe to 20.
I'll spread out the outer cone to 60. And although it looks rather wide, it's going to give me some nice wall washes. Then I'll take the attenuation radius down. This stops that light at a certain point. I'll try 500 and see how it looks. And what we can see here when we go back up in the outliner and turn on the floor is that this light nicely brushes the floor in here without hitting too far. I've got my floor lobby on, and we can see in here that one light almost comes down to the floor nicely and actually starts to decrease by the time it gets down there.
We can use attenuation then to keep lights out of certain rooms. Now that I've got these all in, I can also think about how they look in the scene and how they're behaving. The important thing though is to get those lights in. So I'll put in a couple of points for the pendants first before I do any adjusting. I'll scroll down to my outliner and turn on lighting-pendants, and there's my star lamps. For these, I'll use a point light, dropping it in the scene and positioning it on a star lamp.
I'll go to a perspective to do this. Press F to frame in and position it in the lamp. If you notice, I'm putting these lights right into that fixture, and I'll alt clone this one over. They are at different heights, and I'm putting these in here with the plan of making those fixtures not cast any shadows. I'd rather have the light coming from the fixture and no shadow from the fixture, maybe a little ambient occlusion around the base and instead get the light looking like it's coming from the right place, especially when the fixture like this has an apparent volume.
The lights are actually, if we look close, out at the ends. Now for a preemptive strike against issues in casting shadows. I'll pick these fixtures, this object, lighting-pendants, and I'll scroll up in the details a bit. Down here, canceling the autosave that's about to happen, what we can see is that at the moment, it's a static object, a static mesh. And down here in lighting, I'll turn off cast shadows.
This way, it'll light but won't cast giant shadows from those lights in the scene. Again, for these point lights, we can see in here that they've got an attenuation radius and intensity. I'll pick all four of them and affect them at once and do some renaming while I'm in. As a note on this, in case you haven't picked up on this one, I'm very big on not building until I'm ready to build. We can soak a lot of time up in building, and so I would rather get as much done as I can before I build and then build to see everything and adjust.
There's a lot of things I know how to do without actually building it, as tempting as it may seem. We're often tempted in this, to build it because we want to run around our space. Don't, is my advice. It's too easy to soak up hours of your day building because it's cool. So build when you're ready, work as long as you can, until you're ready to build. Now with all those renamed Pendant, I'll adjust their attenuation a little bit, pulling it back to maybe 500 and I'll see how it looks.
At this point then, we're ready to turn everything else on and build the lighting in the scene. I'll use my outliner, turning on all the different objects to bring them back in and make sure I'm not missing anything that might affect the lighting.
Everything is on. When you're ready, you can drop down under build and choose build lighting only, and see how this looks. I'll build it and check out the initial pass in the lighting in my scene. We can see my lighting build ran and I've got a good number of errors while it's compiling the shaders here. There's a lot of these errors of: Severe performance loss: Failed to allocate shadowmap channel et cetera, et cetera, light will fall back to dynamic shadows.
And that's really an easy fix. What it's saying there is that there's too many lights on one object, and it can't figure out how to handle it and we'll fall back to dynamic shadows. What I need to do then is to switch these lights over, these can lights and pendants, to be static. They don't need to turn off and on in the game. They need to be on in the lobby and we need to run around that space. We can see it's compiling the shaders, and I'll pan down in and we can start to see some of the lighting in here.
What we can tell immediately is that we need to change these lights over to be static and then we can think about adjusting color and intensity, but it's pretty nice-looking so far. They really add some power to it, getting some light going on in that scene. So here is that last fix. I'll pick all of my CanSpots. And while I'm at it, scroll down and hold control and grab all the pendants as well. With all these lights selected, what I'll do is in the details, mark them all as static and the Xs go away.
These are just here for baked lighting and not dynamic. Nothing is going to move and show these lights on them anyway, so I'm fine in baking this in. Now we can build again and play it and see what it's like to run around the space and judge, adjusting that lighting.
- Customizing a player controller
- Importing meshes
- Cloning and placing objects
- Creating sheens, metals, and glass materials
- Placing and adjusting lights
- Adding interactivity with colliders, triggers, and events
- Generating and sculpting terrain
- Placing trees
- Adding details
- Publishing the design