Create Texture Maps

Practical Pre-distortion

The question you may now be asking is, how difficult is this? Honestly, it's not too bad! First of all, there are plenty of images that will look just fine if you create them in flat, 2D space and then let them get warped around the sphere of the eye. In fact, the realistic human iris can be created with even vertical striations in the 2D map and it looks just fine when it becomes distorted by the 3D re-mapping. Since it is an organic, semi-squiggly pattern, we're pretty forgiving of it's minor distortions when looking at it.

The greater difficulty comes when trying to do more mechanical, man-made patterns, such as mechanical cyborg eyes, alien writing patterns, sci-fi glyphs, camera-style aperture blades and so on. If we create those patterns in 2D, we won't get the results we're looking for after the transform to 3D.

Spike Eyes Example

Here's an example -- lets say we want to create four triangular spikes in the iris. Here's a pattern that makes sense when created in a flat, rectangular texture map:

However, when the map is warped to the 3D space of the eye, they become rounded spikes. They look really cool, but what if we are really intent on having straight sided iris spikes?

One solution is warp the texture map into a circular shape, fix the triangles to once again have straight sides, and then un-warp it back into a rectangle. Let's go over it step-by-step using Photoshop. (You should be able to replicate these steps in the free and open source GIMP software as well).

Step 1. Rotate the rectangular texture map 180 degrees. This is necessary due to the direction in which Photoshop's polar coordinates distortion works.

Step 2. Set the canvas height equal to the texture map's width. In this case, 512 x 512 pixels. This will give the distortion room to warp the rectangle into a circle.

Step 3. Use the Filter > Distort > Polar Coordinates... menu item to bring up the Polar Coordinates window.

Step 4. In the Polar Coordinates window, set the option to Rectangular to Polar, then hit OK.

Step 5. The result of the distortion is the same bulging effect we saw on the M4 Eyes. Let's fix that! You can use the polygonal lasso selection tool to mask the nice, straight sided spikes and then paint out the bulging sections with yellow to match the background.

Step 6. In order to get a good result when un-warping the circle, make a rectangular marquee selection around it, keeping the selection tight to the texture. You can see here that I used guide lines to assist.

Step 7. Use the Filter > Distort > Polar Coordinates... menu to again bring up the window, but this time select the Polar to Rectangular option. Hit OK to turn the circle back into a rectangle.

Step 8. Now, you can rotate the image 180 degrees to get it back to its starting point, and then crop the canvas back to the original 512 x 128 pixels.

Notice how the spikes all now curve inward which will make them appear straight-sided when we apply it to the 3D eyes!

With these techniques, we can now create highly detailed texture maps that aren't distorted when applied to the M4 Eyes!

Here's a totally METAL set to try out. Have fun making your own weird and wonderful peepers!

This guide was first published on Aug 25, 2019. It was last updated on Aug 25, 2019. This page (Create Texture Maps) was last updated on Dec 05, 2019.