{"id":6090,"date":"2024-03-15T14:22:23","date_gmt":"2024-03-15T20:22:23","guid":{"rendered":"https:\/\/www.realtimerendering.com\/blog\/?p=6090"},"modified":"2024-03-15T14:28:27","modified_gmt":"2024-03-15T20:28:27","slug":"normals-gone-bad","status":"publish","type":"post","link":"https:\/\/www.realtimerendering.com\/blog\/normals-gone-bad\/","title":{"rendered":"Normals Gone Bad"},"content":{"rendered":"\n<p>Short version: check out <a href=\"https:\/\/github.com\/erich666\/NormalTextureProcessor\">my free, open-source tool<\/a> to check if normals textures (those bluish things) are well-formed, and fix them when you find they&#8217;re not. Code&#8217;s for Windows, but it&#8217;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.<\/p>\n\n\n\n<p>I&#8217;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&#8217;t properly normalize the output. Another source is that these textures are blithely resized or otherwise filtered, which doesn&#8217;t entirely work when you&#8217;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&#8217;t, try to get them fixed.<\/p>\n\n\n\n<p>So, please help! If you generate normals textures, what tools do you use? I&#8217;ve listed the few I know near <a href=\"https:\/\/github.com\/erich666\/NormalTextureProcessor?tab=readme-ov-file#resources\">the bottom of the repo&#8217;s page<\/a>. Write me at erich@acm.org, or reply on <a href=\"https:\/\/twitter.com\/pointinpolygon\/status\/1768730543234117924\">my Twitter post<\/a>.<\/p>\n\n\n\n<p>Also, if you know a good way to programmatically tell DirectX-style from OpenGL-style normals textures (yes, there&#8217;s a difference: Y normal component are negated for DirectX), please clue me in. I&#8217;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&#8217;t seriously tried that yet.<\/p>\n\n\n\n<p>Which one is poorly formed? I can&#8217;t (easily) tell without a tool, which is why I wrote one.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2024\/03\/readme_clearcoat_diff.png\"><img loading=\"lazy\" decoding=\"async\" width=\"812\" height=\"858\" src=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2024\/03\/readme_clearcoat_diff.png\" alt=\"\" class=\"wp-image-6091\" srcset=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2024\/03\/readme_clearcoat_diff.png 812w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2024\/03\/readme_clearcoat_diff-284x300.png 284w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2024\/03\/readme_clearcoat_diff-768x812.png 768w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2024\/03\/readme_clearcoat_diff-624x659.png 624w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;re not. Code&#8217;s for Windows, but it&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6090","post","type-post","status-publish","format-standard","hentry","category-misc"],"_links":{"self":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts\/6090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/comments?post=6090"}],"version-history":[{"count":4,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts\/6090\/revisions"}],"predecessor-version":[{"id":6095,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts\/6090\/revisions\/6095"}],"wp:attachment":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/media?parent=6090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/categories?post=6090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/tags?post=6090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}