Movable Actor Casts Shadows Very Differently when lit by Movable/Stationary Light

Discovered a pretty big discrepancy with how Movable/Stationary lights cast dynamic shadows to movable objects.

In the following first image the light is set to Movable. The Orange Mesh is set to Movable. The White walls are set to Static. Take note of the shadow the Orange movable mesh is casting.

In the following second image the light is set to Stationary, using the same settings and world position. The Orange Mesh is still set to Movable. The White walls are still set to Static. Note that the shadow cast by Orange movable is in a significantly different position, despite the light not moving.

When a Movable object casts a dynamic shadow from a stationary light it should be in the same position as when cast from a movable light? There’s obviously some small difference to be expected such as slight bleeding or shadow banding, but the big difference in the shadow cast is as if the light’s position has changed. Lighting is built in both versions.

Engine version is 4.23.1. Using the Forward Renderer.

Stationary lights bake indirect lighting and shadowing, so the back wall is probably appearing lighter (as if the light was moved closer) because the light is no longer movable, which would create dynamic indirect lighting for it. Same for the orange mesh. You would think it’d stay the same, with a bit of margin of error perhaps. But the idea of baked lighting is it stores the lighting in lightmaps, whereas the remainder is stored and interpolated in the volumetric lightmap samples. In fully dynamic lighting, there is no lightmaps, or the lightmaps are barely used at all, or they’re used differently…I don’t know which, lol. It’s an advantage to parameterize even the diffuse map / color / term of the material, since Lightmass and the VLM (volumetric lightmap) picks up color and light in the diffuse term according to its value and re-casts it. It’s at a fraction of the initial direct cast or first/second… bounce, so if the diffuse value in Base Color of the material is low (0.1, 0.25), then the bounced lighting is going to be far lower even if it’s only squared (0.1 ^ 2 = 0.01). 0.01 of the previous light bounce is distributed in the scene / area. So, obviously there certainly are differing calculations / interpolation for dynamic vs. static / stationary.

Hi, thanks for the reply.

I understand, and have no issue with the back wall appearing lighter - if you refer to the opening post the issue is with the shadow being cast - not the brightness of the indirect lighting.

The problem is with the position of the shadow.

It may be difficult to tell from the screenshots - if you open both of them in your browser and compare you will notice that the position of the dynamic shadow changes based on whether the PointLight is set to Movable or Stationary - when it should be the same.

I’ve tried to illustrate the problem more clearly below:
I have overlaid two screenshots of the level - you’ll see that the shadow is different based on the light being set to stationary/movable.

To Summarise/Reiterate:

When a Movable Static Mesh Actor casts Dynamic shadows from a Movable Light, the shadows are correct.

However, when a Movable Static Mesh Actor casts Dynamic shadows from a Stationary Light, the shadows are wrong

So I’ve made a new scene/project to demonstrate the problem as clearly as possible.

Open the following images in your browser. Toggle between them and you will see that there is a big difference in the shadow’s position based on whether the PointLight is set to Stationary/Movable.

SM_Shutter = Pink Wall.
SM_Room = Yellow Walls.

I think Stationary lights are casting Movable shadows from an offset/wrong position.


Pointlight set to Movable. Pink Wall is Moveable. Yellow walls are Static.


Pointlight set to Stationary. Pink Wall is Moveable. Yellow walls are Static.


Pointlight set to Stationary. Pink Wall is Static. Yellow walls are Static.


The only thing changed between these images is the PointLight’s Type (Stationary/Moveable) and the Pink Wall Actor Type (Static/Moveable.)

Dynamic Shadows from Stationary lights are casting incorrectly for Moveable objects. When you’re trying to use a Stationary Light to create a Movable Shutter on a Window this presents a real problem.

The movable object’s shadow is offset from the corner. I see it in the original screenshots now too. I’ve encountered the same problem in two of the templates (FPS and TPS), and also deleted the reflection captures in those levels and still have seen the problem. I’ll check my projects for those levels and see if it’s still there at any of the objects’ shadows. I also was not using point or spot lights at all, so I think it may be a different light, the dynamic/static setting, and/or the other lighting settings. I wouldn’t think it’s a mesh issue, yet it could be guessing at how odd of an issue it is.

Yeah - I appreciate it’s quite hard to tell in the screenshots unless you literally flick between them in your Browser tabs or in a photo viewer.

The shadow cast by a Movable Mesh Actor definitely moves quite significantly based on whether it is being lit by a Stationary or Movable actor though - when it should be pretty much the same.

Stationary lights are supposed to create Movable Shadowing on Movable objects in the same way that a Movable light would. A small margin of error based on bias/resolution settings would be expected, but this isn’t a small margin of error and tweaking those sorts of settings makes no difference.

It does look as if Stationary lights are outright casting movable shadows from the wrong/an offset position.

I’ve zipped up a test project and sent it to Epic in a bug report as it’s baffled me/surely can’t be considered optimal behaviour. It’s created a real problem for doing shutters in windows without having to resort to janky tactics like invisible shadow casting meshes.

I also see now how it shifted the shadow further up where it hits the wall. I didn’t see it before because it’s kind of a subtle change. I wonder if stationary on movable object processes a point light differently, or if it’s caused by indirect lighting sampling error.

I see. It’s challenging to be precise with something that can change so quickly. You might try using a light propagation volume as it generates dynamic lighting/shadowing that can be tweaked within the volume’s bounds rather than having to modify and correct for all stationary light-to-movable object situations in the level.

dasdasdsada

dasdasdsada