{"id":14946,"date":"2014-07-09T18:26:48","date_gmt":"2014-07-09T23:26:48","guid":{"rendered":"http:\/\/blog.kenperlin.com\/?p=14946"},"modified":"2014-07-09T18:26:48","modified_gmt":"2014-07-09T23:26:48","slug":"fog","status":"publish","type":"post","link":"http:\/\/blog.kenperlin.com\/?p=14946","title":{"rendered":"Fog"},"content":{"rendered":"<p>A longstanding trick in computer graphics is to add fog to a scene.  Not only does fog help create a sense of atmosphere, but it also helps to avoid needing to render huge scenes, since everything further than a certain distance away becomes invisible.<\/p>\n<p>The math behind fog isn&#8217;t all that complicated, which is why I was surprised yesterday to realize that a scene I was rendering had the fog exactly wrong:  Everything near the camera was obscured by misty white fog, whereas objects far away remained perfectly visible.<\/p>\n<p>It wasn&#8217;t right, but it certainly looked very cool.  I could see entire vistas, mountains, streams and villages, with crystal clarity, going far off into the distance, even as nearby objects remained shrouded in mist.<\/p>\n<p>I pored over my code, trying to understand where I had gone wrong, but couldn&#8217;t seem to find the bug.  I didn&#8217;t actually understand what was going on until later that night, when I woke up in bed, and realized that the entire episode had been a dream.<\/p>\n<p>So it seems that I program when I dream.  I wonder whether that is a good thing.  For all I know, I&#8217;m a better programmer when asleep.<\/p>\n<p>But if last night was any indication, I am lousy at debugging in my dreams.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A longstanding trick in computer graphics is to add fog to a scene. Not only does fog help create a sense of atmosphere, but it also helps to avoid needing to render huge scenes, since everything further than a certain distance away becomes invisible. The math behind fog isn&#8217;t all that complicated, which is why &hellip; <a href=\"http:\/\/blog.kenperlin.com\/?p=14946\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fog&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts\/14946"}],"collection":[{"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14946"}],"version-history":[{"count":1,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts\/14946\/revisions"}],"predecessor-version":[{"id":14947,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts\/14946\/revisions\/14947"}],"wp:attachment":[{"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14946"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}