{"id":6743,"date":"2015-12-17T16:50:45","date_gmt":"2015-12-17T21:50:45","guid":{"rendered":"http:\/\/xplanedev.wpengine.com\/?post_type=article&#038;p=6743"},"modified":"2020-01-06T07:59:44","modified_gmt":"2020-01-06T12:59:44","slug":"normal-maps","status":"publish","type":"article","link":"https:\/\/developer.x-plane.com\/article\/normal-maps\/","title":{"rendered":"Normal Maps"},"content":{"rendered":"<h2><span class=\"mw-headline\">Definitions<\/span><\/h2>\n<p>A normal map is a texture that defines which way light bounces off a surface, on a per-pixel basis. Normal maps encode the direction of light reflections using RGB colors.<\/p>\n<p>A bump map is a texture that defines the height of bumps on a surface, on a per-pixel basis. Bump maps encode the height as a gray-scale image.<\/p>\n<p>X-Plane does not use bump maps; it only uses normal maps. See the Creating Normal Maps section below for information on creating normal maps from bump maps.<\/p>\n<p>A Specular Level Map (or shininess map) is a texture that defines which parts of a surface are shiny, on a per-pixel basis. (Specular maps are similar to ATTR_shiny_rat in their effect.) . Specular levels are a non-PBR X-Plane 10 concept.<\/p>\n<p>A Gloss Map defines which parts of a texture are\u00a0<em>smooth, <\/em>and replace specular level maps in X-Plane 11.<\/p>\n<p>A &#8220;UV&#8221; map is the mapping of texture coordinates onto your model&#8211;that is, it is the shape of how your textures are applied to the mesh. X-Plane supports only one UV map per OBJ &#8211; that UV map is used for all textures: the day time (albedo), night LIT (emissive) and normal map textures.<\/p>\n<h2><span class=\"mw-headline\">Format<\/span><\/h2>\n<p>X-Plane 10 uses combined normal and specular level maps in a single texture. The RGB of the texture are used for the normal map, and the alpha channel is used for the specular level.<\/p>\n<p>X-Plane&#8217;s normal maps are &#8220;tangent space&#8221; normal maps. That means that a &#8220;flat&#8221; (blue) normal map leaves the original surface unperturbed.<\/p>\n<h2><span class=\"mw-headline\">Creating Normal Maps<\/span><\/h2>\n<h3><span class=\"mw-headline\">NormalMappr<\/span><\/h3>\n<p>NormalMappr is a free program for OS X that converts bump-maps to tangent-space normal maps. You open a PNG file, adjust a few parameters, and then save the results. You can apply it to a custom-drawn bump map (drawn in gray-scale using PhotoShop) or simply apply it to your RGB textures.<\/p>\n<p><a class=\"external free\" title=\"http:\/\/shamyl.zakariya.net\/apps\/NormalMappr.zip\" href=\"http:\/\/shamyl.zakariya.net\/apps\/NormalMappr.zip\" rel=\"nofollow\">http:\/\/shamyl.zakariya.net\/apps\/NormalMappr.zip<\/a><\/p>\n<h3><span class=\"mw-headline\">Converting Normal Maps From FS X Aircraft<\/span><\/h3>\n<p>FSX and X-Plane do not use the same normal map format. There are three key differences:<\/p>\n<ul>\n<li>In FS X, the red, green and blue channels have been moved around a bit to reduce texture compression artifacts.<\/li>\n<li>In X-Plane, normal maps should be uncompressed, in PNG files, not compressed in DDS files.<\/li>\n<li>In X-Plane, the alpha channel can optionally be used as a specular map.<\/li>\n<\/ul>\n<p>This <a class=\"external text\" title=\"http:\/\/www.fsdeveloper.com\/wiki\/index.php?title=Normal_map_creation\" href=\"http:\/\/www.fsdeveloper.com\/wiki\/index.php?title=Normal_map_creation\" rel=\"nofollow\">tutorial<\/a> explains how FSX normal maps are created. To use the normal map in X-Plane, you need the original light blue normal map from before the changes (&#8220;saving in FSX format&#8221; are made).<\/p>\n<p>Generally since X-Plane normal maps are uncompressed, you will get higher image quality by going back to the original materials, rather than trying to re-convert the DXT-compressed normal map.<\/p>\n<h2><span class=\"mw-headline\">Using Normal Maps<\/span><\/h2>\n<p>Normal maps may be used in objects. To use a normal map in an object you must include a line<\/p>\n<p>TEXTURE_NORMAL &lt;filename&gt;<\/p>\n<p>Normal maps must be PNGs (not DDS). The normal map does not have to be the same size as the day or lit textures, but it does have to be a power of 2. It should be a 24-bit RGB + 8-bit alpha texture.<\/p>\n<p>In order for the specular level map to work, you must use ATTR_shiny_rat. X-Plane multiplies the shiny_rat and specular level from the normal map, so it is best to use ATTR_shiny_rat 1.0 when using normal maps.<\/p>\n<p>Normal maps can be used in the draped texture of an object or in other art assets as follows:<\/p>\n<p>TEXTURE_NORMAL &lt;ratio&gt; &lt;filename&gt;<\/p>\n<p>Where ratio scales the normal map relative to the UV map of the parent art asset. The intent of this is to allow for high frequency repeating normal maps that add texture at a rate different from a low frequency albedo.<\/p>\n<h2><span class=\"mw-headline\">Warnings and Problems<\/span><\/h2>\n<p>A few special precautions when making normal maps:<\/p>\n<h3><span class=\"mw-headline\">Normals Must Be The Correct Length<\/span><\/h3>\n<p>In a normal map, the RGB colors represent a &#8220;vector&#8221; &#8211; that is, a direction that light bounces off a surface. The vector must be of length 1. In practical terms, this means that the colors must balance in a certain ratio.<\/p>\n<p>If the colors in the RGB channel do not balance to create a &#8220;normalized&#8221; vector, X-Plane&#8217;s lighting will not function correctly. Therefore it is important that you not modify the RGB channel with a paint program; instead use a program designed to create normal maps.<\/p>\n<h3><span class=\"mw-headline\">RGB Behind 0% Alpha<\/span><\/h3>\n<p>When using a normal map, you may have areas with 0% shininess. This is represented by 0% alpha. Some graphic programs (including some versions of GIMP and PhotoShop) will replace the RGB color behind a 0% alpha (transparent) area with white.<\/p>\n<p>From the above comment, the normal vector must be normalized &#8211; since white is not a legal normal map value, these white areas will have strange lighting errors.<\/p>\n<p>Be sure to use a program that can apply an alpha channel without destroying the RGB colors, like Graphics Converter.<\/p>\n<h3><span class=\"mw-headline\">Normal Maps Must Not Be Flipped<\/span><\/h3>\n<p>Normal maps have a &#8220;front&#8221; and a &#8220;back&#8221;. The front must face the viewer. If your UV map flips the normal map horizontally or vertically (flipping both is fine, since this is like a 180 degree rotation) then the normal map will not work correctly.<\/p>\n<p>Basically, if you could put writing into your main texture and the writing would not look mirrored, then your UV map (the way your texture is applied to your object) is fine for normal mapping. If the text looks mirrored, the normal map will be reversed.<\/p>\n<p>(Note: it can be very hard to detect incorrect lighting with a mirrored normal map; I suggest using a temporary texture with writing to confirm that your UV map is okay.)<\/p>\n<h2><span class=\"mw-headline\">Compatibility<\/span><\/h2>\n<ul>\n<li>Normal mapping is available in X-Plane 940 and later.<\/li>\n<li>Normal mapping requires a graphics card with programmable pixel shaders &#8211; that is, a DX9 or later compatible card.<\/li>\n<li>Normal mapping is only visible if the user enables per-pixel lighting.<\/li>\n<li>Normal maps may be ignored at the lowest graphics settings for performance.<\/li>\n<\/ul>\n<h2><span class=\"mw-headline\">Technical<\/span><\/h2>\n<p>X-Plane uses tangent space normal maps with a specular level in the alpha channel:<\/p>\n<pre>r = dx, -1,1 mapped 0.255\r\ng = dy, -1,1 mapped 0.255\r\nb = dz,  0,1 mapped 0.255\r\napplied where dz = N, dx = dS, dy = dT\r\n<\/pre>\n<h2><span class=\"mw-headline\">Further Reference<\/span><\/h2>\n<p><a class=\"external free\" title=\"http:\/\/wiki.blender.org\/index.php\/Doc:Manual\/Textures\/Maps\/Bump_and_Normal_Maps\" href=\"http:\/\/wiki.blender.org\/index.php\/Doc:Manual\/Textures\/Maps\/Bump_and_Normal_Maps\" rel=\"nofollow\">http:\/\/wiki.blender.org\/index.php\/Doc:Manual\/Textures\/Maps\/Bump_and_Normal_Maps<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Normal maps are textures that defines which way light bounces off a surface. This article explains how to create, use, and troubleshoot normal maps.<\/p>\n","protected":false},"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","topic":[95],"article_type":[92],"version":[],"class_list":["post-6743","article","type-article","status-publish","hentry","topic-modeling-3","article_type-reference"],"yoast_head":"<title>Normal Maps - X-Plane Developer<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/developer.x-plane.com\/article\/normal-maps\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Normal Maps - X-Plane Developer\" \/>\n<meta property=\"og:description\" content=\"Normal maps are textures that defines which way light bounces off a surface. This article explains how to create, use, and troubleshoot normal maps.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.x-plane.com\/article\/normal-maps\/\" \/>\n<meta property=\"og:site_name\" content=\"X-Plane Developer\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/XPlaneOfficial\/\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-06T12:59:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2017\/12\/cropped-X.png\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@XPlaneOfficial\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/developer.x-plane.com\/#website\",\"url\":\"https:\/\/developer.x-plane.com\/\",\"name\":\"X-Plane Developer\",\"description\":\"Developer resources for the X-Plane flight simulator\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/developer.x-plane.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/developer.x-plane.com\/article\/normal-maps\/#webpage\",\"url\":\"https:\/\/developer.x-plane.com\/article\/normal-maps\/\",\"name\":\"Normal Maps - X-Plane Developer\",\"isPartOf\":{\"@id\":\"https:\/\/developer.x-plane.com\/#website\"},\"datePublished\":\"2015-12-17T21:50:45+00:00\",\"dateModified\":\"2020-01-06T12:59:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/developer.x-plane.com\/article\/normal-maps\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.x-plane.com\/article\/normal-maps\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.x-plane.com\/article\/normal-maps\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/developer.x-plane.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Normal Maps\"}]}]}<\/script>","yoast_head_json":{"title":"Normal Maps - X-Plane Developer","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/developer.x-plane.com\/article\/normal-maps\/","og_locale":"en_US","og_type":"article","og_title":"Normal Maps - X-Plane Developer","og_description":"Normal maps are textures that defines which way light bounces off a surface. This article explains how to create, use, and troubleshoot normal maps.","og_url":"https:\/\/developer.x-plane.com\/article\/normal-maps\/","og_site_name":"X-Plane Developer","article_publisher":"http:\/\/facebook.com\/XPlaneOfficial\/","article_modified_time":"2020-01-06T12:59:44+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2017\/12\/cropped-X.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@XPlaneOfficial","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/developer.x-plane.com\/#website","url":"https:\/\/developer.x-plane.com\/","name":"X-Plane Developer","description":"Developer resources for the X-Plane flight simulator","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/developer.x-plane.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/developer.x-plane.com\/article\/normal-maps\/#webpage","url":"https:\/\/developer.x-plane.com\/article\/normal-maps\/","name":"Normal Maps - X-Plane Developer","isPartOf":{"@id":"https:\/\/developer.x-plane.com\/#website"},"datePublished":"2015-12-17T21:50:45+00:00","dateModified":"2020-01-06T12:59:44+00:00","breadcrumb":{"@id":"https:\/\/developer.x-plane.com\/article\/normal-maps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.x-plane.com\/article\/normal-maps\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/developer.x-plane.com\/article\/normal-maps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/developer.x-plane.com\/"},{"@type":"ListItem","position":2,"name":"Normal Maps"}]}]}},"_links":{"self":[{"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/article\/6743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/types\/article"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/comments?post=6743"}],"version-history":[{"count":0,"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/article\/6743\/revisions"}],"wp:attachment":[{"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/media?parent=6743"}],"wp:term":[{"taxonomy":"topic","embeddable":true,"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/topic?post=6743"},{"taxonomy":"article_type","embeddable":true,"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/article_type?post=6743"},{"taxonomy":"version","embeddable":true,"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/version?post=6743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}