{"author_name":"namuol","cat":"LD #23","comments":[{"author_name":"Chinchilla","time":"May 11, 2012 7:49 am","epoch":1336740540,"text":"Very, very cool effect!","spam":"N"}],"epoch":1336160460,"likes":2,"metadata":{"p_key":"55846","p_author":"namuol","p_authorkey":"12236","p_urlkey":"91564","p_title":"Fake Atmosphere","p_cat":"LD #23","p_event":"LD23","p_time":"1336160460","p_likes":"2","p_comments":"1","p_status":"UPD5","us_key":"12236","us_name":"namuol","us_username":"namuol","event_start":"1334880000","event_key":"10","event_name":"LD23"},"text":"<p>(This is a <a href='http:\/\/muniverse-game.tumblr.com\/post\/22401936993\/fake-atmosphere' target='_blank'>cross-post<\/a> from my post-compo <a href=\"http:\/\/muniverse-game.tumblr.com\/\" target='_blank'>devlog<\/a>.)<\/p>\n <p>I&#8217;ve been playing around with different ways to fake the atmosphere of a planet in a 2D canvas context.<\/p>\n <p><a href='http:\/\/jsfiddle.net\/namuol\/wzHhR\/' target=\"_blank\"><img src='http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2012\/05\/atmos1.jpg'><\/img><\/a><\/p>\n <p>That&#8217;s interactive, by the way, so mess around with it (Chrome\/Chromium is recommended!). Clicking on\/around the planet changes the &#8220;angle&#8221; of light. You can get some pretty nifty looking results. I made this to determine what were reasonable parameter-ranges to use to generate plausible-looking planets.<\/p>\n <p>The way I get the sort of &#8220;volumetric&#8221; look for the atmosphere is really simple: I just stack many semi-opaque layers of the same gradient-filled-circle over the planet, each one having a radius slightly bigger than the previous.<\/p>\n <p>I actually threw this together using with a JSFiddle which you can view\/hack <a href=\"http:\/\/jsfiddle.net\/namuol\/wzHhR\/\">here<\/a>.<\/p>\n <p>Of course, I still need to figure out how to combine this with a surface\/cloud texture (procedurally generated or otherwise&#8230;).<\/p>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/canvas\/\" rel=\"tag\">canvas<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/html5\/\" rel=\"tag\">html5<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/javascript\/\" rel=\"tag\">javascript<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/muniverse\/\" rel=\"tag\">muniverse<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/procedural-generation\/\" rel=\"tag\">procedural generation<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/space\/\" rel=\"tag\">space<\/a><\/p>","time":"May 4th, 2012 2:41 pm","title":"Fake Atmosphere"}