Ben's blog
Software development, games, and all that jazz
Home
Archive
Posts
Pages
Search:
Edit Post
Title:
Body:
<p>I found a little time over the past couple of days to have a fiddle with Cities in the Sky, but since I'm an idiot I didn't concentrate on sorting out the physics. Instead, I farted around with Perlin noise and atmospheric scattering and made the sky beautiful :). Take a look at the new screenshots and see for yourself. The second one has a stupidly powerful bloom effect, which frankly looks a bit rubbish, so I'm going to either turn it off or tone it down a lot. Hopefully I can figure out how to 'do' shaders - I basically just took the code from the OGRE wiki!</p> <p><a href="http://www.flickr.com/photos/38367409@N02/3538787562/" title="2007-03-28 by b.hymers, on Flickr"><img src="http://farm3.static.flickr.com/2213/3538787562_419f546973.jpg" width="500" height="375" alt="2007-03-28" /></a></p> <p>Some technical details, since I know some of you like that sort of thing:</p> <p>The clouds are generated using <a href="http://libnoise.sourceforge.net">libnoise</a>, a rather wonderful library capable of generating perlin noise and doing all sorts of clever things with it. I have to say, it's an excellently written library, every bit as easy and intuitive to use as OPAL. At the moment, the clouds are generated in another little application that I wrote, and loaded in when CITS starts, rather than generated on the fly. This is because at the resolution I'm generating them (1024x1024), the whole process takes around 10 seconds, and also because libnoise does something odd with the alpha channel (Most of my time recently has been spent scratching my head whilst looking at black skies). I've used a few filters on the raw perlin - namely terracing and a power function. I was using <a href="http://freespace.virgin.net/hugo.elias/models/m_clouds.htm">this handy article</a> on clouds as a guide, I highly recommend it if you need to generate clouds or are procrastinating.</p> <p><a href="http://www.flickr.com/photos/38367409@N02/3538787718/" title="2007-03-28b by b.hymers, on Flickr"><img src="http://farm4.static.flickr.com/3602/3538787718_9e3c4f985a.jpg" width="500" height="375" alt="2007-03-28b" /></a></p> <p>Unfortunately, as you may have noticed from the screenshots, the noise isn't tiled yet, resulting in odd seams in the sky. I may need to fiddle around with the source of libnoise to get it to tile the noise, or I may just partake in some Photoshop trickery, though that would rule out generating the clouds in the application completely.</p> <p>As for the rest of the sky, I simply used <a href="http://www.planetside.co.uk/terragen/">Terragen</a> to render an environment without clouds or a landscape, and fiddled the atmosphere settings slightly to get a nice haze, horizon and glare from the sun. Maybe I'll add in some lens flare soon to show off, if it doesn't look too cheesy. Again there's an annoying drawback though - since Terragen expects you to be rendering a landscape, it doesn't bother to generate sky below you, so there's an oddly shaped black space below the camera. This will be fixed by more Photoshop jiggery-pokery when I get round to it.</p> <p>Enough about the sky though - Remember when I told you I didn't bother to fix the physics, all those paragraphs ago? Well, that was a bit of a fib. Actually I've tweaked them to the point where it looks quite nice and doesn't explode (even Tim says it's looking swish), though there's still a little way to go before I'm ready to upload a video. Also, I need to stop the random crashes, else the video will be quite short. Still, it's getting there... slowly.</p>
Tags:
cities-in-the-sky
Body markup:
Plain Text
Textile
HTML
Markdown
ReStructuredText
Draft: