ELFWorks'
"Amazing, Patented"
Skin-o-Matic!
or,
'A facial peel that doesn't burn!'

Originally published in NewTekniques, Oct/Nov, 1997
OK, you've just finished your latest 3D monster, and the model looks great! But, now you need to add some detailed bump and texture maps to make it look real!

This article will describe a simple LightWave scene that can be used to 'peel the skin off' of any roughly cylindrical object and leave you with a high resolution image that you can then use as a reference for creating cylindrical texture maps. (Optimally, you will also have a layered paint program like PhotoShop to create your texture maps, once the template is made.)

When texturing an object like a head, the easiest and most common technique in LightWave is to use the Cylindrical projection map option, and map textures onto the head as if it were a round pole. This is all fairly straightforward, but a problem arises when you need to place markings with precise detail (i.e.: fine wrinkles around the eyes & mouth, moles, tattoos, scars, etc.).

NEWS FLASH: Ernie Wright has written a Modeler plugin that creates a cylindrical image map similar to the PolyMesh referred to below. To get this cool plugin, just click here!
If you're using the Humanoid object by Crestline software, you'll already have a reference bitmap to work from. (Crestline uses Meshpaint from Positron. It's a 3D paint program that will automatically create a PolyMesh - a bitmap showing just the wireframe outline of the image, unwrapped for cylindrical projection. No color or texture information is included in these B&W bitmaps, but they are nice starting points for building texture maps. )

But, what if the head of your creation doesn't look even remotely human? With no reference, it's virtually impossible to line up anything but the grossest detail in a 2D paint program. (Some true artists in the audience may have had success - but I'm not one of them - I can barely paint to begin with.)

There are some new programs out for the PC, Mac, & others that will allow you to paint directly onto a 3D object. Detailer by Fractal Design is the most widely advertised. Unfortunately, they do not support the LightWave format directly, so objects have to be saved out in DXF format. It works, but lack of direct LightWave support adds several extra steps.

At NewTek's SIGGraph booth this year, a product called 4DPaint was being shown off. It looked to be an extremely powerful multi-layered paint program that allowed direct painting of Specularity, Bump, and Diffuse maps - with a real-time preview window!

Still, these programs cost several hundreds of dollars each, and a free workaround is always welcome!

Here now is a description of how to setup a scene that I lovingly call "Erik's Skin-o-Matic". (I wanted to call it "Popeil's Pocket Skinner", but was afraid I'd get sued. )

Note: While this demo uses a head object, pretty much any cylindrical object can be skinned using this 'jig'...You'll just have to change the image aspect to match the ratio of cylinder height to object circumference. (Don't remember the equation?!? Circumference is the diameter (2x radius) x pi (approx. 3.1415).)

When rendering, what will happen is that the image will be built up from left to right as a series of small strips. Each frame adds another small slit to the finished image. The important thing is that each individual strip is rendered along the same angle that a cylindrical projection map would follow - basically reversing the image mapping to leave you with an accurate template.

To understand how this technique works, consider a popular device used to capture 3D models of human heads: the CyberWare scanner. (First commercially used to put human faces on the water creature in 'the Abyss', it's been seen in countless films since. [Actually, a friend corrected me: It's first film use was in the 'dream sequence' when the Enterprise was travelling back in time in STIV.]) The scanner is a big unit with a chair in the middle, and a camera that rotates in a circle around it. An actor remains stationary while the camera rotates around them. As the camera rotates, 3D geometry data is captured using a laser scanning technique. As the 3D data is collected, a standard camera also captures a series of small image strips - one for every column of polygons. These thin vertical strips are then assembled into a panoramic image which shows a perfectly lit view of the actor's head from every angle.

This tutorial uses a similar concept to create the cylindrical projection of your head object.

Modeler:
First, load your object into Modeler, and select just the polygons you want to map. Cut those polys into a new layer, and center the object using the Custom->LW_Center tool. (This is basically the same as using the 'Auto Size' button on the final texture map - more on this later....)

Once you've created this temporary object, save it out with some descriptive name, like 'TmpHead.lwo'.

Now, we have to create a slit object. Do the following: Create a box with numeric values:

LOW: .625mm, -.25m, 0
HIGH: 1.0m, .25m, 0

Next, mirror the object along the X-axis.

(In case you're wondering how I figured out the size of the slit: Take the distance the slit travels in the scene [32cm], and divide it by the number of frames rendered [256]. 32cm/256=1.25mm.)

Name the polygons 'ViewSlit'

Save the object as: 'ViewSlit.lwo'

Layout:

Go to Layout, and select the Camera panel.

Start by enabling the Custom Size setting, and set the image size to 1024x480. Set pixel aspect to Square Pixels, and set segment size to 12MB. You can set antialiasing to whatever you want - though OFF works just fine for a background template. (DON'T use Enhanced AA, as this will blur out the image unacceptably.)

Set Zoom Factor to 1000. (Yes, ONE THOUSAND! Setting the Zoom Factor this high virtually flattens out the head - minimizing any perspective distortion that would occur with a wider 'lens'.)

Close the Camera panel, and select the Camera. Move the camera to 0, 0, -150 at frame 0.

Now, create a Null Object named 'ObjectPeeler'. At frame 0, move the ObjectPeeler to -32cm, 0, 0, and set the heading to -180. At frame 256, set the position to 32cm, 0, 0, and heading to 180. Set spline control to linear for keyframe 256.

Next, load the 'ViewSlit.lwo' object. At frame 0, move the object to -16cm, 0, -75m, and at frame 256, set the position to 16cm, 0, -75m. Leave rotation set to 0. Again, set spline control to linear for keyframe 256.

Finally, load the 'TmpHead.lwo' object, and parent it to the ObjectPeeler.

At this point, the scene is done! You should see the head object centered on the left side of the screen - only one-half should be visible, and it should be facing away from the camera. (Note: you might not see the head if your preview mode is set to Smooth Shaded or Textured. Just set the view options for the ViewSlit to Front Face wireframe.)

If necessary, size the head object at frame 0 to fit vertically within the bounds of the final rendered image.

Lighting:

Select the only light in the scene, and Parent it to the ObjectPeeler. This way your light source is fixed to the rotating head. You can also add more lights to highlight the head's shape. If you wanted flat lighting, just point the light straight at the face, and DON'T parent it to the rotating ObjectPeeler.

In the examples you see here, I had created a temporary scene with just the head and some generic lights parented to the head. Next, I just did a 'Load From Scene' to load everything into the 'Skin-o-Matic' scene.

Surfacing:

Go to the render panel, and setup the destination directory - you will need enough space to hold at least 256 intermediate frames - probably a few hundred MB at most. Set the first frame to 0, and the last frame to 256.

Render out frame 0.

Now, go to the Images panel, and load an Image Sequence. Load the same image you just rendered, and set the Frame Offset to -1.

Go to the Surfaces panel, and find the ViewSlit surface. Set the Surface Color Texture option to FrontProjection map, and select the Image Sequence you just loaded. Set the Luminance to 100%, and the Diffuse Level to 0% (This prevents the Front Projection map from being affected by any ambient lighting.)

Finally, save the scene as 'Skin-o-Matic.lws', and Save All Objects - just to make sure all surfaces are saved.

Rendering:
Before you render out the whole scene, you might want to make a quick wireframe preview and make sure everything is set up correctly. You should see the head rotating from left to right, with a small slit centered on the head as it travels from left to right.

Once you're sure everything is set up correctly, go ahead and render the images. Now would be a good time to get some coffee..... (It was taking about 9secs x 256 frames, or a little over 1/2 hour on my dual PPro 200)

When this little thing is done churning out frames, you should have a directory full of images - we're only interested in the last one, since it has all the strips joined into a single image.

If everything worked as specified, you should see a big, wide image that shows every side of the head you want to detail.

Once you've created your texture map(s), all you have to do is Auto Center them on the head surface, and they'll line up perfectly.

Byline:
Erik Flom - Owner of ELFWorks 3D Construction Co., a full-service animation company serving the San Francisco bay area. Visit my web site: www.ELFWorks.com.

elftextures.jpg - The top image is the output of 'Skin-o-Matic'. The middle image was painted in PhotoShop, using the top image as a template. The bottom image is the Alpha channel mask.