Basic UV Mapping in Blender

Once you’ve made your 3D mesh and it’s ready for texturing, the next step is UV mapping. It’s an essential step, so get your practice in and really take advantage of the different options Blender offers. If you’re a beginner, hopefully this post will be a useful starting point.

What’s a UV Map?

  • A UV map is basically a 2D image made from “unwrapping” the skin of your 3D mesh and laying it flat. You can then later paint or apply a texture to your mesh knowing that the right texture will display on the right place on your mesh. You can even apply multiple materials to one mesh. The “UV” refers to the “XY” axis and is really just a way to differentiate it from the “XYZ” notation for 3D space.
  • Below is an automatically generated UV map for a model of a replicator we made for our VR demo Picard’s Quarters based off of one in the Star Trek TV franchise.
    • replicator             uv_replicator
  • UV maps were a major stumbling point for us when we first started learning 3D modeling because we didn’t even realize we needed them until we started seeing funky dark smudges and unexplainable mismatches of texture edges on our meshes in UE4. Take note: Learning to create good UV maps is really important no matter which 3D modeling program you use.
  • If you’re new to UV mapping, Blender has great unwrap options that automatically create a UV map for you. Sometimes you’ll have to go back and fix up some spots but it’s great for quick use.

The Basic Steps

  1. To see what the UV map will look like once created, open another panel by dragging a corner with diagonal ridges and change the “Editor Type” to “UV/Image Editor.” BTW: You’re usually in the “3D View.”
    1. changeeditortype             uv:image editor
  2. Select your mesh and get into Edit Mode (hit Tab).
  3. Hit A until your whole mesh is selected (doesn’t really matter if you’re in vertex, edge, or face-select mode).
  4. In the toolbar on the left, choose the “Shading/UVs” tab.
  5. Underneath the “UVs” section, click on the “Unwrap” dropdown menu and choose “Smart UV Project.” A small menu will pop up. (This is for quick automatically generated UV maps. If you have a sphere, cube, or cylinder shape that you want to unwrap, then continue reading later in the post for some tips.)
    1. uvmapmenu
  6. Set “Island Margin” to something like 0.001 and hit OK. This ensures that the separate pieces (called “islands”) within your UV map aren’t going to overlap. UE4 doesn’t work well with overlapping UVs and will love giving you errors about it.
  7. You can check to see if a mesh has a UV map by going to the Properties panel and clicking on the icon for “Data” (looks like a triangle). Here you can delete or duplicate UV maps for the selected mesh.
    1. uvinproperties

UV Unwrapping a Sphere Shape

  1. Select the mesh and get into Edit Mode (hit Tab).
    1. Make sure you’re in vertex-select mode.
  2. Prepare the Mesh
    1. Delete the topmost vertex and the bottommost vertex. You should see 2 holes now.
    2. Hold down Alt and select the ring of vertices that border one of the holes. Hold Shift + Alt to also select the other ring bordering the other hole.
      1. spherehole
    3. Hit S to scale the ring but don’t move the mouse just yet. Hit Shift + Z to exempt the z-axis from scaling. The ring will now only scale on the x and y-axes.
    4. Move the mouse down or towards your body to scale down until the holes are quite small. The smaller the better. Then left-click to confirm the change.
  3. Unwrap Using “Sphere Projection”
    1. Hit A until you’ve selected everything and click on the “Unwrap” dropdown menu and choose “Sphere Projection.” You’ll get a UV map that may look warped and stretched in some places. You can fix that.
    2. In the lower part of the left toolbar you’ll notice that some options for “Sphere Projection” have shown up. Set “Direction” to “Align to Object” and check the box for “Scale to Bounds.” You’ll now see more of a uniform grid formation.
      1. sphereuvmenu
  4. Fix the Holes and the Sphere Shape
    1. Your UV map is done, but your mesh has got 2 holes and is a bit flat at each pole.
    2. Select each ring of vertices again and hit S, then hit 0 to close up the hole.
    3. Hit W to get the “Specials” menu and choose “Remove Doubles” to delete all the vertices of each ring except for one at each pole. Keep those 2 vertices selected.
    4. Hit 1 to see your mesh at a better angle in the viewport.
    5. Hit S + Z to scale on the z-axis and move your mouse while eyeballing where to move your vertices. Left-click when you’re satisfied.

UV Unwrapping a Cylinder

  1. Select the mesh and get into Edit Mode (hit Tab).
    1. Make sure you’re in vertex-select mode.
  2. Hit A until the whole cylinder is selected.
  3. Click on the “Unwrap” dropdown menu and choose “Cylinder Projection.”
    1. In the lower part of the left toolbar you’ll notice that some options for “Cylinder Projection” are now showing. Set “Direction” to “Align to Object” and check the box for “Scale to Bounds.”

In UE4, Use the Correct UV Map for Your Mesh

UV Maps

  • To see what UV maps are associated with your mesh in UE4, double-click on the mesh’s file in the Content Browser.
  • From the toolbar with the large icons at the top, choose UV to toggle the preview of your UV maps and choose a UV Channel from the dropdown menu in that same toolbar.
  • By default the UV being used for materials is UV Channel 0.
    • Screen Shot 2015-01-02 at 4.17.14 AM

Lightmaps

  • UE4 uses a UV map to calculate the lighting on your mesh, and can actually automatically generate a separate UV map for you if you don’t create a second UV map in your 3D modeling software. To make sure UE4 does this, you’ll need to take a look at your import options while importing your mesh into UE4. The import options menu has a checkbox for “Generate Lightmap UVs” and by default it will be checked already.
    • generateuvlightmaps
  • If you don’t want to use UE4’s lightmap, then create a second UV map or duplicate the existing one in your 3D modeling program and export your mesh.
  • To change the UV map that UE4 is using as a lightmap, in the mesh’s settings change the “Light Map Coordinate Index” to the UV Channel number that corresponds to the UV map you want.
    • lightmapcoordindex

If you have any questions or have more tips to share, let us know! Tweet us or discuss on our Subreddit.

One thought on “Basic UV Mapping in Blender

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s