{"id":4378,"date":"2012-11-09T14:04:39","date_gmt":"2012-11-09T19:04:39","guid":{"rendered":"https:\/\/spaceengine.org\/?p=4378"},"modified":"2022-08-17T14:11:34","modified_gmt":"2022-08-17T19:11:34","slug":"color-banding-artifact-fix","status":"publish","type":"post","link":"https:\/\/spaceengine.org\/news\/blog121109\/","title":{"rendered":"Color banding artifact fix"},"content":{"rendered":"<p>Fixed color banding artifact on landscape and especially on the water. Normal-and-height textures now store more precise height and less precise normals, but changes in lighting is not noticeable. Texture format now is:<\/p>\n<p>R - normal X<br \/>\nG - normal Y<br \/>\nB - height low byte<br \/>\nA - height high byte<\/p>\n<p>Normal Z component is reconstructed on-the-fly from the XY components by simple formula: Z = sqrt(1.0 - X*X - Y*Y) (keep in mind that normal vectors are always have the unit length, and facing up, so we don't need sign). Using sqrt() function in the fragment shader on modern hardware doesn't affect the performance.<\/p>\n<p>Height now have 16 bit precision, it calculated from two bytes very simply: h = B + A \/ 256. Having 16-bit height precision in the fragment shader fixes many artifacts, the most noticeable of which is a color banding on the shallow water.<\/p>\n\n\t\t\t\n\t<style type=\"text\/css\">\n\t\t.slider-info-4379.bafg-slider-info .bafg-slider-title {\n\t\t\t\t\t\t\tfont-size:\n\t\t\t\t\t22px\t\t\t\t;\n\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t.slider-info-4379.bafg-slider-info .bafg-slider-description {\n\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\t\t\n\t\t\n\t\t.slider-info-4379.bafg-slider-info .bafg_slider_readmore_button {\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\ttext-align: center;\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t.slider-info-4379.bafg-slider-info .bafg_slider_readmore_button:hover {\n\n\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\t<\/style>\n\t\n\t\t\t<div class=\"bafg-twentytwenty-container slider-4379  \"\n\t\t\t\tbafg-orientation=\"horizontal\" bafg-default-offset=\"0.5\"\n\t\t\t\tbafg-before-label=\"Before\"\n\t\t\t\tbafg-after-label=\"After\" bafg-overlay=\"1\"\n\t\t\t\tbafg-move-slider-on-hover=\"\"\n\t\t\t\tbafg-click-to-move=\"\">\n\n\t\t\t\t\t\t\t\t<img class=\"skip-lazy\" data-skip-lazy\t\t\t\t\tsrc=\"https:\/\/spaceengine.org\/wp-content\/uploads\/2022\/08\/3919402.jpg\" alt=\"\">\n\t\t\t\t<img class=\"skip-lazy\" data-skip-lazy\t\t\t\t\tsrc=\"https:\/\/spaceengine.org\/wp-content\/uploads\/2022\/08\/4032362.jpg\" alt=\"\">\n\n\t\t\t<\/div>\n\n\t\t\t\t<div class=\"bafg-slider-info-wraper\">\n\t\t<div style=\"\" class=\"slider-info-4379 bafg-slider-info\">\n\t\t\t\t\t<\/div>\n\t<\/div>\n\t\n\t\t\t<style type=\"text\/css\">\n\t\t\t\t\t\t\t\t\t\t\t<\/style>\n\t\t\t\n<p>The banding on mountains was less noticeable (look at the green areas), but now it is fixed completely:<\/p>\n\n\t\t\t\n\t<style type=\"text\/css\">\n\t\t.slider-info-4384.bafg-slider-info .bafg-slider-title {\n\t\t\t\t\t\t\tfont-size:\n\t\t\t\t\t22px\t\t\t\t;\n\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t.slider-info-4384.bafg-slider-info .bafg-slider-description {\n\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\t\t\n\t\t\n\t\t.slider-info-4384.bafg-slider-info .bafg_slider_readmore_button {\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\ttext-align: center;\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t.slider-info-4384.bafg-slider-info .bafg_slider_readmore_button:hover {\n\n\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\t<\/style>\n\t\n\t\t\t<div class=\"bafg-twentytwenty-container slider-4384  \"\n\t\t\t\tbafg-orientation=\"horizontal\" bafg-default-offset=\"0.5\"\n\t\t\t\tbafg-before-label=\"Before\"\n\t\t\t\tbafg-after-label=\"After\" bafg-overlay=\"1\"\n\t\t\t\tbafg-move-slider-on-hover=\"\"\n\t\t\t\tbafg-click-to-move=\"\">\n\n\t\t\t\t\t\t\t\t<img class=\"skip-lazy\" data-skip-lazy\t\t\t\t\tsrc=\"https:\/\/spaceengine.org\/wp-content\/uploads\/2022\/08\/6366450.jpg\" alt=\"\">\n\t\t\t\t<img class=\"skip-lazy\" data-skip-lazy\t\t\t\t\tsrc=\"https:\/\/spaceengine.org\/wp-content\/uploads\/2022\/08\/8596718.jpg\" alt=\"\">\n\n\t\t\t<\/div>\n\n\t\t\t\t<div class=\"bafg-slider-info-wraper\">\n\t\t<div style=\"\" class=\"slider-info-4384 bafg-slider-info\">\n\t\t\t\t\t<\/div>\n\t<\/div>\n\t\n\t\t\t<style type=\"text\/css\">\n\t\t\t\t\t\t\t\t\t\t\t<\/style>\n\t\t\t\n","protected":false},"excerpt":{"rendered":"<p>Fixed color banding artifact on landscape and especially on the water. Normal-and-height textures now store more precise height and less precise normals, but changes in lighting is not noticeable. Texture format now is: R - normal X G - normal Y B - height low...<\/p>\n","protected":false},"author":1,"featured_media":4382,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4378","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/posts\/4378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/comments?post=4378"}],"version-history":[{"count":1,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/posts\/4378\/revisions"}],"predecessor-version":[{"id":4385,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/posts\/4378\/revisions\/4385"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/media\/4382"}],"wp:attachment":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/media?parent=4378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/categories?post=4378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/tags?post=4378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}