Week 21 Project (Procedural Generation Solar System Screensaver)
I built this little solar system demo for a friend of mine at work. It contains around 800 bodies orbiting a binary star system (with rather unrealistic planet sizes and orbits). There's no real physics in this program, though you can speed up or slow down the simple simulation at run-time. The planet textures are randomly generated using Perlin Noise at startup-time. There's a random assortment of "gas planets" and terrestrial ones (which use two different kinds of Perlin Noise to generate their surface textures), and also some larger planets can have small moons orbiting them. The background starfield cubemap is also procedurally-generated at startup-time. All of this means that you never get the same solar system setup twice, and the entirety of the program fits into just under 32KB!
Two big framerate improvements for this project were to implement a simple LoD system (visualized in the video) to render further-away bodies using lower-polygon meshes, and also sorting by render-pass helped a bunch too. Instancing in this particular project would have been difficult in D3D9 because of the large number of unique textures used in the program. Plus, at the end of the day, 800 objects doesn't turn into a crazy large number of draw calls that stress the CPU too hard.
I think it looks really neat when a planet passes in front of the stars and you can see one side of the planet light up blue and the other side light up yellow :)
Video Length: 04:31
Uploaded By: TomCodes
View Count: 50