Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
If you have Pro, maybe you can render the two lightmap textures into a third, and then use this third texture as a lightmap? That should be just like pixel blending, but massively faster. – Nevermind Feb 20 at 5:39
I do have Pro. How would I go about rendering the two lightmap textures together? This was my main lead but I've been trying to figure out the code/process to accomplish it. – Timothy Williams Feb 20 at 6:17
Umm create a material that blends two textures, use Graphics.Blit() to render it? I've never done this, but looking in the manual, it should work. – Nevermind Feb 20 at 7:29
So create a new material that can blend two textures to an output, apply the Afar-1 and Bfar-1, then use the outgoing texture for the lightmap variable? – Timothy Williams Feb 20 at 22:59
Yeah, something like that. I'd test it, but I don't have access to Pro version at the moment. – Nevermind Feb 21 at 8:09
show 4 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.