{"id":328,"date":"2009-01-07T10:55:18","date_gmt":"2009-01-07T18:55:18","guid":{"rendered":"http:\/\/www.ludicon.com\/castano\/blog\/?p=328"},"modified":"2019-01-17T23:44:04","modified_gmt":"2019-01-18T07:44:04","slug":"approximate-subdivision-shading","status":"publish","type":"post","link":"https:\/\/www.ludicon.com\/castano\/blog\/2009\/01\/approximate-subdivision-shading\/","title":{"rendered":"Approximate Subdivision Shading"},"content":{"rendered":"<p><a href=\"http:\/\/perso.telecom-paristech.fr\/~boubek\/papers\/SuSh\/\">Subdivision Shading<\/a> is a new approach to compute normal fields of subdivision surfaces that was presented at SIGGRAPH Asia 2008.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2010\/10\/subdivision-shading-small.jpg\" alt=\"Subdivision Shading\" border=\"0\" width=\"313\" height=\"220\" class=\"alignright\"\/><\/p>\n<p>It\u2019s a very simple idea that provides surprisingly good results. The idea is to interpolate the subdivision surface normals using the same procedure used for positions. The resulting normal field is not the actual surface normal, but looks smooth and doesn\u2019t exhibit some of the artifacts characteristic of subdivision surfaces at the extraordinary vertices.<\/p>\n<p>The main disadvantage is that it looks too smooth compared to the real surface normal, but I\u2019m not sure that\u2019s necessarily bad. To avoid that problem the paper suggests blending the surface normals and the interpolated vertex normals so that the interpolated normals are used only in the proximity of extraordinary vertices.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_nosush_pixolator-267x300.png\" alt=\"\" title=\"Pixolator ACC\" width=\"267\" height=\"300\" class=\"alignnone size-medium wp-image-587\" srcset=\"https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_nosush_pixolator-267x300.png 267w, https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_nosush_pixolator-342x384.png 342w, https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_nosush_pixolator.png 847w\" sizes=\"auto, (max-width: 267px) 100vw, 267px\" \/> <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_sush_pixolator-267x300.png\" alt=\"\" title=\"Pixolator ACC SuSh\" width=\"267\" height=\"300\" class=\"alignnone size-medium wp-image-588\" srcset=\"https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_sush_pixolator-267x300.png 267w, https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_sush_pixolator-342x384.png 342w, https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_sush_pixolator.png 847w\" sizes=\"auto, (max-width: 267px) 100vw, 267px\" \/><\/p>\n<p>The same idea can also be applied to the <a href=\"http:\/\/faculty.cs.tamu.edu\/schaefer\/research\/acc.pdf\">Approximate Catmull-Clark Subdivision Surfaces (Bezier ACC)<\/a> proposed by Loop and Schaefer. Instead of constructing the normal from the cross product of the tangent patches, the normal can be interpolated directly using the same approximation used to evaluate positions. The resulting surface has G1 discontinuities around extraordinary vertices in both the geometry and the normal field. However, I haven\u2019t been able to notice any artifact due to that in any of our test models.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_nosush_testmonster-267x201.png\" alt=\"\" title=\"Monster ACC \" width=\"267\" height=\"201\" class=\"alignnone size-medium wp-image-593\" srcset=\"https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_nosush_testmonster-267x201.png 267w, https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_nosush_testmonster-507x384.png 507w, https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_nosush_testmonster.png 1066w\" sizes=\"auto, (max-width: 267px) 100vw, 267px\" \/> <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_sush_testmonster-267x201.png\" alt=\"\" title=\"Monster ACC SuSh\" width=\"267\" height=\"201\" class=\"alignnone size-medium wp-image-594\" srcset=\"https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_sush_testmonster-267x201.png 267w, https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_sush_testmonster-507x384.png 507w, https:\/\/www.ludicon.com\/castano\/blog\/wp-content\/uploads\/2009\/01\/acc_sush_testmonster.png 1066w\" sizes=\"auto, (max-width: 267px) 100vw, 267px\" \/><\/p>\n<p>This approach is quite efficient. It requires the same number of control points as Bezier ACC, but only one half of the stencil weights, because positions and normals are evaluated exactly the same way. The evaluation of the surface normal itself is also more efficient; evaluating a single 4\u00d74 Bezier patch is faster than evaluating two 3\u00d74 Bezier patches and computing a cross product.<\/p>\n<p>However, the nicest thing about this scheme is that it facilitates watertightness when using displacement maps.<\/p>\n<p>At <a href=\"http:\/\/developer.nvidia.com\/object\/gamefest-2008-subdiv.html\">Gamefest 2008<\/a> I mentioned that in order to achieve watertight surfaces when using displacement maps it was necessary to:<\/p>\n<p>a) <a href=\"http:\/\/castano.ludicon.com\/blog\/?p=416\">Sample textures in a watertight way<\/a>.<br \/>\nb) Construct a watertight normal field.<\/p>\n<p>[[acc tangents]] (right aligned)<\/p>\n<p>In order to obtain a watertight normal field, adjacent patches need to compute the normals along their edges consistently.<\/p>\n<p>The approach proposed in the ACC paper produces a smooth and continuous normal field, but the normals at extraordinary vertices and along the edges that surround them are not consistent. Patches around the extraordinary vertices have tangents that lie on the same plane, but their cross product does not yield exactly the same normal.<\/p>\n<p>There are several ways of to solve that problem, but all of them too complicated to cover them in this post. On the other side, the normal interpolation approach does not suffer from that problem and provides a much more simple solution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Subdivision Shading is a new approach to compute normal fields of subdivision surfaces that was presented at SIGGRAPH Asia 2008. It\u2019s a very simple idea that provides surprisingly good results. The idea is to interpolate the subdivision surface normals using the same procedure used for positions. The resulting normal field is not the actual surface&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-328","post","type-post","status-publish","format-standard","hentry","category-coding"],"_links":{"self":[{"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/posts\/328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/comments?post=328"}],"version-history":[{"count":10,"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/posts\/328\/revisions"}],"predecessor-version":[{"id":686,"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/posts\/328\/revisions\/686"}],"wp:attachment":[{"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/media?parent=328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/categories?post=328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludicon.com\/castano\/blog\/wp-json\/wp\/v2\/tags?post=328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}