<\/a>Got annoyed today, and finally went searching to find the cause of the weird lighting glitch on these gazebo objects. \u00a0You’ve seen this problem right from the beginning when these things were simple square-shapes, where part of the roof of one of these objects would have a weird hard edge, as you can see in the image on the left.<\/p>\nBasically what I’m doing here is figuring out which direction the surface is facing for each point on the model. \u00a0On some bits of the model (such as the cylinders at the bottoms of the columns), the lighting is smooth across the whole shape. \u00a0In other places on the model, there are a hard edges, or “creases” in the surface. \u00a0The general approach is to look at every edge in the model and figure out how sharp a bend is occurring across it. \u00a0By default, everything is creased. \u00a0But if the bend over a vertex is shallow enough, then I \u00a0remove the “crease”, and make the surface smooth.<\/p>\n
As you can see here in the roof of this object, there’s a crease between the outer face of the gear-shaped roof, and the faces which connect them to the inner portion of the shape. \u00a0The problem was that here we had two different basic smooth shapes being constructed; \u00a0the wall of the roof, and the curving top part of the roof. \u00a0At the bottom part of the roof, these two bits are different enough to cause a sharp crease between them. \u00a0However, as we move up the roof, the difference between these two shapes lessens, and many vertices could legally be “uncreased” and merged into either one of those two shapes; \u00a0the side or the top of the roof. \u00a0What was happening before was that when it found a vertex that could be assigned to either, it would pick one or the other more or less at random.<\/p>\n
My fix has been to change it to instead figure out which shapes a vertex can be merged onto, and then pick the best one, instead of picking one at random. \u00a0With only a little bit of work to explain to the system how I define “the best one”, it seems to have made a big improvement!<\/p>\n","protected":false},"excerpt":{"rendered":"
Got annoyed today, and finally went searching to find the cause of the weird lighting glitch on these gazebo objects. \u00a0You’ve seen this problem right from the beginning when these things were simple square-shapes, where part of the roof of one of these objects would have a weird hard edge, as you can see in…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-i0","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/1116"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=1116"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/1116\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=1116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=1116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=1116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}