How do I blend 2 lightmaps for day/night cycle in Unity?

Posted by Timothy Williams on Game Development See other posts from Game Development or by Timothy Williams
Published on 2013-02-19T22:51:54Z Indexed on 2013/06/29 16:30 UTC
Read the original article Hit count: 1181

Filed under:
|
|

Before I say anything else: I'm using dual lightmaps, meaning I need to blend both a near and a far.

So I've been working on this for a while now, I have a whole day/night cycle set up for renderers and lighting, and everything is working fine and not process intensive.

The only problem I'm having is figuring out how I could blend two lightmaps together, I've figured out how to switch lightmaps, but the problem is that looks kind of abrupt and interrupts the experience.

I've done hours of research on this, tried all kinds of shaders, pixel by pixel blending, and everything else to no real avail. Pixel by pixel blending in C# turned out to be a bit process intensive for my liking, though I'm still working on cleaning it up and making it run more smoothly. Shaders looked promising, but I couldn't find a shader that could properly blend two lightmaps.

Does anyone have any leads on how I could accomplish this? I just need some sort of smooth transition between my daytime and nighttime lightmap. Perhaps I could overlay the two textures and use an alpha channel? Or something like that?

© Game Development or respective owner

Related posts about unity

Related posts about light