BACK TO TEACHING HOMEPAGE

BACK TO COURSE HOMEPAGE

   
     

GA 3311: Materials and Lighting

In this class students will be introduced to materials, textures and lighting strategies to add detail and realism to objects without adding complexity to the model. Students will simulate real world surfaces containing reflection radiosity and other effects.

 
     
JUMP TO A SPECIFIC WEEK:

Week 2: Creating UVs:

We will look at how to create and layout UVs for various objects using different projection methods, and UVlayout tools.

UVs- are an additional component that coordinates 3d space with a 2d representation of that space onto a map (known as a UV map). Very simply, there will be a UV point wherever we find a vertex (at the intersection of multiple edges/at the corners of a face). However, there will most certainly be more UVs that verticies, as some vertex points will have there UVs seperated into different parts of a map. A line of UVs that are sepereated into more than one part is known as a boarder edge.

Think of UVs like the city of San Francisco represtented on a Globe. There it is an identifiable place in 3d space and that is the Vertex. If there was a sudden Volcanic erruption underneath the city and it rose up off the globe due to the volcano underneath, we would have to manipulate the vertex since it has moved in 3d space. However the UV is like a representation of San Francisco on a map such as a Mercator or Robinson map. Even though the map is different between these two types, the city itself has not moved based on the way we draw the map. UV mapping will be discussed more in Materials and Lighting. The UVs define space differently from verticies in that that vertex points are manipulated in X,Y,and Z space (think of earth in terms of the larger galaxy), and UVs are manipulated in UV or local space (east-west and north-south).

 

The UVing process is done in 4 main parts:

  1. Projection.
    In this phase parts of the model are selected and either planar, spherical, cylindrical, or automatic projections are used. This gets initial UVs layed out, but there may be overlap.

  2. Cutting.
    In this phase, parts of the model are Cut and maybe even sewn back together to break off distinct sides to prepare for flattening. After this phase, you may need to create new projections from the assoicated selections before moving on to phase 3.

  3. Unfolding.
    Here the UVs are unfolded so that the faces have the same proportions in 2d as they do in 3d. This can be done with automatic tools such as Unfold or Layour, or Smooth UV, or by hand.

  4. Packing.
    In this final stage, the UVs are packed so that they fit into the 0-1 space as tightly as possible. Think of it like a boring game of Tetris where no one is keeping score.

 

Their are 5 main rules to UVing:

  1. Minimize Distorion- Make sure the UV shells have the same proportions as the the faces of the model do in 3d
  2. Minimize Border Edges- Make sure that there are as few UV shells as possible, and that on those shells they have as few open seams as possible
  3. Keep Everything in the 0-1 Space- For Unique, non-tiling textures, everything must be packed into the 0-1 space at the end of the process to avoid repeating textures
  4. Control Your Overlapping- Overlapping should only be used where the textures need to repeat
  5. Maximize Space- Pack your UVs so they don't waste UV space

 

Projecting UV Maps: These are all options that may be found under the Polygons-->Create UVs menu
For more Info on sub options, click here

Planar Mapping-

Planar maps are great because they are flat, exactly what your canvas is going to be. In the planar mapping options you can adjust which axes you wish the projection to be made, and it can be even better if you project a planar map based on the current camera position. You will mostly make your UV sets by making a series of planar maps, scaling and organizing them in the UV editor in sections of the body and then sewing them up and laying them out into the proper square dimension. Note the distortion around all parts of the surface tangent to the mapping dirction.
Cylindrical Mapping-

Use Cylindrical Projection mapping to bend a texture map into a cylindrical shape. Because this type of projection resembles wrapping a texture map around a cylinder, it is best suited to cylindrical objects. Here you can see the diference between A and B is a stretching of the mapping manipulator to to wrap from 100 degrees to 360 degrees around the polygon model. Note the distortion present around the polls.
Spherical Mapping-

This mapping type is best suited to spherical objects as it will minimize distortion produced by tangency to the mapping direction. The difference between A and B is from 180 degrees east-west by 100 degrees north-south, to 360 degrees in all directions.
Automatic Mapping-

Automatic Mapping is great to do at the beginning. Sometimes you come up with some nice results to help early on giving you less work than starting completely from scratch. You can begin with Automatic mapping with options set to 6 sides with less distortion. After you Automatic Map, you can organize which cut up pieces belong where. Use the whole grid, it doesn't matter where you have UVs until the end. After everything's organized you can use the UV Editor to more easily select faces and then create more accurate maps by giving them planar projections. Automatic maps will often break up your uv map into TOO MANY PARTS which produce extra border edges on your map, and thusly seems on your texture when rendered out. Use these sparingly.

The UV Texture Editor:

