UV projection painting in Blender
This tutorial was made with blender 2.63. It requires minimal experience with Blender.
When making textures from photographs, there are many situations in which projecting a source photo into a different shape can be useful.
For example, this lovely plate would make an excellent texture if it weren't for that it was photographed at an angle. Distorted as it is, it is not very useful as a texture.
However it is not un-salvageable. We can project it's distorted shape back into a round shape. This is done by projecting between two UV maps: from one that matches the distorted shape to one that is circular. This is a very simple example, but this method can be extended to more complex projections.
We begin by setting blender up to use the 3D view port and the image editor.
Open blender, and delete the objects in the default scene by pressing “A” twice, so that everything is highlighted, then pressing “X” to delete them.
Click the top right corner of the 3D view port and drag to the left to split the window.
The button in the bottom left of this new view-port opens a list; select the “UV/Image editor".
We can load our texture into the editor by either clicking image -> load image to open a browser and select it, or by simply dragging and dropping the image from windows explorer.
Now we create a circle in the 3D viewport by pressing Shift+A and selecting “circle”.
Set the fill type to “triangle fan”.
The default of 32 vertices is fine.
Now we will UV unwrap the circle.
Press 7 on the numpad to move to top view.
Press Tab to enter edit mode. Select all vertices by pressing “A” until all vertices are highlighted.
Press U and select “unwrap” to unwrap the circle. This will create a UV projection in the image editor.
We will need two UV projections. In the “Object Data” section of the properties panel on the right, there is a “UV maps” section. Our first UV map is already listed there. Press the “+” button to create another, this will automatically be named “UVMap.001” and be identical to the first one.
We know from geometry that the shape of the circular plate in the photo is elliptical due to the angle the photo was taken at. By pressing “S” and then “Y” we can scale the UV map on the Y axis to make it approximately the same shape.
Then rotate (“R”), move (“G”) and scale (“S”) it to fit over the image of the plate.
We may need to attempt to get the right scale a few times; Ctrl+Z will undo your changes.
Remember not to move vertices individually. This will cause unwanted distortions.
When the UV map finally fits over the image, move the centre vertex to the centre of the plate. This will also have to be eyeballed, but the radial edges should help guage the centre.
Now our UV maps are set up, we can create the texture to project the corrected shape onto. Select the first UV map, “UVMap” in the Object Data section of the Properties panel. The circular UV map will appear in the Image Editor.
Next click the little cross next to the image name in at the bottom of the image editor.
You may notice the UV map will change from a circular to slightly shrunk along the x-axis. This is because our image was not square. Hit “U” and unwrap it again to fill the square space.
Select “New” to create our texture.
Set the resolution to 512 by 512, and name it.
Now we are ready to project the texture. We do this by using a clone brush to copy from “UVMap.001” to “UVMap”.
In the 3D view-port, change from “object mode” to “texture paint” mode.
In the left-hand panel, select the clone brush under "brush". Set the strength to 1.0 (100%).
Under the “Project paint” section, make sure “project paint” is checked.
Then check “Clone” and set the source to “UVMap.001”.
By clicking and dragging our “brush” over our circle object, we paint the projection onto the texture. Notice how it is now circular.
Paint over the whole circle. Go over it a couple of times to make sure you didn't miss any spots. Zooming out or increasing the brush size should help with this.
When it's painted, in the image editor click “image” and select “save as image” (not “save image”) to save the texture.
You now have a versatile, true circular image to use in your texturing.
So, In summary:
- Set the interface to display the UV/Image editor alongside the 3D viewport
- Load the original photo
- Create the flat shape to which you wish to project
- UV unwrap the shape
- Create a new UV map and edit it to conform to the original photo
- Create a new texture
- Paint the flat shape with the clone brush set to "project paint"
- The projection will have a lower pixel density in areas that were distorted by perspective to be smaller, in this case on the right side of the photo. This means that some resolution is inevitably lost. How much depends on the angle at which the photo was taken.
- If the photo was taken from close to the object, the photo may be distorted in a non-linear fashion by the lens. This is especially true with wide angle lens photos. Distortion of this kind is far more complex to account for.
An example of a more complex projection would be projecting the circular pattern to a straight pattern.
Starting with a ring:
Projecting to a strip:
And here is the result.
As you can see I was too hasty in placing these UVs, and some lines are curved in some areas instead of straight.
I hope you find this helpful in your texturing.
If any part of this tutorial requires clarification, or if it can be improved in any way, please let me know in the comments thread.