Lightmaps using LightmapSettings.lightmaps not working
I tried all the various solutions found on the internet but nothing worked. I have a scene where a script manages night and day mode. If it is day it should have a different lightmap than if it is night, this should be doable in runtime.
my script looks as follows:
public Texture2D day;
private LightmapData[] dLightmap;
void Start () {
dLightmap = new LightmapData[1];
dLightmap[0] = new LightmapData();
dLightmap[0].lightmapFar = day;
LightmapSettings.lightmaps = dLightmap;
}
There are a few other functions and lightmaps attached but just for testing if I am able to switch to a different lightmap i wrote this basic script. But when i start the game the lightmap doesn't change.
I tried the .exr files imported both as texture and as lightmap, i tried png's generated from the .exr files but nothing works. What am i doing wrong?
Comment
Hi, If you have found a solution, i'm really interrested ! I have the same problem. Thank you !