Archive for September, 2008

Skyboxes and Starfields

By implementing a simple skybox and generating starfield textures at runtime, it’s possible to produce some nice looking space backdrops.  This is just a simple way of producing backgrounds so I don’t have to look at cornflowerblue all the time.

This really is just a quick update.  I began to get fed up of the cornflower blue default colour of XNA in some of the earlier screenshots of Britonia, so I decided to create basic skyboxes.

I have taken a very simple approach to this, with the hope that I’ll be able to improve it in the future should the need arise.  The stars and the sky will play a huge part of Britonia when it is finished (i.e. I believe the atmosphere of the game at night can be hugely influenced by the sky; whether it be completly dark, very bright and star filled or even create a fantasy feel with huge green nebulae clouds close to the planet), and so there is a need to generate good quality sky textures.

I decided the fastest way to achieve this would be to just create a skybox (there are many good tutorials for this, including this one here from Ziggyware), and create random textures at runtime using point spirts.

For the texture I setup a rendertarget, and render  a set amount of small star textures to the rendertarget.  This doesn’t produce the best possible results as you can imagine, but it will certainly suffice for the next few months until I get time to improve it.  Because of the simplicity of this, I will not include any source, but if someone does need help with this, just leave a comment and I’ll add some.


Leave a comment