laurenth-personal / lightmap-switching-tool

Tool that allows switching different baked lightmap sets on a unity scene at runtime.
MIT License
683 stars 90 forks source link

Incorrect results while using lights that don't have direct lighting baked #14

Closed katnyan closed 6 years ago

katnyan commented 7 years ago

I have two different scenes in my project. The same scene with Day and Night modes. Now, I have placed static geometry in a Scene and created two Lighting scenes.

Lighting Scene 1: It has the below properties Light Type : Baked SkyBox : Skybox_Day Lightmap Parameters: Day_Params

Lighting Scene 2: It has the below properties Light Type : Mixed SkyBox : Skybox_Night Lightmap Parameters: Night_Params

These two scenes look different when playing them using lightmap switching tool when compared to playing them individually. Baked Light Scene looks almost similar in both cases, but Mixed Light Scene is completely different. I tried loading the Lighting Scenes in both the cases to be on the safe side, but issue persists. I have followed the exact same procedure in ReadMe. What I am doing wrong here?

laurenth-personal commented 7 years ago

Hi, I'm sorry that's not clear at all in the readme but the tools is made to handle only baked lighting. It was actually made before the new mixed modes were introduced in unity and never added.

However, if you use baked indirect mixed mode, it is very simple to handle :

If you need shadowMask mode support you can look at : https://github.com/laurenth-unity/lightmap-switching-tool/pull/10 This doesn't load the lighting scene either so you need to do the same thing explained above.

I hope this helps and let me know if you managed to do what you want. I'd really like to add support for this in the tool in the future but if I want to make it easy to use it'll take me some time.

katnyan commented 7 years ago

Hi, I am using Unity 5.5.4 to run my project. I have loaded and unloaded the scene while switching the scenes. But still, it is more brighter than the scene which is played normally. I guess it is due to the Indirect light bounce. There is a bit of glossiness on the ground and this really kills the view of the ambience. Also, I guess when the scene is loaded, it only brings up the DirectionalLight gameobject in the lighting scene. What about the General GI settings in the lighting window? will they be picked from the scene from static geometry scene or from the Lighting scene? I am really confused here :-(

I would really love to see the example of scenario mentioned in TODO - "Include an example of lighting switching with lights that have baked GI but realtime direct lighting"

Would you provide this anytime soon? Looking forward for the same..

laurenth-personal commented 7 years ago

I think several things can still be causing different looking lighting, like the ambient probe maybe. I have done this loading unloading once already and I know there are a lot of things that can go wrong that's why I know it'll take some time to provide an example. I don't want to promise a date I cannot hold, I can try to do an example for next week, let's see if I manage to make something usable in that time.

laurenth-personal commented 7 years ago

you can take a look at the improvements branch, I've updated it today, it's being worked on using 2017.1.2f1

laurenth-personal commented 7 years ago

and updated the improvements branch today again to have shadowmask mixed mode support and simplified code.

laurenth-personal commented 6 years ago

You should now be able to use realtime / mixed lighting workflows with master branch and unity 2017.x Please let me know if you find more issues