Unity 5.1.3 : Completely different illumination using lightmapping

Hi there!

I have been reading for a while about problems with Enlighten integration but i haven’t found any talking about that (probably my fault)

This is my real scene with realtime illumination:

And this is after calcullating ligthmapping:

I Have tried with Unity 5.1.1, 5.1.2, 5.1.3
Playing with all lightmap parameters but always the light burn the tree
All shaders are standard or standard (Specular setup)

If any of you knew some setting that i can be missing it would be incredibly helpful

Thanks in advance

Well it’s a completely different lighting system, hence a different result. There is no engine on the planet that will produce the same baked lighting as seen in the real-time preview.

@Moises_DrakharStudio Have an entire thread about it here.

Yeah, I’ve also got a thread on it… It looks like a gamma/linear issue. Realtime lights are in gamma(when you’ve set that), but baked lights are always in linear. So of course they don’t match. :confused: Seems like a pretty obvious bug and it’s a shame it’s not been fixed long time ago. I guess I’ll have to relight all the levels in our game when/if they fix it. Or we can hope they will enable linear on mobile.
http://forum.unity3d.com/threads/lightmapper-uses-linear-color-mapping-when-set-to-gamma.336658/

Btw, you will also see issues with lightprobes, they also will not match the baked lighting. Colors wrongly be color corrected and the attenutation wont match, and the detail is worse than in unity4 (the light wraps too far around to the back side)…

1 Like

@Hjeldnes I also noticed that baked lighting seems to match what I saw as realtime in linear. I am going to do some additional testing and report it later on. I would be surprised if a bug report has not been produced for this issue…\

Edit: Seems it is not a bug… My linear and gamma baked lighting do appear slightly different. Linear baking seems to be closer to linear real time than gamma baking/gamma rt. Either way, for gamma baking… it is like playing the lottery when trying to predict what you get out of it.

Well have a look at the link I posted, I would say that baked lights in gamma looks more similar to the linear lights(both baked and realtime).
Its a bit darker yes, but far away from the realtime gamma light. Also notice the color of the lightprobe. It does not match the original color at all…

Yes, there are differences when baking and we are aware of it and working on fixing it. Redoing gamma/linear handling in the baking pipeline is not a small task though.

2 Likes

Well…it may be a big task, but it breaks/makes lighting on mobile very unsure/difficult. When do you hope to have it fixed, 5.3? And what will happen when you fix it - will you make sure baked lights looks closer to the real time gamma light, or will you enable linear lighting on mobile? Will we have to relight all the locations? A costly operation that…

And for those of us that needs to be finished with a mobile game this year, what do you suggest we do?
Just stick to the linear’ish baked light and do a shader based gamma–>linear for the real time lights/lightprobes?

We did a simple pow(lightprobecolor,0.45) for another project, but is that enough? How do we easily implement this in a surface shader? I planned setting “noambient” tag and then setting lightprobe values manually(emission). Is that fine to do? (+ doing the same in a lighting override function).

Some workaround tips for those that can’t wait indefinitely would be really really really great.

I really like Unity, I do, but I must say that you guys dropped the ball in this release. The lighting tech just isn’t properly implemented :confused: Sure, Unity needs graphical upgrades, properly filtered shadows, postprocess effects, new terrain, SSR and all that, but you need to have the most serious bugs/features fixed before this. Bugs/broken features that existed since release.

Realtime GI is nice, but most games need some sort of backup system for lower end hardware. And for mobile we need to bake the lights, no getting around that.
And some of us actually use Unity for large scenes. We can’t have infinite range on the shadows. You guys should try to make huge game scenes, actual game scenes. You will see that there are problems.

Sorry for the whine, but these days I spend time waiting for baked lights to render/discovering bugs/verifying bugs & searching the forums about bugs, instead of actually creating games. Not a happy developer :confused:

Kjetil

1 Like

I am currently working on fixing the light probes so they will look the same as baked lighting in linear and gamma. This will go into 5.3 and then we can hopefully back port the fix to earlier versions. This is not related to enabling linear lighting on mobile.

Unfortunately it is not enough to just do the pow in the shader, as the math doesn’t work out, but it will get you closer. We decided to do a proper fix where we got all the environment lighting to match, then fixed the light probes in linear space and finally convert them to gamma after they are evaluated. So far the fix is touching 47 different source files.

1 Like

okay, but this means that the baked lighting in gamma will change to become more like the real time lights? (I see little difference between baked gamma and baked linear…)
I will do the pow in the shader and hope that will be ok for now. Appreciate the response.

Baked lighting stored in light maps will be addressed in a separate bugfix.