Thought we’d throw this out there – more behind-the-scenes tech tips. Here’s a little look at part of our texturing pipeline. So – it’s the classic problem: how to make lots of art assets with a small art team. A very small art team. So, we already know there’s going to be quite a few different cars, each with a different 3D mesh, and hopefully different versions of each car, like the Turbo version or the Bling version, each with their different mesh. And of course, it makes sense to have different paintworks for the cars as well – after all it, it should just be a different texture map, right?

But when you think about it – it’s not quite that simple. If we’ve got five different cars, and each car comes in five different flavours, and there’s going to be 10 different paint-jobs, each available on each car, we need 25 versions of EACH of the 10 paint jobs. Hmmm. So‚Ķtime for a bit of texture-mapping wizardry.

For my next trick we’ll be using Nuke, which I absolutely love. It’s a node-based compositor – it’s usually used for Hollywood special FX, but at its core it’s a very powerful, flexible bit of image-manipulation software, and it’s super-useful for texture mapping problems like this one. You could also use Shake, Toxik or even AfterEffects, but Nuke’s my weapon of choice right now. There’s also a free learning edition, check it out, you should be able to pick it up in a few days if you already know the principles of compositing.

Right, so what we do is – we make it so the art team (in this case, me) can just make a single image which defines a sort of generic paint style or ANY car, and we’ll use Nuke to fudge it into loads of different shapes and sizes to build texture-maps specifically fitted to the UV layout of EVERY car.

Mmmm...tasty node-based compositing spaghetti....

so the flow is:
1. Generic texture that works for all cars is made in Adobe Illustrator and exported at reasonably high res, cos it’s gonna get warped and stretched all over the place.

2. Texture gets split into its component parts – base pattern, logos, trim colour, lights colour, etc.

3. For each different mesh (there’s only one in this example cos we, er, haven’t finished the game yet) the base texture elements are placed so they wrap seamlessly over the car. This is fiddly – if you think about it, it’s like trying to wrap a toy car in paper without folding the paper. Tricky. We’re using the excellent SplineWarp deformers in Nuke to squish the base texture around, distorting it as if it was elastic that tightly wraps around the car. This covers it seamlessly, but of course it’s distorted a little.

4. Then the other elements – logos, badges, details – are slapped on top of that. They don’t need to be seamless, which means we don’t have to distort them to fit the shape of the car, so circles come out circular and squares come out square. This actually looks pretty cool.

5. The car-specific details are slapped on top of that. Random aside: the way we did this is, just make details in illustrator – these can have transparency, and use normal, screen or multiply transparency. We export it twice, first with white behind and then with black behind, and by subtracting the two, we get a lovely alpha channel that lets us blend in the paint really nicely.

6. Another nice thing in Nuke is you can have 3D stuff in there as well. you can see we have an OBJ file of the car loaded in so we can check that the paintwork looks cool. And once we’ve got more cars in there, we’ll see the same paintwork across lots of different cars, which is going to be completely awesome.

Shiny! Might put the texture test pattern car in there as a secret unlock...

Works pretty well, we actually did something similar for the 100 different planes in MiniSquadron and MiniSquadron Special Edition.

Some quick tests with placeholder textures....

Ok, there you go – if you think that looks silly, you should see the nuke setup for converting the maya-generated spherical environment maps to the 32x32x32 environment cubes supported by the iOS hardware, but that’s a story for another day…

:-)

2 Responses to “Making Drive Forever, Part 3: Automated texture remapping”
  1. CrazyEoin says:

    Looking good! Love the green and black car on the top row in the middle. Keep up the good work :-)

  2. Kevin says:

    I have a feeling these blogs would be more interesting if I knew the slightest thing about game development.
    Oh well, good to know that the games coming along well!

Leave a Reply