🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Starfield Skybox Generator

posted in MJP's Last Stand
Published December 16, 2007
Advertisement
Having never really found a decent starfield skybox texture or a program capable of generating one, I decided to make my own. It seemed like a fun project and a good opportunity to finally make use of DXUT (which I've found to be very useful), and it was definitely both of those things. The end result is very very simple, all it does is randomly generate coordinates of stars on the surface of a sphere and then draws the stars as textured quads (using code borrowed from the particle engine of my renderer). The stars are all drawn to the six faces of a cubemap, which is then viewed in rotated in the window. Generation is very fast, so you can change the parameters and view the results in real-time. Later I added in the ability to throw in "Space Objects", which are larger planets and galaxies. These are also drawn as textured quads.

Main drawbacks are:
-Since its using a cubemap and a skybox, things get pretty ugly at the edges of cube faces. I may consider looking into some method of sphere-mapping, although from what I understand there can be some resolution issues with those.

-The app is capable of creating an HDR cubemap, but I have no HDR source textures for stars or planets.

Anyway its not too bad for a day's work, and it will be useful if I ever actually make a simple game with my renderer. Here's a screenshot and the source code (uses DXUT and boost libraries):

Free Image Hosting at www.ImageShack.us

http://members.gamedev.net/MJP/Starbox_DX9.zip

1 likes 1 comments

Comments

cNoob
Hey, not bad at all Matt. I'll be sure to check out the code tommorow.
Keep it coming =]

Merry XMas...
December 26, 2007 06:27 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement