{"id":12821,"date":"2013-08-12T20:43:47","date_gmt":"2013-08-13T01:43:47","guid":{"rendered":"http:\/\/blog.kenperlin.com\/?p=12821"},"modified":"2013-08-12T20:43:47","modified_gmt":"2013-08-13T01:43:47","slug":"dragon-planet","status":"publish","type":"post","link":"http:\/\/blog.kenperlin.com\/?p=12821","title":{"rendered":"Dragon planet"},"content":{"rendered":"<p>Inspired by the shiny new toy of WebGL, I tried my hand last night and this morning at making a procedural object.  As in my very earliest experiments with procedural texturing, I&#8217;m  not bothering with things like geometry and polygons.  Instead, the entire scene at any pixel is defined by a function that takes only three arguments: (1) the pixel&#8217;s horizontal position in the image, (2) the pixel&#8217;s vertical position in the image, and (3) the clock time at this animation frame.<\/p>\n<p>So I&#8217;m going way back to my original crazy idea that started this whole shader business in the first place: go ahead and run an entire computer program at every pixel of an image.<\/p>\n<p>Except that now, thanks to graphics processing units (GPUs), everything runs a few million times faster than it did when I first tried this stuff.<sup>**<\/sup><\/p>\n<p>Taking a cue from yesterday&#8217;s post, I decided to make a &#8220;Dragon planet&#8221;.  It&#8217;s kind of a fantasy answer to the question &#8220;What would a planet be like if it were like a dragon?&#8221;  I imagine such a planet would be angry.  It would breath fire, but otherwise be mysterious and dark with hidden depths.  And it would probably be green (the most common color for dragons).<\/p>\n<p>If you load the page you&#8217;re reading in Google Chrome (WebGL won&#8217;t work in Safari, and your version of Firefox may not support WebGL), then you can click on the link below:<\/p>\n<p><center><br \/>\n<a href=http:\/\/mrl.nyu.edu\/~perlin\/DragonPlanet target=1><img decoding=\"async\" src=\"http:\/\/blog.kenperlin.com\/wp-content\/uploads\/2013\/08\/dragonplanet.png\"><\/a><br \/>\n<\/center><\/p>\n<p>&nbsp;<br \/>When the page comes up in Google Chrome, you will see, on the left, the program that&#8217;s running on your GPU.  That&#8217;s all the code needed to create the real-time animated planet, other than a few dozen lines of code that implement my noise  and turbulence functions.<\/p>\n<p>Now we just need to make some creatures to live on the Dragon planet.  Space dragons!<\/p>\n<p>** <i>Thanks to Kris Schlachter, who helped me get started with WebGL!<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Inspired by the shiny new toy of WebGL, I tried my hand last night and this morning at making a procedural object. As in my very earliest experiments with procedural texturing, I&#8217;m not bothering with things like geometry and polygons. Instead, the entire scene at any pixel is defined by a function that takes only &hellip; <a href=\"http:\/\/blog.kenperlin.com\/?p=12821\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Dragon planet&#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\/12821"}],"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=12821"}],"version-history":[{"count":19,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts\/12821\/revisions"}],"predecessor-version":[{"id":12841,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts\/12821\/revisions\/12841"}],"wp:attachment":[{"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12821"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}