Pre-Distortion Mapping Techniques
By Lance Evans • Category: Tutorials![]()
Mapping used to be rather easy. Back in the day we only had Flat, Cylindrical, Spherical, and sometimes Cubic mapping options. Sometimes it’s hard to believe that we were able to get so much done-and done well!-with such primitive technology, but we were.
Today we have a much broader range of technology at our disposal. Simple shaders were once an exotic item, but now very sophisticated shaders or shading networks are commonplace. UV mapping tools also allow us a great deal more control in placing our textures.
In all this rush to adopt these more sophisticated tools, it’s natural that we have lost some of our more basic solutions along the way. In this article we are going to take a brief look at a primitive yet very useful technique I call pre-distortion mapping. We will cover a range of ideas that can be used with any 3D application that supports the standard projection mapping techniques of Flat, Cylindrical, etc. Let’s start with a little background.
The Trouble with Maps
If texture mapping was a perfect solution, shaders probably never would have been invented. Pixel-based texture mapping is not perfect however, and actually has quite a few limitations. We continue to use pixel based maps however, because they give us the ability to map highly controllable images onto our models. And they offer capabilities that a shader still can’t match, like mapping a client’s logo onto an object-not something your shader developer has addressed quite yet!
Among the various failings of texture mapping, is the fact that they are often applied to a model using the standard projections discussed earlier. When this is done we run into very real-world problems. In Figure 1-A we see a flat projection map projected onto a basically flat object, and the results looks fine. In Figure 1-B we have taken the very same map and used an identical projection onto a very non-flat sphere. (We left the first “flat” model in place, notice the aligning grid lines confirming the identical projection). The results of mapping the bulging sphere are not so great and you can see the introduction of a number of distortions. If you look along the sides you will see a fair amount of image “streaking”. This is where the projected image hits the object at an oblique angle-the more oblique, the greater the stretching of the image. You can quantify this by comparing the thickness of the vertical lines at the center with those closer to the right edge. Notice how much fatter the line thickness is due to streaking.
The other major distortion affects both the size and the shape of the grid squares. Again, compare the qualities of the central squares to the outer ones. Squares along the sphere’s perimeter are both larger and distorted in various ways depending on their location.
![]()
1A A flat object will show minimal distortions with a FLAT PROJECTION texture map.
![]()
1B: As a model departs from its projection map’s ideal form, the level of resulting distortions begin to increase.
What is a Pre-Distorted Map? The distortions we just saw can be avoided in a few ways, the main ones that come to mind are:
- Use UV Mapping: Yes, this is a popular solution, but not without its own limitations. These include a variety of technical limitations based on the geometry, greater complexity, and the toolset’s ability to control UVs (which varies from one application to another).
- Use Spherical Mapping: Yes, this would work in the example above, but our goal is a solution that goes beyond what the standard mapping projections can offer.
- Pre-distortion Mapping: A great solution and obviously the subject at hand.
Pre-distortion mapping is perhaps the easiest solution, the most flexible, and most compatible across all 3D programs-so you should be able to do this regardless of the program you use.
What pre-distortion mapping entails is described in its very name. The goal of the process is to look at what distortions a given projection map is going to cause when used with a given model, and then prepare a texture map which has the opposite set of distortions applied to it while still in Photoshop or GIMP (While always making sure to only apply these effects to a copy version, of course!).
Distorting maps is nothing new. Photoshop has long had a few distortion filters that were originally designed by John Knoll specifically for the purpose of correctly mapping 2D images onto 3D objects. The Spherize filter (FILTER > Distortion > Spherize.) has a number of options that are useful in preparing textures to be mapped on spheres. For example, when a world map is Cylindrically mapped to a sphere, we get pinching at both north and south poles. The Spherize filter set to its VERTICAL mode and given a value of 100% goes a long way to eliminate this polar pinching. Many 3D developers have gone as far as to add this corrective surgery into their programs in the form of a Sphere Projection map. The results of either of these treatments are seen in Figure 2. On the left side is the result of a parallel-lined map applied with a Cylindrical Projection. On the right we see the improved result from including spherical-distortion correction.
![]()
2: Cylindrical Project with and without correction
Another and more exotic example of distortions being used for mapping is the Polar Coordinates filter which is used to distort a map into a polar orientation so that the art at the polar cap can be retouched to be seamless. Then the filter can be used in reverse to put the map back into its rectangular orientation and used in either a cylindrical or spherical projection, as seen in Figure 3. This can get more complex and provides more options, but that is the gist of its operations. This technique is useful when used with both planetary or “world” maps applied to a sphere, or environmental/reflection maps applied to a dome or sphere.
See figure 3: (a)The original environmental map, (b)after applying the Polar Coordinates filter set for Rectangular to Polar, (c)The North Pole shown retouched, and (d)the image converted back to its rectangular orientation for standard mapping.
![]()
3A-D: Predistortion using the Polar Coordinates Filter
![]()
4: The Texture Map with a Spherical distortion applied.
![]()
5A: The original map as seen in Figure 1b.
![]()
5B: The new map which has been pre-distorted
However you apply pre-distortion techniques, the bottom line is to apply an equal and opposing distortion value to a map to counteract what will happen once in it is in the 3D environment. In theory this is a fine and good idea. In practice it can, well.take some practice to get it right. Like most things in art and 3D.
Pre-Distortions in Practice
The pre-distortions needed in a texture map can be created using a wide range of techniques and editing tools. Here are just a few of the more obvious candidates:
- Distortion filters
- Displacement filter
- Other filters
- Transform functions
- Smudge Tool
- Liquefy filter set
- Hand painting distortions
Which option works best will depend on what is required. As with most image work, it is often the case that a variety of techniques can be combined to achieve a finished product.
Let’s take a look at a few examples, starting with a solution for the half sphere we were working with earlier. To solve this problem we are going to run straight to the Spherize distortion filter. When we look again at Figure 1b (which we duplicated as Figure 5a for easier comparison), we see that the central areas stay mostly intact since that part of the sphere is close to flat. But the outer areas enlarge and heavily distort. This is producing the very same distortion that the Spherize filter in Photoshop does when set to a negative 100% value (in Normal Mode). So we go back to our grid image, select all, bring up the Spherize filter and plug in a positive 100%. The resulting texture map is seen in Figure 4. Notice how the areas of the map which will end up on the outer edges of the sphere are now very compressed looking.
When this new map is applied in a flat projection map to the sphere model-as our standard grid map had been before-the results look good, as we can see in Figure 5b. Compare this with the original mapping (5a).
The new version has virtually eliminated, or at least greatly minimized our two primary distortions. Notice how the thickness of the lines is much more uniform now. Also note how the relative size of all the grid squares seem comparable and that those along the sides only have a natural level of distortion-the level you might expect to see in real life.
A New Level of Control
Now let’s take this technique and apply it to a more common 3D problem: applying Cylindrical maps to an odd-shaped object, in this case a dowel-like model. A dowel is that long ornamental stick of wood often used in the banisters of older staircases. They are also used as legs on antique tables and chairs. The more ornate dowels have fancy profiles that zig-in and zag-out creating varying radii from the center line, and varying slopes that the texture map will need to project onto.
When creating a dowel-which is most often made of wood-the easiest thing to do is to use a wood style shader. Since a shader can usually calculate its textures as a solid form-in other words in the X, Y and Z axis-there is no need to “project” an image onto the model. The net result is that the wood grain can appear very realistic and distortion free.
However, our discussion here only uses a wood dowel as an example and telling you to use a shader would obviously not be solving the real problem. Nor would it tell you have to map a wide range of things that could not be solved so easily-like a snake skin or any other elongated cylindrical texturing. To do this we will need to ask some questions and solve some problems.
![]()
6A-6D: See Text for Description
What goes wrong when we map an object cylindrically? Take a look at Figure 6. In Figure 6-A we see a no-frills cylinder with a basic cylindrical projection map applied. It looks just as we expect it to. In Figure 6-B the model has had a bulging deformation applied to its mid-section. You can see how its texture map has expanded with the shape of the object, however the effect feels quite natural. This changes in Figure 6-C which starts to have the more abrupt shape changes of a dowel-like object. Without the gradual sloping to ease the effect on our eyes, the texture in this model is seen to vary dramatically. And very unattractively.
![]()
![]()
7A: This map’s various parts have been pre-distorted to accommodate the Cylindrical style mapping problems. 7B: See how parts of this solution work, and other parts do not. Notice the central section.
Notice how the shape of the checkerboard pattern changes. How they are square-shaped in the lower section, but very rectangular higher up where the dowel is thin. Why does this happen? Because as the radius of the dowel is reduced so is the measure of its circumference. The X-axis of the texture is in turn reduced along with the model’s circumference. Since the vertical elements are not being changed in any way, the result is a change in the map’s proportional ratio and an obvious and unattractive mapping job.
How can we fix this error? Well the truth is we can’t really “fix” anything here since everything is actually working correctly. At least mathematically speaking. Since we have nothing to fix, our job then becomes finding a way to create the visual results we want.
What if we try pre-distorting this map? Why not select the areas that are to be applied to the narrower parts of the dowel and stretch them out horizontally? Well, that would certainly work. And then we can take the part mapped to the tapered areas of the model and use a perspective distortion to match the two other parts of the map. Unfortunately, this will not work, as you can see in Figures 7-A and 7-B which show the map and the results of its application.
![]()
![]()
8A: The map correcting for the square of the check pattern, 8B: The results once mapped.
Another solution might be to use a Cubic mapping projection, however it will result in four seams, as see in Figure 6-D. The visually explicit nature of this repeating pattern makes mapping a cylinder/dowel a uniquely hard problem-one that a surprising number of 3D artists don’t realize exist.
There is one way to apply pre-distortion to this project that solve some of the issues and will work in some situations. The real world math will not allow us the correct the scale of the pattern on the top to perfectly match the bottom checkerboard and match the slope in between. But it will let us make all of the checks at least look square and undistorted. This corrective map is shown in Figure 8-A, and the results in 8-B.
![]()
9A-B: (a) shows the texture map getting “pinched” by the deformation along with the model. (b) shows the results of pre-distorting the map to correct for the pinching.
The same problem is much more easily solved when the imagery is more abstract. For example in Figure 9-A we see a cylinder that has had a deforming pinch applied to its central area. This model has had a texture map applied that shows something of an organic image, perhaps that of hair-lets assume we are making a girl’s ponytail without the use of fancy hair generation tools.
Notice how the hairs in the pinched geometry areas are also pinched looking. But we can apply a pre-distortion to the pinched areas and correct this, as seen in Figure 9-B. In this case it was done by simply creating the mid-section on another layer, enlarging it, and feathering its edges to blend it with the areas above and below. Exactness is not really necessary, and the results show the benefit of the few extra minutes of effort. The hair no longer looks pinched, but instead quite natural in comparison to the rest of the map.
![]()
10: A diagrammatical map on a head points up the areas of greatest distortions..
The preceding examples should be enough to whet your appetite for exploring greater mapping refinements. There is hardly any texturing project that cannot benefit from the style of added tweaking discussed here. This can start to become very involved in more complex projects, however most challenges are easy enough to solve if approached logically.
A common situation where such operations can be very useful is when texture mapping a model with more abstract shapes-a human face would be an excellent example. Although it is possible to use a cylindrical map on a face, one is still confronted with the problems of a jutting nose and receding eye sockets.
As you can see in the distortions evident in Figure 10’s image, the various distortions present could never be solved with projection corrections alone. Depending upon how the model was built and what UV tools your application has, pre-distorting the map could often be the easiest solution. Being methodical about your efforts will allow the distortions to be applied to more than one layer as well. For example you would probably wish to apply the same distortions to the diffuse, bump, specular and other layers that are applied to the same model.
Experiment and enjoy!
Lance Evans is
Email this author | All posts by Lance Evans

