Introduction
If you have ever tried to apply a square or rectangular texture to a 3D sphere, you may have discovered that the areas around the north and south poles get distorted and pinched. This happens due to the way the top row of pixels in the texture are essentially all compressed into one single point at the top of the sphere. The same happens to each row of pixels along the top and bottom edges of the texture the further they are from the equator, creating a distinct pinching effect the closer you get to the poles. Just try rolling a square piece of paper into a sphere and you will see exactly what might make this process a bit difficult.
There are times where all you may want to do is apply a simple texture to a 3D sphere, for tasks such as rendering 2D planet sprites or even creating simple 3D spinning planet animations. You may not want to learn how to use shaders and nodes to create a procedural texture inside Blender, or you just might not need anything other than a simple image-based texture. In this tutorial, we will go over several ways to prepare textures (like planet surface textures) to be properly wrapped around 3D spheres.
Fixing the Seams
If you are using a seamless texture, you can skip right past this section of the tutorial. If you have made your texture using filters and manual editing, there is a possibility that the texture is not seamless. The very first thing you need to do is open your texture in the image editor of your choice. For this tutorial, as usual I will be using GIMP since it is FREE and anyone can grab a copy. I’m going to be using a 512×512 texture so I can fit examples within the width of this page, but feel free to use any size you need.
This texture does not have seamless edges, so if you were to use it to texture a sphere, there would be a very clear seam running down the center somewhere. A quick and easy way to fix this is to Offset the texture by 1/2 its width and doing a tiny bit of manual editing. Click on Layer -> Transform -> Offset to bring up the Offset options.
Press the By Width/2 button to offset the texture and press OK to confirm the offset. You should now be able to see the seam clearly down the center of the texture.
To easily remedy this, you can use the Clone Stamp tool or the Healing tool to blend existing areas of the texture over the seam. My personal preference is usually the Healing tool, but you can use whichever tool you are most comfortable with. It may even be necessary to combine both tools to really clear up the seam.
Use the Offset layer transform once more using the By Width/2 button to return the texture to its original position. The top and bottom edges do not have to be seamless, since the two poles of a sphere will never actually touch each other. They will actually be warped in the next part of the tutorial regardless, so you don’t have to waste any time making the top and bottom edges seamless.
Fixing the Pinch
Even though the edges of our texture are seamless, if it were applied to a 3D sphere, you would still see the ugly unwanted pinching at the top where the edge of the texture is compressed. The texture becomes more distorted the closer it gets to the poles. There is a useful technique for getting rid of that ugly pinching effect that doesn’t involve too many steps. First, open two copies of the texture you are going to be editing. I’ll explain why later on in the tutorial, but you will want to have a copy of the original texture set to the side while you are editing the other. From the menu bar at the top, select Filters -> Distorts -> Polar Coordinates to bring up the filter options.
Occasionally there is a 1-pixel gap that can be fixed by selecting the Map Backwards option. If you don’t see the gap in your texture, you can leave that option turned off. Make sure to select both the Map From Top and To Polar options so the image is converted into what looks like a sphere.
Right away you can see the distinct pinch at the center of the image. Just like we did in the previous section of the tutorial, choose either the Clone Stamp tool or the Healing tool using a soft brush to hide the pinch with some matching colors from the other parts of the image. With a tiny bit of work, you should be able to eliminate the most distinct parts of the pinched area.
Now we need to undo the Polar Coordinate distortion from the first step and return our texture to its original shape. Click on Filters -> Distorts -> Polar Coordinates once again to bring up the filter options window. This time, make sure to deselect the To Polar option to reverse the polar distortion. If you had to use the Map Backwards option earlier, make sure it is selected once again so the texture returns to its original orientation.
The same thing has to be done to the bottom half of the texture, so click on Layer -> Transform -> Flip Vertically to flip the image over. Using the Polar Coordinates filter once again, select the To Polar option and press OK to confirm the filter settings. Use the tool of your choice to blend, blur, or bury the pinched area at the center of the image. Run the Polar Coordinates filter one more time with the To Polar option deselected to return the texture to its original square or rectangular shape. Finally, flip the image vertically one last time to return it to its original orientation.
The texture should now have the proper distortions along the top and bottom edges to prevent the pinching effect when it is used on a 3D sphere. You may notice that the main area of the texture has gotten a little bit blurrier than it was originally, and this is due to the warping and unwarping process. This is where the copy of our original texture is going to come in handy!
Fixing the Blur
With the original texture active, select the entire image (Ctrl+A) and copy it to a new layer above the warped texture. Select the Eraser tool from the toolbar, making sure to select a brush with soft edges, and lower the Hardness slider so the edges will be softened when using the Eraser. What you want to do is slowly erase the top and bottom edges so that the warped texture below becomes visible.
You can experiment using larger or smaller brush sizes, or even changing the softness of the brush to get finer details should you prefer. Once you have finished erasing the edges, right click on the top layer and select Merge Down to combine it with the bottom layer.
It is recommended that you save and export your texture before doing any additional work on it. If you are using GIMP, you can use the built in Map to Object filter to test the texture, or you can save and export it to use in the 3D program of your choice.
The poles of the sphere should now both be nice and smooth! While this technique is not entirely perfect for incredibly detailed textures, this works quite well for simple texture jobs and smaller projects.