Second Life and Open SIm UV mapping

Join us in Outworldz at www.outworldz.com:9000 or follow us:

Changing textures to fit UV Maps and Meshes

Sometimes you want to change a the textures on a mesh in Second Life or Open Sim, and you have a modifiable mesh object.  You may have a UV map for the mesh. Maybe not.   If you have a map and you look at the map, it looks like lines that vaguely resemble the object, and it's very confusing.   You may or may not have the original image to work with.  In some cases, you may not have a UV map or an image, and still want to modify the mesh object.  These difficulties can be all overcome with some free images.

UV Map basics

First, you need to understand what a UV Map is.

A UV map  is a set of coordinates that maps where each part of a texture is placed on a mesh.    Let's compare a mesh map with a prim from Second Life or Open Sim to get a basic understanding of what is happening in a mesh.

A Second Life prim always has one face on each side.

Prim faces

A prim is a simple 1:1 image-to-prim-face map.   If you could see the UV map for one face, it would look like this:

UV map for prim

 The 4 green dots at the edge of the image always match the same 4 corners of each face of the prim.

A mesh is different: It can have more faces on a side.  It can have any number of faces, and the faces can be any arrangement.

Here is a mesh cube, just like the prim cube, but I made it with 16 faces on each side:

Mesh cube

You can see each face outlined with a blue dot at each vertex. There is another difference that I put in, in the mesh UV map.   I outlined each face on the middle of the prim, and change the mapping on those to a single spot on the original texture:

UV remapped

The above dot is placed on the dark stripe, and so the pair of faces becomes that color.

As another example, each avatar is made of mesh.   Here is the mesh UV map for a face, and the skin texture that goes on it.

(You can click on any image to zoom in)\

UV for face

SKin for face

The designer can select any part of a mesh and map it to any part of an image. For my mesh horse project, I made a saddle horn and mapped it to a pretty picture of a silver coin.  You can see how the top of the piece is mapped to the coin shape, the side view of the mesh piece is mapped to a grey bleeding shade, and the rim is mapped to drawn lines to make the edges of the coin.


Horse horn 

Since my horse is both free, and modify, anyone who has the above image can now modify the horn to add your own picture to the top. Just place your photo  in the same circular area, and your face will appear on the mesh:

Map

wavy on a horn

 

Modifying a mesh piece without a UV map

If you have a mesh piece with mod rights, you can change the mesh texture.   Figuring out the map can easy or it may be hard, it all depends upon the mesh UV map.   For simple maps, you can get the details by changing the texture to this one:

/Secondlife/Posts/UV-maps/uv_checker%20large.png

Click the above image to get the full-size image map.

Place this on your mesh and you will gain an understanding of how the mesh is mapped.

You need to know that Second Life and Open SIm support up to 8 different texture maps on a single mesh object.  If only part of the mesh changes color, then you have found one of the multiple image UV maps.   You will need to look at each section individually and make an image for each part. 

Using the UV map explorer

Here is an very simple wall for this next example, with a pretty texture from my free seamless texture library.

Wall

In order to see  the unknown UV map, we will apply the above colored image to it:

WIth color map

We can now see that by drawing a new image with the border at the middle of the F-row,  we can color the bottom of the wall differently than the rest of the wall.

You can also see that the end walls consist of areas F1-F4, G1-G4 and H1-H4.  

Here is the actual UV map for the end of the wall as shown by the image above:

Actual COlored map

And here is the texture that is painted on it:

Wall colored on UV map

Now that you know the mapping, you can use any texture that has the border at the same place.

The above example was fairly simple. It can get much more complex.

Lizard mapping

Here is a lizard avatar I converted to Second Life format from a blend file made by a real expert: James Neale, the Executive Producer at RedCartel, CharacterMill and The Visualisation Company at http://www.kajimba.com/

Lizard

This lizatd is one of my freebies in the dome in Phaze Demesnes. Its a really good looking avatar!

This one is more complex as can be seen below.  When the UV map is placed on the lizard, this is what you see:

Lixard with texture map explored


I had to do a lot of work to convert this lizard to SL format.  The tail had to be chopped off and filled, the mirror operator removed, the polygons reduced, and the  bones and attachment points added. 

Here is theUV map as it was being designed:

Lizard UV

and the final UV map:

Clearly, the designers choices can make it easy or difficult to map a new texture.

Working on UV maps

Once you have a UV map, you need to be able to refer to it often while you are painting.   I have set the UV map in another window, painted a new texture and then loaded it over and over to see how things go.  This can be tedious and slow.   Some tools allow you to directly paint on the UV map in 3D, such as Photoshop CS5 and Sculptris.  Photoshop can do massive work in 3D, but it is expensive, and Sculptris can paint on files too and is free. but you have limited choices in the paint menu. There is no way to clone an area, or liquify an area such as is in Photoshop.

In this closeup of the lizards neck, you can see where a necklace can be painted.   Getting the exact shape will be tedious, but it can be done by paining a series of small dots, and uploading the texture until you get  the correct line.  In this case, following the line at the edge of G3 where the yellow matches the Green is a good place to start for a necklace.

CLoseup

Using Layers

A better way is to use a photo editing tool that supports layers, such as Photoshop, Gimp, or PaintShop Pro.

This is the UV map for my lizard after loading it Photoshop: (click any image to zoom in)

Lizard UV

At the bottom right side is the layers tool set:

Layers toolset

Right-click  the area outlined in blue and click "New Layer from Background":

New layer from background

 

The background will go away, and we have a layer for the UV map that we can work with.

Now click the icon at the bottom next to the trash can to make a new layer:

Create a new layer buutton

A new layer will appear:

New layer

Now grab the Layer 1 and move it below layer 0.  We will be drawing on this layer, and the UV map will be above it.

Mov

Now click the Layer 0 so that it turns blue.

Set the Opacity to 33% so that we can see the layer below it.

Change opacity

It should look like this in the main window.

main window

 

Click the Layer 0, our paint layer, so that is is the active layer:

Mov

Now we can paint on the bottom layer and look through the UV map so we know where to spread the paint correctly:

Painted lizard

That is my basic workflow for making a new UV map from an existing one.

Back to the Best Free Tools in Second Life and OpenSim.