I am stil at searching for a way to have both, lightmaps and normalmaps in Unity Free 3.42 (or also 3.5 in case the patch for the more drawcalls issues is available). By default and using the default shaders this doesn`t work.
It seems that you need your own selfmade shader for that. As stated in the manual:
So i grabbed Strumpy`s shader editor, modified the bumped diffuse shader and enabled the dualforward surface shader directive there. Which can be done by one checkbox in the Settings / Color and Lighting Settings, called Forward Dual Lightmaps.
Then i grabbed my level, have redone the lightmapping, using dual lightmaps and use dual in forward rendering, and have applied the shader. As a result the whole geometry turned darker. Lightmaps are hardly to see now, and bump effect is invisible. Useless result.
I reduced the problem to one object. The near lightmap does look odd. Pure grey. This is not what i want. I search for a way to display bump and lightmap at the same time. When the near lightmap would be the same than the far lightmap then we would talking. But it doesn`t really help me when i can have either the lightmapping or the normalmapping.
I`ve attached the reduced example, made in 3.42. Could somebody point me into the right direction here, please? Have i overlooked some settings? Is there a way to use lightmaps together with normalmaps in Unity free at all? HOW?
One step closer, but still not happy. I have copied the far lightmap and have replaced the near lightmap by that. Now i have lightmapping and normalmapping, which shows that the shader works. But the whole thing is much too bright. See screenshot.
I cannot edit the lightmap because i havent found a software to do that. What software is able to open exr please? Blender was the only one i have that at least opens the exr. But Blender saves the exr file in blue then. No clue if its a bug or wrong settings. Exr is a odd format.
Somebody an idea how to get this to work? What software do i need to modify the exr file? Or do i need to modify the shader?
Okay, a few experiments later i have to say the method is at least working. Just the brightness is still an issue. I have to retweak the whole light setting of the scene for that. And to replace the Near lightmaps with the Far lightmaps after baking is also a bit cumbersome. The working bump mapping is an advantage though. So it`s worth the hassle
What was funny is that in my level i have added a second point light. So i have two of them to light the scene now. One at Auto, one at Realtime Only. Which gives a good mix for the normalmapping versus brightness because the Realtime Only light doesnt longer light the lightmapped geometry. Gives of course a fewer bump effect. In my experimental scene here though this doesnt work. Dunno why. Here the brightness is the same for Point Lights, no matter how the light is set up.
Anyways, Problem solved
Now let`s have a look to create a diffuse bumped detail shader that works this way here …
Bad news. I´ve made this example with 3.42. The by Strumpy created shader does not work in Unity 3.5 though. And i am planning to upgrade my project at one point. Which means this method here is no go with the current shader.
What i get is a pink mesh and a bunch of warnings after conversion. See shot. The funny thing is that the shader code ends at line 116, and the debugger tells me about an error at line 190.
And when i close and reopen the project then i get just this warning here:
Material doesn't have a texture property '_Normal'
UnityEditor.DockArea:OnGUI()
I know that the lighting engine has changed in 3.5. The question is, what especially has changed? I am lost with writing shader code, thats why i use Strumpys shader editor. Has somebody an idea how to fix this issue? Or do i need to wait for a Strumpy Shader Editor version for 3.5?
Awesome. Now that would be nice to have. Unfortunately i do something wrong here it seems. No matter what i do, with or without generate lightmap UV´s, i get a result with not fitting lightmap. Dummy needs to stay clear, right? Could you please help me out here?
I have updated the shader to support lightmap atlas, see above.
P.S. Yeah dummy has to stay clear with Tiling 1 and Offset 0
If you don’t want to use realtime lights, you could use a cubemap to create a bumped effect.
To create a cubemap for lighting purposes, use an inverted sphere with all the lighting applied and render your cubemap from inside(center) of this sphere.
Perfect. Now it works as thougth. Many thanks for your help and tips
Regarding the cubemap idea, that would be another shader then, right? I think i am settled with the current method for now. But the cubemap idea is definitely stored.The only thing i may reinvestigate is if the quirky dual lightmap method may be better for performance. But that`s a thing to investigate when the by Strumpy created shader works in 3.5