Closed rakkar1974 closed 4 years ago
Can't you turn the light off in your prefab after baking?
It's not the same. Mixed lights for example bake indirect light but not direct light. You also would not have shadows you should have. It also means post-processing, Aura light, and other effects based on lights wouldn't work.
On Wed, Nov 20, 2019 at 10:35 AM Ayfel notifications@github.com wrote:
Can't you turn the light off in your prefab after baking?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Ayfel/PrefabLightmapping/issues/4?email_source=notifications&email_token=AHVNNPEJRN7MICX54K53CNTQUVKMLA5CNFSM4JPUPMRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEESMMAA#issuecomment-556058112, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVNNPBXCI7W6BN7XFGVEXLQUVKMLANCNFSM4JPUPMRA .
Yes I understand that, I might add that feature at some point, thanks for pointing that out. I had never encountered the issue before but it is obvious once you mention those cases.
@rakkar1974 I just committed a change adding support for that(lights as part of the prefabs), you shouldn't get anymore double lighting and I have checked things work well also in mixed modes. It is saving baked lightmaps in the prefabs, applying them at runtime and applying the proper light properties, like their mode and their type (at runtime as well).
If I have a static room with a static torch and use "Bake Prefab Lightmaps" this results in double lighting. First, the walls of the room display the baked lighting, indirect in subtractive and baked indirect mode, and both direct and indirect in shadowmask mode. Second, the torch casts light in the scene yet again, because Unity does not recognize this was a baked light and should not be rerendered. During the baking process Unity will save which lights were baked and which were not, so as to avoid this issue. This project doesn't do that. As a result, the project is not useful for prefabs that themselves include lights.