{"id":40935,"date":"2024-07-17T16:54:03","date_gmt":"2024-07-17T21:54:03","guid":{"rendered":"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/"},"modified":"2024-07-18T12:20:45","modified_gmt":"2024-07-18T17:20:45","slug":"windshield-ice-effects","status":"publish","type":"article","link":"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/","title":{"rendered":"Windshield Ice Effects"},"content":{"rendered":"<p>X-Plane 12 can simulate both ice accumulation and window de-ice effects as well as rain drop\/wiper visual effects on aircraft window surfaces. This article explains how to implement <strong>icing visual effects<\/strong> only.  Rain effects are discussed in its own dedicated article, \u201c<a href=\"https:\/\/developer.x-plane.com\/article\/windshield-rain-effects\/\">Windshield Rain Effects<\/a>\u201d.  This article assumes you are familiar with:  <\/p>\n<ul>\n<li>X-Plane 3D objects (*.OBJ files )<\/li>\n<li>UV layouts<\/li>\n<li>RGBA image channels<\/li>\n<li><a href=\"https:\/\/github.com\/X-Plane\/XPlane2Blender\">xplane2blender <\/a>\/ UI locations<\/li>\n<\/ul>\n<blockquote>\n<p>\ud83d\udca1 NOTE:  X-Plane 12.1+ introduces significant changes to the windshield ice and heat simulation from previous versions, which had many problems.  Any RainGlass OBJs previously configured with <em><strong>THERMAL sources<\/strong><\/em>, and exporting from XP2B V4.3+ using an export target version prior to 12.1 will NOT have window heat functionality.  The exporting of the legacy <code>THERMAL_source<\/code> directive have been removed for all XP version options prior to 12.1.   <\/p>\n<p>If you have exported out RainGlass OBJs with XP2B 4.3+ to support XP targets &lt; 12.1, yet still desire to use the legacy <code>THERMAL_source<\/code> directive, then you will need to manually edit the OBJ and enter the directive and its parameters by hand.  This directive and parameters are described further below for reference.<\/p>\n<\/blockquote>\n<h2 id=\"enabling-ice-effects\">Enabling Ice Effects<\/h2>\n<p>Ice effects are automatically included on any window OBJs configured for Rain Effects. See the <a href=\"https:\/\/developer.x-plane.com\/article\/windshield-rain-effects\/\">Rain Effects document<\/a> for more info if you haven\u2019t set up your RainGlass OBJs yet.  When the conditions warrant, and in the absence of any window heat, the window will begin icing over uniformly at a rate dependent upon the conditions.  X-Plane\u2019s icing algorithm considers temperature, moisture, airflow and heating when calculating ice accumulation on RainGlass OBJs.  <\/p>\n<h2 id=\"icing-inspector-tool\">Icing Inspector Tool<\/h2>\n<p>The same tool that is used to debug \/ inspect Rain Effects is also used to debug \/ inspect icing effects, so you don\u2019t have to configure X-Plane\u2019s weather to test your work. The image below shows the sequence for use.  <\/p>\n<blockquote>\n<p>\ud83d\udca1 NOTE: For the \u201cIcing Rate\u201d slider.  The middle position is 0 (red circle below).  The right side of the slider adds ice and the left side of the slider will remove ice.  If you are wanting to test your thermal texture deicing effects quickly, you will probably want to move the slider to the right to add ice, and then return it to the middle zero position and then activate the window de-ice system to observe the effects of your thermal gradient texture.<\/p>\n<\/blockquote>\n<p><figure><img decoding=\"async\" src=\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/ice_inspector.jpg\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<h2 id=\"thermal-sources-gradient-texture\">Thermal Sources Gradient Texture<\/h2>\n<p>In reality, windshields are typically deiced using either resistance (electrical) heating elements, or by using hot air blowers.  Both of these are examples of <em><strong>thermal sources.<\/strong><\/em>  Thermal sources typically apply heat to specific areas of the windshield glass and the heat radiates out from that area across the windshield.  This causes the ice to melt in a progressive pattern, melting nearest the heat source first and progressing from there. X-Plane models the progression of this heat flow via a 8-bit RGBA \u201c<em><strong>thermal texture<\/strong><\/em>\u201d<em><strong>,<\/strong><\/em> UV mapped to your RainGlass OBJ and using color gradients across the UV islands of the windows to model the movement of the heat.<\/p>\n<p>X-Plane uses the four channels of the thermal texture to simulate up to four independent thermal sources. Most aircraft typically have only one or two thermal sources.<\/p>\n<p>The image below shows an example texture where a fully saturated color pixel, i.e. 100% Red, Geen, Blue or Alpha(white) represents maximum heat flux and a fully black pixel represents zero heat flux.  Note in the example below that there are no fully black pixels on the window glass because if there were, the window heat would not melt ice in these locations.<\/p>\n<p>The gradient texture is quite straightforward, typically painted by hand using gradient tools in graphic apps like Photoshop or GIMP. Remember that a fully black alpha channel (when thermal source [3] is not used), will make your image transparent.<\/p>\n<p><figure><img decoding=\"async\" src=\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/thermal_example.jpg\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<p>The image above illustrates how the thermal sources for the main windshields (Red and Green), are at the top and bottom of the windshields, and ice melts there first and then the heat moves towards the center of the window.  In X-Plane the effect looks like so.  For a hot-air blower fan configuration, you may have a radial type of gradient pattern, etc.<\/p>\n<p><figure><img decoding=\"async\" src=\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/window_ice.png\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<blockquote>\n<p>\ud83d\udca1 TIP:  Use a lower resolution THERMAL_texture to achieve better and more realistic looking heat propogation behaviours.<\/p>\n<\/blockquote>\n<h2 id=\"xplane2blender-settings\">XPlane2Blender Settings<\/h2>\n<p>The XP2B settings for the thermal sources for window heat are found on Blender\u2019s Scene tab in the collection settings (see image below).  To configure your window heat, you enter the path to your thermal sources texture, presumably in the objects folder somewhere, and you enable however many thermal sources you need, up to 4 total.<\/p>\n<p>For each thermal source you enable, you enter the <em><strong>Defrost time<\/strong><\/em>, in seconds.  This field can be a fixed number or a dataref.  This time represents how long, in seconds, a thermal source takes to fully deice a fully iced over window, assuming no ongoing ice accumulation.  A shorter time represents more heating power.   If you use a dataref, then you can alter this value at run time to simulate adjustable heating levels. <\/p>\n<p>Next you enter the <em><strong>Thermal ON\/OFF dataref<\/strong><\/em>.  These datarefs, when 0, disable the window heat and when non-zero (usually 1), enable the window-heat.  X-Plane have default datarefs for turning the window-heat ON\/OFF for each source, which are listed further below. <\/p>\n<p><figure><img decoding=\"async\" src=\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/blender_settings.jpg\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<p>The thermal settings in Blender will be exported to the OBJ GLOBAL settings in the form of two directives in the OBJ header section:  one entry for the thermal texture file\/path and one entry for each thermal source configured in Blender.<\/p>\n<pre>THERMAL_texture    path\/to\/texture\/thermal_texture.pn;\nTHERMAL_source2   &lt;index&gt;    &lt;rate_seconds or rate dataref&gt;   &lt;on\/off dataref&gt;\n<\/pre>\n<p>The exported windshield heat thermal parameters for the default B738, which uses four sources are shown below. Note that the ON\/OFF datarefs are X-Plane\u2019s status datarefs and not the window heat actuator\/switch datarefs.  The status datarefs take into account any system failures.  You don\u2019t want your window heat effects to be ON if the system is failed.<\/p>\n<p><figure><img decoding=\"async\" src=\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/thermal_obj.png\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<h2 id=\"power-consumption\">Power Consumption<\/h2>\n<p>You can configure the power consumption of each thermal source via PlaneMakers\u2019s <em><strong>Standard Menu &gt; Systems &gt; Bus Loads Tab<\/strong><\/em> (the first one).  When the status datarefs are 1, then X-Plane will add a current load to your electrical buses.  These are fixed electrical loads only.<\/p>\n<p>If you need to simulate a variable power window heat system and want to vary the power consumption of the thermal sources, then you will have to do so via plugin, adjusting your defrost time via dataref, calculating your power consumption and adding the load to a bus via <code>sim\/cockpit2\/electrical\/plugin_bus_load_amps[n]<\/code><\/p>\n<p><figure><img decoding=\"async\" src=\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/pm_deice_power.png\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<h2 id=\"icing-commands-and-datarefs\">Icing Commands and Datarefs<\/h2>\n<p>The following datarefs and commands are used with the Window heat \/ icing system.<\/p>\n<pre>        \/\/  Actuator Datarefs (switch, button, whatever) \n        sim\/cockpit\/switches\/anti_ice_window_heat       \/\/ switch, 1st window\n        sim\/cockpit2\/ice\/ice_window_heat_on_window[N]   \/\/ switch, where N = 0-3\t\t\n        \n        \/\/ Actuator Commands\n        sim\/ice\/window_heat_on                          \/\/ 1st window\n        sim\/ice\/window_heat_off                         \n        sim\/ice\/window_heat_toggle                      \n        \n        sim\/ice\/window2_heat_on                         \/\/ 2nd window\n        sim\/ice\/window2_heat_off\n        sim\/ice\/window2_heat_toggle\n        \n        sim\/ice\/window3_heat_on                         \/\/ 3rd window\n        sim\/ice\/window3_heat_off\n        sim\/ice\/window3_heat_toggle\n        \n        sim\/ice\/window4_heat_on                         \/\/ 4th window\n        sim\/ice\/window4_heat_off\n        sim\/ice\/window5_heat_toggle\n\n        \/\/  Status Datarefs.  Takes into account failures. e.g. can drive annuns\n        sim\/cockpit2\/ice\/ice_window_heat_on             \/\/ status, 1 window only\n        sim\/cockpit2\/ice\/ice_window_heat_running[N]     \/\/ status\n        \n        \/\/  Failure State Datarefs\n        sim\/operation\/failures\/rel_ice_window_heat\n        sim\/operation\/failures\/rel_ice_window_heat_cop\n        sim\/operation\/failures\/rel_ice_window_heat_l_side\n        sim\/operation\/failures\/rel_ice_window_heat_r_side\n<\/pre>\n<h2 id=\"legacy-icing\">Legacy Icing<\/h2>\n<p>It\u2019s highly recommended to use the <code>THERMAL_source2<\/code> directive with X-Plane 12.1.0 for any new aircraft development. The legacy <code>THERMAL_source<\/code> command still works in X-Plane 12.1.0, but the visual icing effects have inconsistencies with the X-Plane systems model with regards to how much ice X-Plane tracks on the windshield versus how much is visually rendered.<\/p>\n<p>The syntax for the legacy <code>THERMAL_source<\/code> command is:<\/p>\n<p> <code>THERMAL_source     &lt;heat in \u00baC dataref&gt;     &lt;on\/off dataref&gt;<\/code> <\/p>\n<p>\u2026where the <code>&lt;heat in \u00baC dataref&gt;<\/code> is clamped between 5\u00ba and 20\u00ba C and then gets interpolated into a rate between 5 and 20 seconds.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>This article explains how to enable and tune icing visual effects on aircraft windshields.<\/p>\n","protected":false},"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","topic":[84],"article_type":[93],"version":[144],"class_list":["post-40935","article","type-article","status-publish","hentry","topic-aircraft-3","article_type-guide","version-x-plane-12-1"],"yoast_head":"<title>Windshield Ice Effects - 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\/windshield-ice-effects\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Windshield Ice Effects - X-Plane Developer\" \/>\n<meta property=\"og:description\" content=\"This article explains how to enable and tune icing visual effects on aircraft windshields.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/\" \/>\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=\"2024-07-18T17:20:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/ice_inspector.jpg\" \/>\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=\"7 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\":\"ImageObject\",\"@id\":\"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/ice_inspector.jpg\",\"contentUrl\":\"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/ice_inspector.jpg\",\"width\":800,\"height\":743},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#webpage\",\"url\":\"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/\",\"name\":\"Windshield Ice Effects - X-Plane Developer\",\"isPartOf\":{\"@id\":\"https:\/\/developer.x-plane.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#primaryimage\"},\"datePublished\":\"2024-07-17T21:54:03+00:00\",\"dateModified\":\"2024-07-18T17:20:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/developer.x-plane.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Windshield Ice Effects\"}]}]}<\/script>","yoast_head_json":{"title":"Windshield Ice Effects - 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\/windshield-ice-effects\/","og_locale":"en_US","og_type":"article","og_title":"Windshield Ice Effects - X-Plane Developer","og_description":"This article explains how to enable and tune icing visual effects on aircraft windshields.","og_url":"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/","og_site_name":"X-Plane Developer","article_publisher":"http:\/\/facebook.com\/XPlaneOfficial\/","article_modified_time":"2024-07-18T17:20:45+00:00","og_image":[{"url":"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/ice_inspector.jpg"}],"twitter_card":"summary_large_image","twitter_site":"@XPlaneOfficial","twitter_misc":{"Est. reading time":"7 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":"ImageObject","@id":"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#primaryimage","inLanguage":"en-US","url":"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/ice_inspector.jpg","contentUrl":"https:\/\/developer.x-plane.com\/wp-content\/uploads\/2024\/07\/ice_inspector.jpg","width":800,"height":743},{"@type":"WebPage","@id":"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#webpage","url":"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/","name":"Windshield Ice Effects - X-Plane Developer","isPartOf":{"@id":"https:\/\/developer.x-plane.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#primaryimage"},"datePublished":"2024-07-17T21:54:03+00:00","dateModified":"2024-07-18T17:20:45+00:00","breadcrumb":{"@id":"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/developer.x-plane.com\/article\/windshield-ice-effects\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/developer.x-plane.com\/"},{"@type":"ListItem","position":2,"name":"Windshield Ice Effects"}]}]}},"_links":{"self":[{"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/article\/40935","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=40935"}],"version-history":[{"count":0,"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/article\/40935\/revisions"}],"wp:attachment":[{"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/media?parent=40935"}],"wp:term":[{"taxonomy":"topic","embeddable":true,"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/topic?post=40935"},{"taxonomy":"article_type","embeddable":true,"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/article_type?post=40935"},{"taxonomy":"version","embeddable":true,"href":"https:\/\/developer.x-plane.com\/wp-json\/wp\/v2\/version?post=40935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}