Wednesday, April 8, 2009

Spore's creature skin painting.

As I mentioned in an earlier post, Spore has a unique problem with texturing creatures. In every other game, the main characters are authored by artists who create UV charts, and then paint the diffuse, specular and normal textures. The artists make sure that the creatures look good, and that the textures have detail and structure.

In Spore, by contrast, players create the characters with no artist in the loop. Players have seen beautifully textured creatures in other games, and while they cut us some slack because the creatures are theirs, they're still expecting the creatures to look professional.

So we had to make a system that would texture the creatures automatically.

Chris Hecker
built the first skin painting prototype, letting me create brushes that would simultaneously paint bumpmaps, diffuse, specular and gloss textures.

Andrew Willmott
came up with the approach of splatting the brushes directly onto the creature's skin by converting their 3D position into their position along the texture.
This was really fast, we could apply hundreds of brushes per second using the graphics card.

It was pretty spectacular, and done years before MudBox implemented similar features.

(Normals, Diffuse and Specular textures. Click to enlarge)

Then Chris hooked the brushes up to Andrew's particle system (called Swarm) so that the particles would drag the brushes around.

The particles would fly around the creature, whack into it and splatter it with paint. Once the particles had hit the creature they would crawl around on it's surface, leaving paint behind them. It was kind of like painting with an army of "scrubbing bubbles" from that old TV ad. I got to write the scripts that told the scrubbing bubbles where to go and what colors (and shininess and bumpiness) to paint as they went.

Andrew figured out how to make the creature's surface into a landscape that the particles could move across, so that I could give them controls like "turn left" or "zig-zag back and forth" and they would do it as they scooted across the skin.
All of those steering controls were relative to the surface, so to make leopard spots I could send the particles on a march around the creature and have them stop and drive in circles every now and then. I would imagine the particles point-of-view to write instructions that would create the kinds of patterns that I wanted. It was pretty amazing!


(A screenshot of Chris's prototype. Click to enlarge)

Once that system was working, I tested it out on a sample creature, trying to see how much variation I could get with it. We had to have a system that could create a tremendous breadth of surfaces.

(the first attempt to generate lots of different types of skins. Click to enlarge)

Then we had to make sure that a given texturing script would generalize. It had to work on all different sorts of creatures, no matter how many limbs they had or how fat or skinny they were.

(A test to make sure that the skinpaint scripts generalized. Click to enlarge)

Chris automatically "charted" the creatures, which is to say that he cut and flattened their skins so that they could be laid out as a flat texture. As you can see, the charting is done really poorly, but it's happening at interactive rates. We're trading off quality for speed.

(the 3D creature, and its flattened, 2D skin, click to enlarge)

We still had artists paint the individual parts with textures. We didn't try to make a system that would identify eyes and teeth and fingernails. We let an artist paint them and then composited those hand authored textures over the automatically painted skin. Shannon Galvin came up with that approach.

(Shannon's diagram of how parts textures would composite over the automatically painted skin)


This system was really cool, but still needed some work. I couldn't get the large scale patterns that I wanted out of it, and it took too long to paint a creature.

So another brilliant engineer, Henry Goffin took it over, and added a bunch of capabilities. He made it so that we could spawn particles directly on the creature's surface, and give them orders about where they should appear (just on the spine, or halfway up the legs, for example) and then have the particles crawl towards landmarks on the creature (towards the head or the tail, or towards the belly or along the arms for example).

With that system in place, a seriously technical artist named Grue (aka David Debry) was able to program the particles to paint the creatures in all sorts of ways.


(a sample page from Sporepedia. Take a look, the variety is staggering)

It was a ton of work, all done to make the magical experience of having your creature try on different skins be as simple and transparent as can be.

2 comments:

  1. Amazing work Ocean !

    My name is Wilson Christian and I am 3d artist in india. I have a most interest in material and taxturing in 3d.
    I would like to discuss with you for game taxturing painting.
    you can frequantly mail me on below address:
    "crazywolly84@gmail.com"

    ReplyDelete
  2. this is so INCREDIBLE! Id love it if you could maybe make a beginner game devs guide to doing what you guys did with spore, so that it's more acessable, tons of game devs including me have really wanted to pull off something like spore or spore inspired games, this really did have a ton of insight and it probably makes more sense to my boyfriend who's helping me and knows more about marching cubes and stuff, but a lot of it's super technical and is a little confusing , also thank you for your work on spore, you guys created a game so amazing it inspired so many others including me to make games too <3 thank you for creating such an amazing living world

    ReplyDelete