0 to 1 space-This quadrant of the graph that we see in the UV texture editor window is in the top right corner. It represents the positive space on the graph, and is where your UVs should be placed to prevent texture repeat. The other quadrants, as well as the area outside of the 0-1 space can be used to store UVs temporarily while laying them out, and then must be moved back inside the first quadrant of the graph.
cut uvs-This function is used to seperate UVs that have been sewn together so that the faces adjoining them can be independantly positioned and moved.
sew uvs-This option is used to connect two parts of the same uv that have been seperated by the cut uvs function or by mapping.
relax uvs-To automatically untangle and even out UVs distribution based on the geometry and the UV borders. Selecting target UVs (one sample is enough) and click the tool (Check Options!) to relax UVs. You may need to repeat this action to see the desirable result. Under the options, make sure to set Edge Weights to World Space instead of Uniform.
move an sew uvs-To merge UVs by selecting polygon components edges, vertices, faces, or UVs. To avoid un-necessary stretching caused by Sew UVs, use Move and Sew UVs instead. Number of vertices does not equal to number of UVs. Be conservative with the amount of UVs for game models. Sew as many overlapping UVs as possible.
align uvs-To align / straighten a roll of UVs. Selecting target UVs (minimum 2) and click the tool (Check Options!) to align UVs.
split selected uvs-Will split all selected UVs into one UV for each connected edge.
rotate uvs-Will rotate selected UVs clockwise or counter-clockwise. Select the target UVs, and click the tool.
flip uvs-Use these options to flip the UVs of the selected faces either horizontally or vertically. Horizontal is the default Direction. Open the option window (click the box beside Flip UVs) and leave it open. Select your UVs and choose the axis which you wish to flip by.
UV Snapshot -When you're finished laying out your UV map, you need to make a snapshot to use as reference for painting the actual image. Make sure all UVs are within the top right corner boundaries of the UV Editor and then (see 0 to 1 space) , in the UV Editor, click "Polygons > UV Snapshot". Define the output location, the resolution you'd prefer (256, 512, 1024, resolutions with the multiples of 2) and the file type. You should have a nice wireframe image in the output directory after you perform the operation.


Play the UV mapping game from Planarity.net


UV'ing an Airplane Tutorial from Andrew Klein:



Here are some great Tutorials from 'round the web on UVing. They are listed in order of complexity.


UV Turorial 0: Brick Wall and Cube

UV Tutorial 1: Cube
UV Tutorial 2: Abstract object
UV Tutorial 3: Stool
UV Tutorial 4: Head
UV Turorial 5: Car

UV TUTORIAL 6: d20 (one of those "nerd dice") from Valentino Zamarripa

 

 

 

Texture Maping Channels in a Shader (part 2):
Two Types of Height Maps-->

Bump-A heightmap contains one channel interpreted as a distance of displacement or "height" from the "floor" of a surface and sometimes visualized as luma of a grayscale image, with black representing minimum height and white representing maximum height. The result is a richer, more detailed surface representation that more closely resembles the details inherent in the natural world. in bump mapping, the normal alone is perturbed, not the geometry itself. This leads to artifacts in the silhouette of the object (the sphere still has a circular silhouette). Bump maps will render faster than adding all the extra geometry required to make the object appear as realistic, and will also render quicker than adding a displacement map which will be physically more accurate with regards to the surface's alpha.
Displacement- While also using a height map to calculate difference between the mesh and the perceieved shape, displacement mapping will allow for a change of shape in the alpha. Physically, the displacement height map will simulate the addition of extra polygons through tesselation at render time. The specific type of displacement mapping utilized in Maya is referred to as sub-pixel displacement. Sub-pixel displacement commonly refers to finer re-tessellation of geometry that was already tessellated into polygons. This re-tessellation results in micropolygons or often microtriangles. The vertices of these then get moved along their normals to archive the displacement mapping. Achieving the best results with sub-pixel displacement will require the set up of subdivision approximations as well as displacement approximations in Maya's mental ray render. The Software render CAN render displacement maps, but can produce erratic results regarding accuracy without extra displacement smoothing.
While Displacement maps and Bump maps both work off greyscale values, it should be noted that for proper feature displacement, we should use an 16-bit map when producing displacement, where as only 8-bits are required for Bump maps.

 

Homework: Using the Alleyway scene provided, first model 3 new objects that seem fit for the scene and personalize the space. Next it will be up to you to apply UVs to all of the object in the scene so as to minimize distortion of the ramp-grid texture which has been applied to individual materials coresponding to individual objects. You will need to create 3 new materials for your 3 new objects as well. Using the Camera provided, and without adjusting it's position or the position of the ambient light, render out an image. You will submit this image as well as your .MA file for week 3.

You will be provided with the texture show below as part of the scene file.

It is a temporary file that you load into your material to help you determine distortion. The goal of loading this file on is that the color ramp helps you determine which way your UVs are facing in the UV texture editor (upside up, upside down, rotated left, etc...). The Numbers help you to determine if your UVs are flipped backwards (you always want the numbers to be legible from the point of view you are rendering from). Your Checker boxes are there to show you distortion within each UV shell. If your checker boxes are rectangles or parallelograms and not exact squares, then you have a distorted UV shell and you need to go into the editor and align and tweak the UVs so that in the 3d view, the boxes are square. In all, there are a couple of things you are looking for in this project:

1-Your color orientation is completely arbitrary. It's just there for YOUR sake. However, if I see the rainbow recycle more than once per-mesh, I know that you have scaled your UVs outside of the 0-1 space and that your texture, when you create it in week 4, will repeat. This may or may not be what you want.

2-Your checker boxes should ALWAYS be square (or as square as possible). However, their size in relationship from one shell to another might be different. That is ok, as long as you eventually paint your texture at a different scale, and it is especially useful if you are trying to fit your UVs as best as possible into the 0-1 space (which is a square layout). This will be harder when it comes to texturing though because you will have to paint things at non-uniform sizes.

3-Your numbers should always be legible. This means that for our project, if you look at all of the models from the outside, that you should be able to read the numbers.... except for one mesh, the Walls. This is because we view the walls from the inside when rendering.

RIGHT CLICK ON IMAGE BELOW AND CHOOSE SAVE AS

You must layout the UVs to minize distortion on the grid:

JUMP TO A SPECIFIC WEEK: