S
S
sudaID2016-12-31 13:00:17
Unity
sudaID, 2016-12-31 13:00:17

How to correctly set up the lighting of dynamic objects?

Hello. I have long been concerned about the lighting of dynamic objects. As far as I know, Unity uses a third-party renderer to bake the light, so there's a lot of concern about the discrepancy in lighting quality between static and dynamic objects.
Let me explain what I'm talking about. For example, there is a wall, part of which should move away, but at the same time not stand out from the general wall - a classic secret room with a bonus. It is logical that the entire wall should be static (the "Static" checkbox), and the moved part of it should be dynamic. But is it possible to achieve uniform illumination on these two parts? I couldn't do it.
Even using Light Probes, for some reason it turns out completely different from lighting baking:
3f6b796d99434dcbb8b2c9a27c44f708.jpg
The image clearly shows how the ceiling and wall (Static) are illuminated by the self-luminous material of the lamp, but on the far wall (darkened) this illumination is not there, it is simply interrupted.
Well, another question regarding the effect of Ambient Occlusion, also on the topic. If it is baked on a dynamic object as on a static one, then when the object is moved, the effect will leave with it, which looks very ugly. And if you don't bake it, it's even worse:
e65beb75c5894ee6be439590ac2a35a5.jpg
The only way I found is to use third-party components that implement Ambient Occlusion dynamically as an Image Effect. At the same time, I didn’t see the “use only on dynamic objects” settings there, which means that you need to disable the standard, baked Ambient Occlusion and add dynamic, which can greatly affect performance in a large scene.
In general, I will be glad to any comments on the topic.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Basmanov, 2017-01-08
@sudaID

In addition to Light Probe, you also need Reflection Probe, then dynamic objects will look better. Ambient light also affects the illumination of dynamic objects by default, you can unscrew it to zero on the Lighting tab. If you want to use Ambient Occlusion for dynamic objects, then you will have to make AO dynamic too, in a different way, only through dirty hacks. If the art style allows, then the junction of the dynamic and static walls can be covered with some debris.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question