It looks like normal map doesn’t even accounted for in static lighting, regardless if the checkbox is ticked in the Project settings
Funny thing that if I place a static mesh on the terrain, it casts proper baked shadow on the terrain. It might be some sort of self-shadowing issue with static lighting. I have a strong desire to ditch UE4’s lightmaps and bake those in Blender instead, and multiply the image with the rest of the material (too bad that won’t work / will be too much manual work for static meshes that aren’t terrain or come with UE4).
The shadow bias setting is probably affecting the dynamic shadows (controls how close the shadows are to the caster) for the static lighting the terrain is very large so it’s difficult to get a good result, usually people avoid using baked lighting on large environments because you either end up with a high number of lightmaps or you can’t get enough detail.
I can’t use dynamic lighting (it’s for mobile VR), so I can only use static. I am guessing I need to scale down my terrain and see if on smaller scale baked lighting would look any different.
It’s just very odd looking lighting - even large terrain should have proper lighting, similar to what you see with fully dynamic lighting. The only thing that would be different is jagged shadow edges and highly pixelated baked shadows from normal map.
I’d be using the WorldNormal visualisation mode to make sure there isn’t something weird going on with that normal map that could be affecting lightmass…
I also tried baking lightmaps without normal map, and got similar results It looks more like self-shadowing issue as different actors cast pretty good shadows on each other and on the terrain.
I am pretty sure it is as I saw CSM acne and artifacts flickering on the slopes as I was moving camera around.
I am actually showing off self-shadowing there and how normal map contributes to shading. Lightmapped surface should look pretty close to that, but it doesn’t at all.
Looks to me like there are no shadows in either image. I believe your light angle is not shallow enough to actually cast any shadows from those gentle slopes. When you rebuild static lighting, the directional light is being constrained to be one of the only 3 ‘lobe’ directions for directional lightmaps. Each lobe is spaced 120 degrees around a circle and they are at a certain pitch above the ground as well. I am not sure off the top of my head what that angle downward is but its probably 30-50 degrees.
So if you had a somewhat shallow directional light, it gets snapped to a direction that is not as steep. So the normals are still affecting but they are seeing a different light direction after rebuilding. That is expected. Use a stationary sunlight if that is a problem.
Try making your sun much steeper so that actual static shadowing comes into play.
(After work) I’ll post comparison screens with camera at a different angle/location for unbuilt lighting and rebuilt lighting. The shadows are clearly there, I am not sure why you would say otherwise
I just need to have static lighting, not dynamic lighting at all (it’s for mobile VR). The sun (static directional light) is slightly above horizon (dawn). The reason for dynamic vs static screenshots are to show how soft self-shadowing is with dynamic lighting, and how “low poly” (almost like vertex lighting, not lightmaps) baked lighting is.
EDIT: Just baked lightmap in Blender - much smoother shadows than in UE4:
I still think the problem is that your light rays are basically parallel to the slope of the terrain you are trying to shadow. It looks like in a few spots there is an actual shadow, but most places above looks like backface normal attentuation to me as opposed to shadowing. It is easy to confuse them since they work together usually. I say that because the ‘shadow’ is stopping right at the crevice between the two dunes. If there were actually a cast shadow, it would also cast a bit on the upward slope of the lit dunes.
I made this image a while back to explain the same thing to somebody else with the same issue:
You are probably very close to the blue line such that lightmass doesn’t detect the shadow but the dynamic shadowing with its various biases and inaccuracies is.
Just humor me and try making the sun more shallow like the yellow line.
Looks like it may be computing the lightmaps with lower LOD due to the vertex shaped artifacts on some edges. I will have to check if that is a bug or not, but the rest of the shading differences could possibly just be the loss of precision between a dynamic light and a static one, and perhaps the static one is also getting more bounce lighting that is filling in the shadows. Have you tried setting indirect to 0 for the static one?
There is some other project setting that makes it so that normal maps cause normal shading based on that normal to bake into the lightmaps but I can’t recall what it was called and I am not certain if it will help here.
The terrain is about 10k tris and has no LOD. That’s why it’s puzzling to me to see dynamic lighting working well (predictably), and static lighting not working well as if it doesn’t take into account normal map
No, but now I will
Thanks
EDIT: Just finished building lighting with “Use normal map for static lighting” off and it looks (almost) identical to build with that option on. Sounds like a bug.
Oh right for some reason I forgot this was a static mesh not a landscape. That explains the jaggy artifacts then.
So that might explain more what is going on. I will try to find that project setting for normals and lightmass (if it even still exists). It used to be possible to make it take the normal map into account for this.
You could always import a 500k mesh as LOD0 and simply force it to render as LOD1 with 10k tris as a workaround