Lightmap resolutions: performance and discussion

Hey everyone, i wanted to post this thread because i had some questions about lightmap resolution.

I was reading some months ago in an article in UDN(i no longer have the link) that Epic said the models with proper lightmaps usually will only need a resolution of 32.

Some days ago i made a rock which had about 7k tris(it’s purporse is to be a big one) and i started to mess up with lightmapping. For those who don’t know how lightmaps work, they serve as the UVs so the shadows can be baked into the texture, with that said they should have no overlapping UVs and should feel the most space possible in a 0,1 UV space.

The first try with this rock was just to flatten mapping and then try to look how it will look in the engine. The result was not very nice with a resolution of 32. I tweaked the UVs and then it looked a lot better. But even metting all the conditions to make proper lightmaps, those shadow seams were still showing. My model who had 7k tris, worked almost very nice for a resolution of 128. I still don’t know if it can be optimized so it really can use a 32 bit resolution.

I started to look at UDK asset folder and found a gigant rock just like mine that used a 512 bit resolution, the rest of smaller models(less tris) used around 64 to 128 bit. Very few of them used a 32 bit resolution which makes me think if it’s really worth it to tweak lightmap uvs or just increase the resolution. Then some of the models on UE4 used the same uv channel to use the lightmap and also used a 128 bit resolution.

So here are a few questions that i cannot answer myself that i want to share with you guys:

Do lightmaps need higher resolution with models who have more tris?

How much impact has to use a 128 resolution instead of a 32 bit?

Is it worth to tweak the lightmaps to get the best resolution possible?(if i use 128 instead of a 64 bit the lag will be noticeable in a map with many assets?)

Is there a way to test performance in UE4 to check this kind of problem?

Thanks everyone for reading i hope i can find some of my answers and that can be helpfull for some people.

128 isn’t really much. In short, the scale of lightmaps depend on your targeted platform, scale of objects and how much screen space they occupy.

I don’t think it has much effect on performance at all - the main problems with overly high lightmap resolutions are that it will take longer to build lighting, and could start increasing file size if you went really crazy with it.

A good way to judge what resolution to use is to use the “Lightmap density” view mode, which can be set via the dropdown at the top of the perspective viewport. You’ll be able to visualize how dense the resolution is on each mesh, and they’ll be colored blue to red based on density relative to scale. In some cases, red coloring is still fine if it’s a high-detail object you’ll be looking at up close, but generally you want most things to be in the blue or green range depending on the lighting situation (no sense in having a high resolution on a floor mesh that has no shadows coming across it, for example). Hope that helps.

It’s great to hear from a UE developer on this topic. Do lightmaps play a role in movable/dynamic lighting computation?

UE4 will blend dynamic shadows with lightmaps but that’s as far as their interaction goes–Meaning the shadow cast by a dynamic object will blend with the static shadows cast by the same light.