|abstract: Welcome to our secnd blender tutorial. We will now create a surface texture for a sculpted prim helmet. If you want to get more basic informations about how we created this helmet, please go and fetch the video about “creating sculpted prims with blender” . Then come back here. And don’t miss the new companion video “Texturizing sculpties with multiple images” which shows a blender only solution ( our preferred method)Important Note: Please take a minute to read the Tutorial license terms.|
High quality download: texturingSculpties.wmv
Or read the text:
Although you can create your textures entirely in blender, we have choosen to use an external paint program. In this tutorial we will use paintshop. Of course you also can use photoshop, or any other image editor, the process does not depend on this.
A little explanation of UV-textures
So lets go back to blender now. It is important to know, that the whole process is controlled by a UV-texture, which operates mostly in the background. The UV-texture is explicitly used for 2 separate tasks.
- first, it is used to create the sculptie-map itself. This task is very well supported by the scripts of Domino Marama We have explained the process in our first tutorial.
- secnd, the UV-texture defines the mapping between plain texture files, and the object surface. We will take care of this mapping now.
You find the UV-texture in the mesh tab. Its name is “UV-tex”
The UV-map is always a perfect square, containing 1024 smaller squares. Each of these squares is mapped to a different part of the surface texture. For OpenSim or any compatible online world this mapping can not be changed. So, when you understand the mapping, you can create your surface texture by hand. But this is not a good idea, because the transformation looks a bit strange.
Take a look at the final result of this tutorial. Imagine you would have to create this texture manually ? oh! That would not be easy, don’t you think?
A practical approach
So the question is, how can we map a plain 2D image of the helmet, into a usefull sculptie texture! The solution is: We will create a secnd, very different
UV map. This map directly projects the 2D image on the object. Then we transform that projection map into the final map. The good news is: blender can do this transformation for you.
- Ok! First step: Create a secnd UV-texture. Just click on UV-texture, new. A new UV-texture is now available. rename it to: “surface-texture”. And then click on the button, which is located directly left to the input field: “rendering, UV texture”… hey! This was easy!
- Now create a new image, and set width and height to 1024 each. Use the middle mouse button to scale the image down.
- Now we need to ensure, that multi-res is disabled. Otherwise the following steps will not work as shown here. Search for the multires tab and click on: “apply multires”.
- Please also select, “occlude background geometry”, so that you only select visible parts of the object.
- Then switch to face select mode. Believe me, in the next few steps, selecting faces works better , compared to selecting vertices.
Creating the initial texture
Now, back in the 3D window, click “mesh -> UV unwrap -> project from view”. This is the step, where you define the projection of your 2D image to the object surface. Hence, now you see a projection of the helmet on the right window. but when you look closer, you see that the vertices are now displayed on top of each other. We have to separate the left and the right side and the inner part of the helmet. We do this by selecting only subsets of the vertices time by time. Then we will rearrange the map by hand. Don’t worry, it is easy.
Separate the sides
- So, let us deselect all vertices first. hint: press, “a”, again. Go to the front view and select the now visible side of the helmet. go also to the top view. You probably have not selected all vertices of this side. Do this now.
- We have now selected one side of the helmet. Go to the UV-editor, select all vertices here, and move them down. Be sure, that you have disabled multi-res as explained before. ok! It is time to also select the other side of the helmet. You can do this from the top view.
- Now, take care! in the UV editor click on UV, then check, that “proportional editing” is disabled. If this is not the case, your mesh will suffer from heavy distortions.
- Still in the UV editor, de-select all vertices, then select the new side, and move it upwards.
- Now back to the 3D window. Here select the first inner side of the helmet.
- Go back to the UV editor and move the new mesh points out of the way.
- Finally select all mesh points in the 3D window. Do this by pressing, “a”, twice.
Now arrange the UV texture as you like. Take care that you fill as much space as possible. That will increase the quality of your final texture.
This UV-texture looks quite simple. It can be filled with content without adding too much of extra work. We will save this image now as a template. In the UV-editor, click on UV, then scripts, save UV face layout.
Now it is time to go to your image editor and create the initial texture. The following clip has been created with paint-shop. Of course you also can use any other editor of your own choice.
After creating the initial texture
Creating the texture, was easy. We did not make any further pixel adjustments. We only applied the correct scaling and moved the image to the correct position.
We have no photo material of the inner part of the helmet. For this demonstration we only colorized it reasonably, without taking care of the details.
But the texture we just created is not yet our final result. We need to get back to blender. Let’s load the just created texture now.
Preparing the transformation
- Check that we are in textured mode, Then we can see how the helmet will look alike at the end of the process.
- And now lets take the final step. We will create a material.
- Go to the material pannel. (Shading F5)
- In the tab, “links and pipeline”, add a new material.
- Now go to the texture-pannel (Texture buttons F6) . and then add a new texture. After you have added the new texture a few mor input fields and buttons open up. Locate the texture type field and change it from “none” to “image” Now even more tabs and control buttons open up
- Go To the “image” tab (at the right) and load the texture from file. Here we load the texture from the file system. Note, that we also can select it from the combo box, left to the load button.
- Now go back to the material buttons pannel . There locate the rightmost tab set, switch to “Map Input”. This is the moment where we connect the 2 UV textures. Now click on the UV button. This tells blender to use the UV coordinates as texture coordinates. And finally type in the name of the texture you want to use as input. Remember, this is the name of our surface texture.
go to the edit-pannel and switch the original UV tex back to active and rendering UV texture.
Now create a new image, use 1024 pixels for width and height.
And then bake the texture: Go to Render -> bake render meshes -> texture only.
artefacts from precision problems ?
Sometimes the transformation creates a set of black triangles at the top or at the bottom of the image. If this happens with your texture, then go to edit mode, click on smooth (once). Then, bake the texture again. Now the black triangles should be gone. We believe that this is a problem with mathematical precision at the poles of the object.
NOTE: This problem only happens, when the pole vertices have been collapsed all together. In that case the border faces are triangles, instead of rectangle. But the texturizing algorythm seems to expect rectanlges. When smoothing, the vertex collapse is partially reverted, so that now all vertices are laying on a small ring around the pole. And now, all tirangles have been replaced by rectangles at the border. Now the face calculation can be performed as expected and the black triangles are gone away.
Ok! We are finished now. Save the surface texture to your hard drive. And it is time to go to OpenSim (or your preferred online world) and see your textured sculpty in action…!
In our next tutorial, we will show you, how to work with multiple textures. And finally we will explain how to use the embedded tools for texture creation.
Stay tuned until the next time!