Exporting normal maps for opengles engine and for Unity I've ran into a problem.
Here's how they look in Max. They behave as expected.
And by eye the map looks perfect
But in opengl and Unity the surfaces looked like they were shot at, ugly and full of holes. In this test case, you can even see some non existent parallel lines.
So, I've tried:
saving to different formats (tga, png);
saving in 8 bit and 16 bit;
changing renderer (scanline, MentalRay);
changing samplers (max sampler, disable sampler...);
And the noise didn't go away.
Then I've turned up the contrast in ps and that's what I've found:
So, picking colors around the image I've notice that some pixels, which should have had a neutral violet (128,128,255), actually had 129,129,255.
The only solution I've found to this was baking in Vray in 32bit exr, then
copying and pasting the document in an empty 8 bit document (reversing the gamma gave the same precision errors).
The normalMap after that was perfect, and increasing the contrast didn't reveal any noise issue.
I can't understand if I'm missing something or if people usually bake normals with this hidden "feature".
Replies
It's helpful to hide banding artifacts in diffuse or lightmap or other non-precision bakes. But not good for normal map bakes.
This thread is a good read on the subject:
Of Bit Depths, Banding and Normal Maps