Shadow Problem, Lightmap Causing This?

I posted a problem I was having with my static mesh walls in UE4 not long ago however it was resolved. I am now getting a new issue which is that the shadows that are cast look awful.

Here is an example:

When the shadow resolution is turned up to 256 it is perfect however will this cause my game to be gfx hungry/laggy as it took quite a long time to render the lighting that’s all. Or is there another way around this? Could it still be my lightmap causing the low res shadows to appear like that?

Thanks :slight_smile:

Hi Nickmadd,

The default settings for lightmaps are 64. Oftentimes this is too low of a lightmap resolution for walls or any large pieces. Increasing that size is common practice. When you setup your second UV channel to handle lightmaps some considerations you want to make are that you’re using the UV space effectively by using the entirety of the space but still giving a buffer between UV islands to make sure there is no shadow bleed.

As for the light rendering, yes it can take a while. CPU and Memory will definitely play a role here! Also, if you’ve not set up a lightmass importance volume you’ll see significantly longer build times. The ligtmass importance volume should encompass you’re playable area. Make sure this is being used in that area. This will tell the engine that anything within that space should be given priority and anything outside will have a lower quality shadows.

Depending on the size of your map, using culling volumes and LODs with your meshes will definitely improve performance as well.

If you have any questions feel free to ask!

Thank you!

Tim

Thanks that has really helped me understand how it all works :slight_smile: So let’s say I have an object with many uv’s and the lightmap can’t be made any bigger because the uv’s have taken all the space would I be left with only the shadow resolution to play with? If so the more UV’s the worse the lighting is going to be on an object right?

Hi Nickmadd,

World of Level Design has a great “UDK: Lightmapping Basics”](UDK: Lightmapping Basics and 18 Important Principles for Creating and Using Lightmaps for UDK) that walks you through a lot of how and what to do with lightmaps to get the most out of them.

While there are a lot of references to UDK a lot of this information will carry over to UE4 as lightmapping is the same process.

In regards to your question, Playing with the shadow resolution can help. There are settings in the world properties you can adjust that will affect shadow resolution and adjusting settings in the lights that are placed in your level. As for UVs and the more you have being worse, this would really depend on your model itself. If you’re concerned about your model not receiving good shadows to be baked you may consider breaking your model up or thinking more modularly with your design. This video from 3dMotive is a great tutorial series on using modularity to get the most out of lightmaps and your larger structures within your levels.

For most objects or one off pieces the lightmap resolutions of 64-256 should be more than enough. I’ve not used anything higher unless just using for testing.

One consideration that uses a combination of lightmapping and dynamic lights is using the lights in your level as Stationary Lights. This will use Lightmaps for distance but as you approach your mesh it will use dynamic lighting. This could be an option as well.

If you have any questions feel free to ask!

Thank you!

Tim