hi guys,
I’m new to the baking of unity and I stumbled up on this problem, where the specularity and normal of the surface gets distorted in a weird way(see images below).
I spent couple of days trying to solve it, but no help… even in forums…
it has to do something with the metallic and smoothness values of the baking, because when i bring it down to 0, the problem goes away, however, I do need the shine of the metal.
I think you can reproduce this if you take a surface, and make it 0.5 smooth and 0.8 metallic, then bake directional specular with a point light, you will get this result
Its not only you, It looks like the directional map is changing the surface normals of the object. my bake, was in a new Unity 5.4 project, with only unity assets(Cube and Quad mesh) all lights baked, and all meshes lightmap.
The Directional Specular mode was introduced before Reflection Probes and SSRR existed in Unity. It really only has enough storage to keep information on a general light direction and on whether the incoming light is coming from one well defined direction or if it’s more ambient.
That means that areas with multiple overlapping lights are problematic. The direction can suddenly change over a few texels and that can mean that areas where you’d still expect a certain specular highlight to continue will not have one, as the interpolated direction for multiple lights gives the highlight for a different viewing angle than the current one.
Also, even with just one light the shadow edges were tricky, as going from light into the shadow you are effectively going from an area with a well defined direction to an area with quite an arbitrary direction (best case: a direction pointing somewhere into the sky, in case of an outdoor scene). Those borders were initially incorrectly shiny almost no matter the viewing direction (they behaved as if the geometry was embossed), but luckily that was fixed with some clever filtering.
Joachim’s right that going forward reflection probes and SSRR are what should be used for the specular contribution (see the post linked to above). Additionally, we will experiment with the specular directional occlusion to properly attenuate information coming from reflection probes.
Specularity → Reflection of light, so current methods for reflections should cover that. The advantage that traditional specularity has is the precision, but the Directional Specular mode quickly lost “precision” making it a bit useless. It’s not that the Unity implementation is buggy, it’s that the method in general is a bit flawed and you really have to set up your scenes around it in order for it to look right.
I’m digging the direction Unity is going with the lighting. If the progressive lightmapper is also everything I hope it it will be (I guess I’m setting up myself to be disappointed though ), I’ll be a happy camper.