Baked Lighting

Ian Berget:
Hi, this is Ian Berget from Elara Systems and I’m here with one of our senior artists, Brian Barnett.

Brian Barnett:
Hello.

Ian Berget:
And we are talking today about Baked Lighting with a personal project that Brian was doing over his past vacation time and it has turned out as y’all can see really, really gorgeous. Just exceptionally high quality lighting. And some of these art assets I recall you were saying you built from scratch. Some of it is from asset packs you were working with, but all of the lighting and kind of quality of what we see here is a hundred percent you.

Brian Barnett:
Yeah, that’s correct. Some of the more complex assets like the bed and the couch, anything cloth oriented was purchased. And then some of these other assets, like these candles and stuff here, they were purchased, but the mirror, the armoire, the lamps, the chairs, the table… It’s about like a 50/50 split. And the room, of course, was me. So the trim and the molding and that door. Yeah.

Ian Berget:
Yeah. That’s looking really good. Would you be willing to expand the view a little bit more from the base?

Brian Barnett:
Sure.

Ian Berget:
Perfect. Even better. So, I remember when we were talking about this earlier, you mentioned that part of your project was you wanted to see how good you can make the lighting look with Baked Lighting for pipelines, where we’re trying to target things like mobile development or other pipelines where we don’t have the ability to do real ray traced lighting. Can you tell us a little more about that?

Brian Barnett:
Yeah. So, this was kind of my personal R&D on Baked Lighting and how I can really push that to its limits. And I wanted to get as close to hyper real as possible. So, I just dove in deep, did a bunch of research and just modeled up a quick bedroom and the majority of this room is actually being lit by the skylight. It’s not actually… The regular lights that you see here are doing very little but illuminating the objects that are in their vicinity. I wanted the skylight to do the majority of the ground-work here.

Brian Barnett:
So, if I just go to lighting only and close the materials out, you can see that most of that is the skylight. What you see on the walls and the ground is the skylight and then the rest, of course, is regular lights. So yeah, I just did that. I molded up some quick assets and I made some normal maps. I really tweaked the UV’s. One set for Textures, one set for Lightmaps. And I wanted to maximize the UV space on a lot of these assets so we can get a crisp texture detail and some pretty smooth light bounces and shadows.

Ian Berget:
Is it fair to say that you prefer to make your own Lightmap UV’s rather than using the generated?

Brian Barnett:
That is correct.

Ian Berget:
More control over the density?

Brian Barnett:
Definitely. More control over the density. With Lightmap UV’s, you have to be very methodical on what UV islands you maximize for light bounces or for light casting. If you have something like this Tic-Tac-Toe board, for instance… For one thing, I believe if I lift this up, there is no bottom of it or there is. Yeah. So I deleted the bottom of that and that’s because if I put that on a UV sheet, that’ll take up UV space, which results in Texture and Lightmap space, so what I did was I only deleted the parts that we won’t see and then the parts that are clearly visible, I went ahead and maximized out on the Tic-Tac-Toe board’s UV island, and then things that you won’t really see, like hidden edges or the corner or the bottom of things. Those are really small, in the zero to one space, but you want them equally spaced out too so you don’t get Lightmap bleeding. And UV4 does a pretty good job of generating Lightmap UV’s but that human touch is still kind of pretty nice to have on some of these assets.

Ian Berget:
That makes sense. So, a couple of notes I wanted to ask about were, number one: What makes this Lightmap baking that you’ve done here different from what comes pre-packaged with UV4? And then the other one was more about the light bleeding again, but let’s start with the first question. How is this different from the CPU Light Baking that’s built in?

Brian Barnett:
Yeah, so there’s an individual, his name is Luoshuang. I hope I pronounce that right. He has come out with a GPU Lightmap Baker and effectively what it’s doing, it is utilizing the GPU’s power as opposed to the CPU’s power. And I’m not really a programmer or on that technical side of things, but basically his results are a lot more accurate than the standard on the real Lightmap Baker, for some reason.

