{"id":1445,"date":"2023-10-31T13:16:03","date_gmt":"2023-10-31T13:16:03","guid":{"rendered":"https:\/\/uneedtalk.com\/config\/tredword\/?page_id=1445"},"modified":"2023-12-01T13:17:18","modified_gmt":"2023-12-01T13:17:18","slug":"7-6-smooth-shading","status":"publish","type":"page","link":"https:\/\/radi-cal.org\/method\/7-6-smooth-shading\/","title":{"rendered":"7.6. Smooth shading"},"content":{"rendered":"<div class=\"row\"  id=\"row-1495116181\">\n<div class=\"col small-12 large-12\"  ><div class=\"col-inner\"  >\n<h2>7.6. Smooth shading<\/h2>\n<p>In order to be able to describe curved surfaces efficiently, a smooth shading feature is implemented in the RadiCal method. In the context of the RadiCal raytracer, the term smooth shading is somewhat misleading, as the surfaces are not actually shaded. However, the term mostly refers to the same principles when used in computer graphics. Technically, smooth shading is an interpolation method for surface normal vectors on curved surfaces. The idea dates back to an algorithm introduced<\/p>\n<\/div><\/div>\n<div class=\"col medium-6 small-12 large-6\"  ><div class=\"col-inner\"  >\n<p>by Henri Gouraud (1971) and is fairly simple: it<br \/>\nassumes that the surface normal vectors on a<br \/>\nsmooth surface change continuously but are explicitly defined at the vertices of the surface mesh only.<br \/>\nLinear interpolation is applied to derive the surface<br \/>\nnormal vector at any point of the given normal vectors of the surrounding vertices. A threshold value<br \/>\nusually determines if smooth shading is applied on<br \/>\na face. It is defined as a maximum angle (dot product of surface normal vectors) that determines if the<br \/>\nface is part of a curved surface or represents an edge<br \/>\nof the object. In the latter case, no smooth shading<br \/>\nis applied.<br \/>\nThe integration into the RadiCal raytracing algorithm is simple, as the implemented collision detection algorithm (see above) already provides barycentric coordinates for the collision point inside a triangular face. Hence, the linearly interpolated surface normal vector \ud835\udc5b\u20d7 \ud835\udc43 at the collision point \ud835\udc43 (see Figure 101) can be found by:<br \/>\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_1325256\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"392\" height=\"130\" src=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/2-3.jpg\" class=\"attachment-large size-large\" alt=\"\" \/>\t\t\t\t\t\t\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style scope=\"scope\">\n\n#image_1325256 {\n  width: 100%;\n}\n<\/style>\n\t<\/div>\n\t\n<p>The smooth shading feature is a simple but essential feature of the RadiCal method. It significantly improves the raytracer&#8217;s performance (or accuracy), as considerably fewer vertices are required to accurately model the reflection of curved surfaces (e.g. the lamellae of shades).<\/p>\n<\/div><\/div>\n<div class=\"col medium-6 small-12 large-6\"  ><div class=\"col-inner text-center\"  >\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_1725139724\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"362\" height=\"346\" src=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/1-2.jpg\" class=\"attachment-original size-original\" alt=\"\" \/>\t\t\t\t\t\t\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style scope=\"scope\">\n\n#image_1725139724 {\n  width: 79%;\n}\n<\/style>\n\t<\/div>\n\t\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_21256383\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"366\" height=\"490\" src=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/3-2.jpg\" class=\"attachment-original size-original\" alt=\"\" srcset=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/3-2.jpg 366w, https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/3-2-299x400.jpg 299w\" sizes=\"(max-width: 366px) 100vw, 366px\" \/>\t\t\t\t\t\t\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style scope=\"scope\">\n\n#image_21256383 {\n  width: 86%;\n}\n<\/style>\n\t<\/div>\n\t\n<\/div><\/div>\n<\/div>\n<style>\n#menu-main li:nth-child(7) .sub-menu{display:block !important;}\n<\/style>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-right-sidebar.php","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/pages\/1445"}],"collection":[{"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/comments?post=1445"}],"version-history":[{"count":16,"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/pages\/1445\/revisions"}],"predecessor-version":[{"id":1982,"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/pages\/1445\/revisions\/1982"}],"wp:attachment":[{"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/media?parent=1445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}