Download

Problem with shadow resolution

Hi everyone! I am having a problem, as the title say, with the shadows resolution.

Basically when I set the Lightmap resolution of the object shown in the image to 512 (but even 256 looks fine) in the actor menu, the shadow looks nice and sharp, as in the image on the right. Problem is, when I do the build of the lighting, even using the production settings, the shadows looks like in the image on the left.

&stc=1&d=1427985111

Probably that’s a noob problem, but I am a beginner with UE, so here I am asking! :slight_smile:

Thanks in advance for any help!

Can you post a screenshot of your lightmap UV as well?

Often when trying to troubleshoot where issues are coming up with Lighting, especially pre-computed (baked) lighting, it’s best to show the lightmap UV as well. Increasing the lightmap resolution to 512 doesn’t really explain the situation fully because the UV islands for your unwrap could be not utilizing this space very well, which means it will not get decent baked shadows for your mesh.

Also, any settings you’ve changed in your Directional Light Source would be helpful, or are you using the default settings?

Since you are new to UE4, please have a look at our Wiki Lighting Troubleshooting and Tips guide (linked below in my signature). This is made up of some of the common questions that are asked with lighting and how to resolve them.

Thanks for the super quick answer Tim!

Here are my 2 uv channels. The first one is for textures, and the second is the lightmap… I tried to use both of them, but the result is the same.

Meanwhile I will have a look at the wiki.

&stc=1&d=1427987413

When you change the lightmap resolution it goes back to preview shadows, once you build the lighting it shows the accurate results.

In your case, for something like the ground it could be really large and require a higher resolution lightmap to get better detail. If there’s not enough detail in the lightmap you have to increase the resolution or split the mesh.

Your meshes also have issues though, you have a lot of unnecessary geometry–things that aren’t visible and won’t have an effect on lighting, polygons on flat surfaces that have no detail.
After that, you then need to work on the UV’s, which could be better, try and limit the number of seams as much as possible and you also need to have more space between the pieces, it adds some extra pixels around the edges so you need some space.

Hi darthviper, thanks for the answer. The ground is formed by several planes, so the lightmap resolution shouldn’t be an issue there. The problem is on the wall with the door. Just to understand: when I change the lightmap resolution for the mesh, the shadow is good: why? Is it because it is not a baked shadow but some kind of real ray traced shadow? Because what I fail to understand is why I get a good shadow before the baking, and after is always the same… no matter what resolution I set for the lightmap…

Yes, the reason for the shadows looking nice when you change the lightmap resolution is that UE reverts to dynamic light until you bake lightmaps again.
From the pictures of the UV sets you provided, it seems you have too little space between UV islands, which results in bad shadows.

Thank you Frepp73. I will try to fix it that way then! :slight_smile: Thanks for the help so far, I will let you know if that worked as soon as I have time to try it!

Yes, that was the problem. Set a higher space between the uv island and now everything is ok! Thanks everyone for your help! :slight_smile:

Glad to hear it helped =D

I resurrect this topic, because sadly I only thought I solved the problem… My problems with lightmaps are still there. I made a lot of different experiment, even with super simple meshes, but the result is always the same. I tried to add a lightmass volume, no changes.

Now, I could be not doing good lightmaps UVs for the first mesh above, as is maybe more complex, but I guess is hard to mess such lightmaps as for these two objects:

&stc=1&d=1428831752

&stc=1&d=1428831757

This is how the shadows looks like after a production light build. I also discovered this lightmap density view mode… all of my meshes are red, which means lightmaps are too dense. I read the documentation, but still could understand what is wrong with my lightmaps…

&stc=1&d=1428831767

&stc=1&d=1428831764

any help will be great! :slight_smile:

My initial guess is that it’s an issue with how the meshes are constructed, is there holes in your models, like a cylinder without a top or bottom? Mind posting the models on Google Drive or Dropbox for me to try to fix?

Thanks for your answer! ok… I think my knowledge about gaming assets is lower than I thought… I have a LOT of holes in the meshes! From what you say I understand that I cannot have open meshes?

On a second thought, this could be a problem, but what about the wall mesh on the left? This is closed, but still getting the red lightmap density… The shadows don’t look so bad there thou.

By the way, here are some of the models: Dropbox - Error

Here’s a recreated version of the pillar with a 128 light map, on the starter content level with all of the defaults (+lightmass importance volume)

Download: LightmapTest_ZacD.fbx - Google Drive

You don’t have to model things as one piece, it’s just that one sided surfaces wont cast a correct shadow, so you could have 2 intersecting meshes, and as long as they were closed off, it would work. I modeled it as one piece just because it was easy enough to do. (Those are the default prop walls that have some weird seams, but like I said, starter content with the defaults).

I could make a short youtube video explaining anything if you have further questions.

EDIT:

Note, I only made lightmap UVs, they aren’t ideal for actually texturing.

thank you so much for your help. Beside the fact that you gave a big help to see a completely different kind of approach to game assets, I also start to think that my problem was with the scale of the objects… Yep, you can facepalm me :smiley:

Oh, I scaled up the static mesh in the scene, I modeled the FBX using the same scale as your mesh, I think I cranked it up to about x5. With UE4, I’d always suggest try sticking to the default scaling they use, the lighting, physics, etc, is all set up around those values. I’d probably at least increase the scale to x10 because the pillar is still tiny compared to the chairs.

Yeah, I noticed that when I used some starter content in the scene, I did not see before how small that was! Sometimes solution seems so hard, but is all about thinking a bit out of your box! :smiley: Thanks again!