Normals Gone Bad

Short version: check out my free, open-source tool to check if normals textures (those bluish things) are well-formed, and fix them when you find they’re not. Code’s for Windows, but it’s command-line driven and should be not-too-hard to translate to Linux. The page explains the problem, solutions, and proper formulas. Let me know of any goofs.

I’ve been finding over the years that lots of normals textures out there are wrong. Sometimes just a little bit, sometimes quite a lot. Part of the problem is tools that don’t properly normalize the output. Another source is that these textures are blithely resized or otherwise filtered, which doesn’t entirely work when you’re storing normals. My long-term goal is to check over any tools that generate these textures and make sure they work well, and if they don’t, try to get them fixed.

So, please help! If you generate normals textures, what tools do you use? I’ve listed the few I know near the bottom of the repo’s page. Write me at erich@acm.org, or reply on my Twitter post.

Also, if you know a good way to programmatically tell DirectX-style from OpenGL-style normals textures (yes, there’s a difference: Y normal component are negated for DirectX), please clue me in. I’ve tried a few ideas; no winner yet. I think converting from the texture back to a heightfield twice, reversing Y for one attempt, and seeing which is more reasonable, would do it, but haven’t seriously tried that yet.

Which one is poorly formed? I can’t (easily) tell without a tool, which is why I wrote one.