Difference between shadows of (MovableLight+MovableObject) vs (StationaryLight+MovableObject)?

In artice: https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/LightMobility/StationaryLights/index.html
Quote: “With enough dynamic objects, it is more efficient to use a Movable light instead”.

I still dont understand what the difference, between (MovableLight+MovableObject) and (StationaryLight+MovableObject), and why (MovableLight+MovableObject) is faster when too much MovableObjects.

They seems sompletely identical.

There isnt a difference when dealing with movable objects as they are always dynamically lit. The stationary light bakes lighting for static meshes while offering dynamically lit shadows on objects that are within a set distance.

That’s really going to depend. Dynamic lights render within a setup range. If you have a lot of objects casting dynamic shadows you will see a performance hit whereas using static baked light has no overhead and provides sharper shadows. Its a balancing act really. The best thing woukd be to set up a scene with a bunch of objects have the lighting setup for dynamically lit then the same scene with static lighting with a couple of dynamic lights and compare your performance. If you have trouble try to find the balance that befoew st suits what you want to accomplish.

Any comments about phrase: “With enough dynamic objects, it is more efficient to use a Movable light instead” ?

You misunderstood smth. I dont compare dynamic and static shadows. I compare Stationary and Movable lights affecting to Movable objects. (Shadows always dynamic in this case).

I’m aware that you’re not comparing the the static lighting vs dynamic (stationary and movable).
I was suggesting if you were creating a scene and wanting to compare differences in performance this would be a way to look at static vs dynamic.

Static Lights - precomputed shadow that are baked in to a 2nd UV channel for lightmaps

Dynamic Lights: Movable and stationary.
Stationary is a cross between static and dynamic. It requires you to have lightmaps on any objects that are not movable. The reason is that it will bake the lighting into a lightmap when you are far away you will see precomputed baked lightmaps.When you are getting closer it moves to using dynamic shadows to light the object.

Dynamic light - this will ONLY give dynamic shadows to the objects that cast shadows.

If you have a movable object (ie. a character, a life, anything that moves) it CANNOT be static thus meaning it will always cast dynamic shadow.

There is no difference in how stationary or movable lights handle lighting with a movable character/object. There is a difference when it they are dealing with a non-movable static object though.

I hope that clears it up.

Look :). Example: 2 static objects + 8 dynamic objects. With stationary light we will have 2 lightmaps + 8 dynamic shadows, and with movable light we will have 10 dynamic shadows. Dynamic shadows is worse performance than lightmaps, so how can be Movable light better performance, when there is “enaugh” dynamic objects?.. Movable light is always worse performance than Stationary light as i understand. But the phrase says: Movable light is more efficient.

2nd example: 0 static objects + 10 dynamic objects. I.e. very enaugh dynamic objects. Phrase says: Movable light is also better in such situation.

Nevermind, i will assume this as documentation bug.

Oh! Haha I guess that would be a doc bug. Movable lights have always been more expensive to use for sure! At least from what I can tell. Static lighting has no performance hit, stationary is minimal since it’s a combo of the two, and dynamic is a gut punch if not managed well.

Sorry for my confusion going back and forth. :slight_smile:

I wrote that bit of the documentation and the corresponding features.

Movable lights cast shadows assuming everything can move, including the light itself. They use whole scene dynamic shadows, where everything is rendered into a shadowmap each frame (extra draw call per object / light interaction) and then applies the shadow to each pixel doing filtering. A movable object in this context costs no more than a static object, because they will both be rendered into the light’s shadowmap every frame. In the future we may optimize this for Movable lights which aren’t currently moving.

Stationary lights are more complex. They are optimized toward mostly static scenes with a smaller number of moving objects. The methods used to make the movable objects fit into the mostly static scene have a high per-object cost. These are a per-object shadow to handle the Movable object casting on the ground, and a ‘preshadow’ to handle the static environment casting on the movable object. Now if there are many Movable objects with a Stationary light, that can be much more expensive than the same number of movable objects with a Movable light, because each Movable object with a Stationary light creates 2 dynamic shadows, while the Movable light always has one large dynamic shadow, all the time.

In the end, profile your scene and see which is faster. You can use the Show->Advanced->Shadow Frustums to visualize the dynamic shadows being created. It’s mostly extreme cases like destruction where hundreds of small shadow casters in the same area are created that cause problems with Stationary lights. The solution there is usually to attach the pieces together and use bLightAttachmentsAsGroup.

Very nice thx.

Would bLightAttachmentsAsGroup also work with attached actors ?