Weird Shadow on Static Mesh and Directional Light Not Affecting Certain Actor

Hi All, I’m quite new in Unreal Engine 5.1 and currently I’m having problem with lighting.

I have built a level with some imported FBX and some of the static meshes are giving me weird shadows that can’t be removed unless adding a new light with cast shadow option unchecked. I couldn’t find any settings that is affecting it and would like to seek help here.

I also have static mesh that is not in emissive light to lit up after turning off directional light while leaving the sky light on, and all static mesh has the same light channel.

This is when directional light is on, cast shadow is on.

This is when directional light is on, cast shadow is off.

This is when directional light is off.

Your help is much appreciated as it’s my first time facing this issue and I need to get this work. Thank you for your time.

Hi Chin,

Welcome to the Forums, I’m not sure which shadows/mesh you’re asking about.

If you’re using the emissive channel in the materials, then shadows wont be cast on it.

That doesn’t look like a shadow - rather shading from vertex normals. Something is probably wrong with your mesh normals.
Put a cylinder in the scene next to it so the surfaces are oriented somewhat similarly and then go into buffer visualizers → world normal.

2 Likes

Hi Astrotronic,

The shadows are the extreme dark part of the shadow, if you see the first picture, the diagonal line shadow is the actual shadow lightness that I’ve set for directional light.

HI BananableOffense,

I’ve tried putting a small cylinder here and set the buffer visualizers to world normal. Does this look normal?
Screenshot 2022-12-20 at 12.47.09 PM

Yes that looks correct - the colors represent the facing direction. The pixels in your mesh that are pointed in a particular direction have the same color as the pixels of the test cylinder pointing in that given direction.
I’m still not convinced the normals aren’t responsible somehow. The hole in the surface seems to be causing unusual lighting as though some of those edges are incorrectly marked as smooth. If they are intended to be smooth, add an extra edge loop to the mesh to help the normals interpolate more smoothly. It looks like it was boolean’d out and that can cause issues with getting a clean triangulation without some extra support.

I get what you mean but currently what I want to remove is the large dark area of shadows here.

I understand the problem at hand. What I’m saying is problems with the mesh will create improper shading. Badly smoothed geometry is a common culprit. This is because game engines will interpolate the vertex normals from one point to another. So if you have two vertices with very different normal directions that are physically spaced apart, then the interpolation between these points can create unattractive shading.
Good mesh geometry is critical to getting proper shading. One common cause of bad shading is when edge smoothing is enabled on large surfaces that have steep angles. They should either be marked as sharp, or supporting geometry can be added to interpolate the normals and therefor the shading better. This type of artifact is clearly visible in the left edge of the hole.
90% of weird shadows are due to bad mesh normals, and/or bad normal maps.
Its possible it is something else. But since it happens when shadows are disabled it almost certainly isn’t a shadow. To explain further we need to clarify how shading is different from a shadow.


Shading exists on any lit object as a consequence of how much its face (normal) is pointed towards the light - whether it has a cast shadow or not. The dark part of this self shading is also known as an attached shadow in in life and art. Cast shadows are when an objects shadow falls on another surface (such as the roof surface casting the diagonal shadow on the wall you mentioned earlier).
Disabling shadow casting will never remove the attached shadows/shading. Changing a materials shading model to unlit will remove its shading - and most likely your artifact. Unfortunately it will remove all the shading that you do want too, so it isn’t a solution.

Its also possible that the shading is correct for the angle of the sun. Try rotating the main directional light and see how the surface reacts. If this is the case, you would need to add more light, such as increasing the skylight intensity.

1 Like

Thanks for taking the time to explain to me. While check on the 3d model’s normals, I’ve tried to lift the skylight intensity, it did help with the top cylinder shading but the roof became too bright, overly exposed. While the bottom mesh shading did not change.

Screenshot 2022-12-20 at 4.50.15 PM

A face not responding correctly or at all to changes in lighting is another classic symptom of bad normals.
You may want to add more, smaller, localized lights. Changes to the global skylight can help lift all shadows but as you experienced if you take it too far it will blow out the scene. I think another part of the problem is expecting even, glamourous lighting from a single directional light. The reality is that 50% of a cylinder will be in full shadow at all times when lit primarily by a directional light source. If using lumen’s global illumination, there is also a setting that can increase the strength of indirect light bounces but I would use it sparingly as it is less physically accurate to boost it.

I have tried to check on the normals but all seems well by facing the correct orientation. I might not understand normals well enough but I doesn’t seem to be able to troubleshoot from normals. But surprisingly weird I turned off the roughness of the bottom meshes, it then reacts to the skylight properly. This is so confusing now.

But some of the meshes although react to skylight, the lighting is still very much different from adjacent mesh which makes it looks unnatural. You can see it from the bottom wall and the floor shading.

Screenshot 2022-12-21 at 12.59.12 PM

By adding a bit of metallic on the floor mesh, the shadow now appears to look more natural matching the wall. I still didn’t know what’s the root cause of this roughness issue but at least it now works.

1 Like