Brian Barnett:
I don’t know if it’s the CUDA cores in the GPU or something that has to do with the GPU, or it’s just simply him himself who’s made it better, but with that you get a better global elimination. You don’t get as many Lightmap bleeding issues. The Lightmap density is dispersed evenly when the light bakes. Like if I were to bake this with a CPU, a lot of the splotchiness you would see on the walls, even at a higher Lightmap resolution, for some reason would be more pronounced, but for his Lightmap Baker, which utilizes the GPU when you hit the bake button, it just works. So it’s pretty great.

Ian Berget:
And what was the length of time it took to bake this room? Do you recall?

Brian Barnett:
Oh, man. So to bake this room it only took me like an hour and not even that, maybe like 30 minutes. 30, 45 minutes to bake this room at the higher Lightmap density.

Ian Berget:
What graphics cards do you have that accomplish that?

Brian Barnett:
So, the graphics card I was using for this particular project was my 1080 TI at home. I would imagine that something like an RTX 20 or 30, would take half the time, if that. I built that in Production Mode, the highest build settings one could pick. Production Mode high in my World settings here. Yeah. The Static Lighting level I put at like 0.2 and the Bounces, I cranked up a lot.

Ian Berget:
That’s a lot of Bounces.

Brian Barnett:
Yeah. It’s a lot of Bounces and I’ve done some research and people say over 10 is overkill, but I was like, “Why the heck not?” So I put 40, but yeah, these settings would definitely slow down to CPU, but the GPU, it just chomps right through it.

Ian Berget:
Awesome. So going back to a previous question of mine, and you started touching on this a little bit. When it comes to light bleeding, I remember in a previous discussion, you mentioned you had to do some special adjustments to the scene just to make sure that there was less light bleeding around flat planes, especially around the window. Is that right?

Brian Barnett:
Yeah. So, I’m going to go ahead and pull out of the room here. This is the outside, this is the HTRI. I just have like an unlit sphere that’s kind of projecting the HTRI. It’s a little overexposed out here and that’s simply to get a more powerful effect inside, but yeah, it doesn’t really matter what you see outside because we’re not paying attention outside.

Brian Barnett:
But this mesh right here that I’ve highlighted, if I lift it up, this is what I have to prevent light bleeding. I just call it “the light blocker” and effectively what it does is… My meshes here, if you look close, I have the ceiling separated from the trim and the walls and then for some reason or the other, even though these things are flush against to each other geometrically, for some reason when you bake out lighting, whether you’re using CPU or GPU, we get light bleeding effects and that is because there’s nothing behind them to prevent that blocking.

Brian Barnett:
Even here on the window sill here, I actually had to raise… You can’t really see it well, but let me see, let me change the… Is it this one? Yeah. I mean, you can kind of see here. This balcony, as you can see here, I actually had to raise up… So the window frame here, I was actually getting some bleeding underneath the window frame. So you want to block out as much light as possible that could potentially bleed in and you’ll get a successful bake that way, whether you’re doing it GPU or CPU that’s for sure going to help prevent any light bleeding from happening. Any other bleeding you’d see would be from your skylight turned up too intensely.

Ian Berget:
That’s fantastic. So, I think that’s probably a good place to stop since this is probably going to be a multi-part discussion and we’ll have a chance to get into all sorts of things. The UV packing, the specifics of how you set up the skylight and kind of turn it into a multi-part series.

Ian Berget:
The last question that I have is: Would you be willing to pull up the webpage with that GPU rendering? And that way I can watch the video and track it down.

Brian Barnett:
Give me a sec, let me get that. Find it on my other screen here. Right at the top of Google. So this is it right here. This is a very lengthy form thread on the Unreal Engine forums. It’s about 128 pages long, going strong. This is it right here. And it’s called Luoshuang’s GPULightmass and he’s got a few different versions here. It looks like on the front page here it goes up to 4.22, but it’s actually up to 4.26 now, from what I understand. And I built this room at 4.25. So yeah, it’s regularly updated and it is amazing. So yeah, this is the hub of it all.

Ian Berget:
That’s fabulous. All right. Thank you so much, Brian, for telling us about your project. I think everyone’s going to be really excited to try some of these things at home and we will catch you later.

Brian Barnett:
Yeah. Absolutely. Take care.

Ian Berget:
All right. Bye, everyone.

Brian Barnett:
Bye.