Friday, October 17, 2014

UV Basics in Maya for Beginners

After working out your models,

setting up your shaders,

and correctly assigning them, you may be shocked to discover that the textures just aren't lining up how they should be. Our label on the soup can is super zoomed in and stretched. The countertop has stretching at the ends as well. This is because the UVs of these objects are messed up. Imagine if you could take the polygons of a piece of geometry and roll them out flat (like papercraft before you build it). This grid the object would make is the UV grid. Now imagine this flattened object, this UV grid, is laid out over a picture...your texture. It might not line up very well. Working with UVs is all about getting the grid to a shape and position that allows your texture to match up how you want it to.


I'll start with my can of soup. With the geometry selected I'll go to Edit UVs > UV Texture Editor

 Now we see exactly what's wrong here. The majority of the geometry is bunched up over the medallion in our label texture, which is why a stretched version of it is all we see in our viewport.

We COULD rework the UV point by point, and in some cases this may be necessary, but fortunately Maya has some nice presets for basic shapes. With our can selected go to Create UVs > Cylindrical Mapping

As you can see this will pop up some handles both in the viewport and in our UV Texture Editor window that we can manipulate to better wrap the texture around the cylinder. Now that the UV grid is dispersed evenly across the texture, we're getting much better results in the viewport.

 Next up is our countertop.

With the counter selected, I'm going to opt for a different approach and will use Create UVs > Automatic Mapping
 

Already we've got a cleaner result, but it appears our UV has been split into two chunks and the smaller chunk is on the wrong side. We'll click the button on the top left of the window with the blue square and motion arrow to select whole chunks of UV and translate them.

At this point you can use your regular Maya hotkeys to translate, rotate, and scale bits of the UV map.

Now we want to be able to select edges rather than vertices, to get to that point we've got to select the button on the top right of the window that looks like a blue grid with yellow corners. Now drag-select over portions of our UV to make sure it's working (the UV window can be flaky in terms of selection).

 Now that we know we CAN select specific portions, hold right click and drag to change your selection capabilities to Edge. Now we can click on specific edges on our UV.

I've only clicked edges along one side of the small chunk yet edges along the larger one are lighting up as well. This tells me that on the physical model, these two portions are sewn together. In order to avoid a nasty visual seam, I'll have to sew these together on the UV as well. To do this I'll click the button that has a green arrow pointing up and a blue arrow pointing to the side. You'll see the portions snap together. Inversely, to cut portions off of a UV map, you can do the same thing by using the button with the scissors on it. When you are editing a complicated mesh, you'll be doing a lot of cutting and merging of specific UV portions.

After getting my UV grid nicely sewn, I'll select the whole thing and go to Polygons > Normalize to best fill the space.

There we have it, no stretching!

1 comment:


  1. A good to read blog with precise and necesary details into it. Really enjoyed complete reading and grabing valuable information inside. Even the language is simply and offers easy to read manner approach. Thank you for sharing such an important information.

    UV Bulb Ballast

    ReplyDelete