Thursday, April 9, 2009

Spore's galaxy

Spore needed a great, spinning galaxy as it's final zoom. The thing that you'd see when you'd pulled all the way out. I wanted it to feel real, and vast, and volumetric.

At first I tried creating it using nothing but particles. Andrew Willmott's Swarm system let me paint control maps placing particles in the galactic arms.
This kind of worked, but wound up feeling too wispy and puffy and diffuse. We couldn't afford anywhere near enough particles to make it feel dense and detailed.

(click to enlarge)

So I built some geometry to delineate the arms, interleaving glowing bright areas with dark, opaque dustlanes. Lydia Choy wrote a shader that made the polygons transparent as you looked at them edgewise, hiding the overall profile and making it look like a soft volume.
The dustlanes obscured stars behind them so that you'd see them appear and vanish as your view rotated around.

(click to enlarge)

I made another big piece of geometry for the top and bottom of the galaxy. These both faded out when seen edgewise too. The transition from top to side geometry as the view pitched down was really tricky. There was an angle where neither one looked good. I pretty much just split the difference.

(click to enlarge)
When the particles and the geometry combined, the effect was pretty cool. The particles provided small scale details and animation (as well as being the game elements that you click on to navigate) and the geometry provided the big structures and washes of color.

(click to enlarge)

I had a problem when the galaxy was seen edgewise; all of the stars would overlap and make the center of the galaxy burn out to white. I used the dark dustlanes to obscure and darken them, and that pretty much fixed that.

We had to make the stars large enough that they wouldn't alias with the screen's pixels, but if we kept them above pixel scale, when you zoomed out they would rapidly accumulate and burn to white.
So we made a shader that faded them out and controlled their scale, keeping them just the right size and brightness as you zoomed in and out.

(click to enlarge)

It was fun to come home and tell my wife that I'd spent the day fixing the galaxy. She'd just roll her eyes.

(click to enlarge)

This image shows how the galaxy was broken down into a grid of cells. Each cell had its collection of stars and black holes and nebulaes and the like, and they'd be turned off and on as a group, keeping performance under control.



And lastly, here's a little video I did while working on wormholes. I was particularly happy with the distortions around the black holes. My attempt to represent Einstein rings.

3 comments:

  1. Excellent article and excellent work! Creation of the model galaxy and navigate its objects are this is one of my biggest dreams. When I saw the Galaxy play Spore I realized that this dream is not only feasible but also has implemented powerful programmer. Thank you for the visualization of my dreams!

    Sometimes opening the galaxy in spore I admire galaxy, realizing the greatness of the universe.

    ReplyDelete
  2. Thank you for this insight into the development of this element of Spore that is in itself a veritable zoo of technology. I always find it amazing to see the solutions that were implemented to create the vast scale that is available in Spore.

    ReplyDelete
  3. Hi, i'm Brazilian, and i'm here to say almost the same as the one above, and that i love Spore very much!

    ReplyDelete