Hi,
I'm playing a bit around in Unity and I run across an issue with the lightmaps in one scene. Basically in the scene there are some areas where I have very bright light because I need those areas to overbright. Everything works fine on a PC but when I tested the same scene on a mac as soon as I changed the building setting to ios for iphone the lighting changed. You can see a comparison in this picture.
it seems to me like if the lightmap has a different range(0-1) and it doesn't overbright the texture anymore when the project is set for ios.
Has anyone experience the same problem? Does building a unity project for the iphone have any limitation with the lightmaps?
Replies
Mac uses OpenGL instead of DirectX so there could be a problem with using PC baked lightmaps on OSX, plus IOS doesnt support deferred lighting so using deferred lightmaps in forward rendering would cause problems.
commander_keen: I've already tried recompiling and I copied the entire project to mac. (if the project is set to pc or mac standalone everything works fine as soon as I switch to iphone the lighting changes.)I also tried to create a new simple scene from scratch on the mac but I still get the same result that when a yelloq/orange light illuminates a grey texture(my base diffuse for the rocks in mainly in grey tones) it becomes green like in the screenshot i posted. I know ios doesn't support deferred lighting so I'm doing everything in forward rendering.
I've been messing around with the shader yesterday and instead of using the ones provided with unity I'm rewriting it implementing a modulation 4x of the lightmap and it seems I'm getting somewhere, strange enough considering that the standard ones should do exactly the same thing. I still don't know why this difference in behavior when the unity project is set to iphone but at least I might be able to find a workaround.
Thanks again for the help.
I took a step back and I did a few tests with a very simple block from my scene and different lighting setup.
The first image is with the building settings set to ios and the second one with PC/MAC standalone(I'm posting only the lightmapped version because the others are the same).
You can see how different the results are (light intensity for the point light is 8, for the directional is 2)
I've also tested with an unlit shader that supports lightmaps but I still get the same strange behavior that everything turn green when the building settings are on ios. Any idea why?
I also noticed the behavior in general is a bit different from point light and direction light(no matter what building settings), not a huge difference but I'm not sure why, perhaps there is some explanation on how unity handles those light with specific shaders that I'm missing.
One other question that came up is: once I bake the lightmap it seems I can't get back to the lighting I had before even if I clear the lightmap. My pieces become black and don't react to the lights in the scene how they should. Perhaps unity still expect to have a lightmap there and renders them black, is there a way to go back to dynamic lighthing after I baked a lightmap?