- Home /
[SOLVED] In which GI lighting modes are different light probes/maps used?
In Lighting window of Unity 5.0.1f1 I have some GI settings like: Ambient GI (realtime/baked), Precomputed Realtime GI (I'm interested in only set/unset), Baked GI (the same set/unset).
I've found out that Unity stores lighting in lightmap textures (created in baked mode), also in RenderSettings.ambientProbe (if ambient source set to skybox), and LightmapSettings.lightProbes (don't know yet what modes).
I'm not interested in sky reflection probe.
I want to store all relevant lightmaps/probes in script (and/or manually in Editor) to switch between two distinct lighting (no lerp etc) settings in-game. If it matters, I have Terrain object in my scene.
From what pre-baked sources is lighting retrieved in-game for each settings combination? Maybe several sources are merged in some of the modes? Or did I forget some?
Update:
See my answer.
In the question I didn't mention that I had a separate Camera for both lighting settings. I relied on Skybox component of Cameras which is not suffice to alter skybox lighting even if I alter RenderSettings.ambientProbe: terrain trees are affected by this change, terrain base is not (compare attached pictures).
Even though I didn't yet find solution to affect terrain base by skybox per camera (RenderSettings.skybox seems to be applied with a delay?), it goes beyond the original question.
Answer by scorched · May 19, 2015 at 01:42 PM
I've put these lines in Start method in one of my scripts:
Debug.Log("baked light probes: " + LightmapSettings.lightProbes.bakedProbes.Length);
Debug.Log("light probes: " + LightmapSettings.lightProbes.count);
Debug.Log("light maps: " + LightmapSettings.lightmaps.Length);
Manually baked after each change in settings. All lights in my scene are realtime.
Results for every combination are:
1) Both marks unchecked, no matter what Ambient GI is chosen:
baked light probes: 0
light probes: 0
light maps: 0
2) Pre-computed realtime GI checked, Baked GI unchecked, no matter Ambient GI:
baked light probes: 1398
light probes: 1398
light maps: 0
3) Baked GI checked, Pre-computed realtime GI unchecked, no matter Ambient GI:
baked light probes: 1398
light probes: 1398
light maps: 3
4) Both checked, Ambient GI is Baked:
baked light probes: 1398
light probes: 1398
light maps: 3
5) Both checked, Ambient GI is Realtime:
baked light probes: 0
light probes: 1398
light maps: 0
Also, I've found this article useful: http://www.edy.es/dev/docs/unity-5-lighting-cookbook/
Still investigating what can be done to alter light probes in 5th case.
Your answer
Follow this Question
Related Questions
Enviroment Lighting from Sky not updating in realtime 0 Answers
Ambient Intensity not working 2 Answers
Unity5: Changing AmbientSkyColor doesn't change Skybox Color 2 Answers
Apply custom HDRI to light probes to blend between them? 0 Answers
RenderSettings.ambientProbe "empty", how to access? 0 Answers