# Texturing
Although the Hypershade window provides numerous ways to prepare materials, several important techniques outside this window are important to know. Preparing proper **UVs** for any model is a critical step in the texturing process. Using the **3D Paint tool** is an efficient way to prepare custom bitmaps. Maya's support for the **Photoshop PSD format** allows the use of layers. At the same time, the proper use of bump and displacement maps can add realism to a render.
## Goal
- Understand the processes of UV texturing and the 3D paint tool with Photoshop and know how to apply them in Maya.
___________________
## UV mapping
>UV stands for the horizontal (U) and vertical (V) coordinates of the 2D coordinate map space that is applied to a 3D object.
UVs are 2D representations of a 3D object. There can be a problem with wrapping a 2D image (a texture) around a 3D object. UV mapping helps with this problem: UVs are directly related to vertices on a polygon and NURBS, but the UVs cannot be manipulated in 3D space; they are tied to a 2D coordinate plane and edited in a **UV editor**.
> UVs are like a “where” — they are a coordinate system across the surface of polygons (think latitude and longitude across a globe).
> Understanding what UVs are and being able to manipulate them is incredibly powerful and allows any image to define the surface of a 3D form. ***Unfortunately, this power to manipulate UV is not a trivial task and can be very counterintuitive.***

The application of a texture in the UV space related to its effect in 3D. CC BY-SA 3.0 [wikipedia](https://en.wikipedia.org/wiki/UV_mapping)

A representation of the UV mapping of a cube. The flattened cube net may then be textured to texture the cube. CC BY-SA 3.0 [wikipedia](https://en.wikipedia.org/wiki/UV_mapping)
## Video
- [The Basics Of UV Mapping by The Guerrilla CG Project](https://vimeo.com/5017993)
- [“On the Run” Creative Process - Part One by the Rusted Pixel](https://vimeo.com/120644464)
## UV Texture editor
3D software uses u- and v-coordinates to determine how textures should be applied to 3D objects. **UV mapping** refers to the process of determining these coordinates for polygon objects. **UV layout** is a term that refers to the 2D configuration of the UVs on a surface. In the **UV Texture Editor**, u-coordinates are plotted along the horizontal axis, and v-coordinates are plotted along the vertical axis. **UV maps** act as a guide for the placement of images.
**NURBS surfaces have implicit UVs; this means that the coordinates are built into the parameterization of the surface. UV texture coordinates do not have to be created for NURBS surfaces; only polygon and subdivision surfaces require mapped UVs.**
________________________
## Create UVs for polygon surfaces (Modeling // UV /)
#### Using different mapping methods and check the UV Texture Editor.

#### Example of a 3D human model with the UV map.

(a) Planar, (b) cylindrical, (c) spherical, and (d) automatic mapping of a human model.

### Examples of UV texture mapping

### The bumps and folds of a sculpture are roughed in with the 3D Paint tool

-------------------------------
## Bump, displacement map
- [Bump And Displacement Map: Overview, up to 1:36](https://www.youtube.com/watch?v=1mdR2imNeZI)
- [To adjust the displacement value](http://animation-ua.com/en/school-animation/studying-3d-animation/165-control-displacement-maps-in-maya-displacement-mapping)
__________
## Inspiration
The Blue Umbrella: a 2013 Pixar computer-animated short film that is directed by Saschka Unseld of Pixar's technical department. The short featured new techniques in photorealistic lighting, shading, and compositing.
- [The Blue Umbrella, Youtube](https://www.youtube.com/watch?v=h267hvb5xyQ)
- [saschka, Dreamer & director of pixar's the blue umbrella, Vimeo channel](https://vimeo.com/user3018211)
- Portraits Of The 21st Century: The Most Photorealistic 3D Renderings Of Human Beings [link](http://www.cgtrader.com/blog/portraits-of-the-21st-century-the-most-photorealistic-3d-renderings-of-human-beings)
- [Texture showreel: Claudio Gasparollo](https://vimeo.com/claudiogasparollo)
- [R&D Showreel: Jose Arcadio Buendia](https://vimeo.com/17501406)
- [Texture/LookDev/Generalist Artist, Valentina Rosselli](https://vimeo.com/117526785)
- [Dan Roarty - Show reel](http://www.danroarty.com/show-reel)
## Reference
[Maya 2016 online Help](http://help.autodesk.com/view/MAYAUL/2016/ENU//)
- Art of Maya [pdf link](http://web.cse.ohio-state.edu/~parent/classes/682/MAYA/art_of_maya.pdf)
- [Maya 2016 UV Editing Improvements, 35:35](http://www.cgmeetup.net/home/maya-2016-uv-editing-improvements/)
_______________
# Review
## Assignment
- [Lab 1](http://2016datt2500.tumblr.com)
- [Lab 2](http://2016datt2500lab2.tumblr.com/)
- [Lab 3](http://2016datt2500lab3.tumblr.com/)
- [Lab 4]((http://2016datt2500lab4.tumblr.com/)
## Screenshots from the last lab work
### Simple shading network
- 
Make three place2dTexture into one, then you can control its place properties by one node.
### Eye shading using a ramp texture
- 
Create two geometries made one as transparent but allow a specular property.
- 
Link two fractals from two iris colors and add a bit of noise.
-----------------
# Lab
## To do list
- Lab practice A: Texturing a box; dice, cardboard box
- Lab practice B: 3D painting texture and using PSD network
- Lab practice C: Creating UVs
- Lab practice D: Eye texturing
- Demonstration E: Alternate UV texturing
- Download textures from [here](obj/textures.zip)
___________________________
## Practice A: Texturing a dice
### Goal
- To manipulate UV texture coordinate in the UV texture editor to apply texture properly.
- To edit a texture in Photoshop.

- How to:
- Create a box and apply a material.
- From the color in the attribute editor of the material, open it and click the file node. And from the file node, you can link to the chosen texture.
- Push the hotkey '6' from the keyboard to see the texture in the work space.
- Open the UV editor from under Window menu.
- You can navigate this window in the same way as the workspace, and choose UVs or Shells, and transform them. (With the right button of your mouse, you can choose its components)

- You can change the view layout and call up a camera or an editor (See the image above).

- Now, let's select shells of the UVs and apply Polygons / Cut UV Edges.
- You can move the individual shell. Choose one and locate it on top of the texture properly.
- Select one edge, then you will see it will select two UV edges. Apply Polygons / Move and Sew UV Edges. Repeat.
- You can choose UVs and align them using align tool from the shelf menu. Lastly move them to complete the UV mapping.

- You can save a UV texture (UV Texture Editor // Polygons / UV Snapshot... ).
Then you can open the texture in Photoshop.

-------------------------

- **You can change the dice texture to boxes or change the proportion of the geometry and make it as a cereal box. Or you can make a paint can. Please practice accordingly. You can find more textures in the texture folder you downloaded from the course website or you can find and alter, or make new ones."**
## Tutorial
- [Coke can texturing](http://www.3dm3.com/tutorials/can/)
- [UVing and Texturing for the very first time in Maya 2016](https://www.youtube.com/watch?v=yOVwT-KfsYs)
- [Box UV Mapping with the UV Editor in Maya 2016, 10:23](https://www.youtube.com/watch?v=Brh1JRL9OoY)
- [Maya tutorial : Bump Map vs Displacement Map](https://www.youtube.com/watch?v=xpEUdGoyTGI)
## Advanced tutorial
- [Maya 2016 tutorial : How to UV Map ( more ) complex objects](https://www.youtube.com/watch?v=IrxPfMquK_U)
- [UV MAPPING for a human body by James Taylor, 15:20](https://www.youtube.com/watch?v=HLhazEa8wmw)
-----------------------------------------------------
## Practice B: 3D painting texture
**Goal:** creating 3D painted textures.
**Command location:** Rendering // Texturing / 3D Paint Tool
- Let's create 'color' and 'bump' textures using a brush and/or paint effect.



### Using PSD network
1. Save UV texture (UV Editor // Polygons / UV Snapshot... )
2. Create PSD Nexwork... (UV Editor // Image / Create PSD Network...) and Update PSD Network...
--------------------------------
## Practice C: Creating UVs
- Planar UV mapping
- Cylindrical UV mapping
- Spherical UV mapping
- Camera UV mapping
- Automatic UV mapping

- [Maya help: projection](http://help.autodesk.com/view/MAYAUL/2016/ENU//index.html?guid=GUID-B7E73748-5F8E-4E66-BE88-DF3C2A3DF438)
- [UV mapping tips](http://help.autodesk.com/view/MAYAUL/2016/ENU/?guid=GUID-1CEF8A5B-1051-40F1-ACFE-F29AD066F56F)
- [Layout UV shells](http://help.autodesk.com/view/MAYAUL/2016/ENU/?guid=GUID-21CFF911-9C21-4019-B676-766ACA3BC889)
- [UV Editor overview](http://help.autodesk.com/view/MAYAUL/2016/ENU/?guid=GUID-73BF7546-3BF2-44F3-9192-15A024CEC173)
--------------------------
## Lab practice D: Eye texturing
### Using textures and a projection utility

- How to:

- Create a NURBS sphere add isoparms (using Insert isoparms) to the iris area.
- Duplicate it and make a second one a little bit bigger. Put it into a layer.
- Shape the first one using Hulls to make the inner curve tino a iris.
- For a pupil, choose the pupil size isoparm and detach it.
- Delete the detached patch and create another sphere and make it small to fit to the pupil area and assign surface shader.

- Assign a material from the color attribute, call the texture window and assign a projection utility.

- From the projection node, call the texture image from the image node and then do Interactive Placement + Fit to BBox.
- You will see the projection placement node from the work space which you can control.

- Now you can change the material attributes to make right for you.

- Slight differences in the textures can change the result a lot. Therefore, please go ahead to work on textures in Photoshop.
## Reference
- [High-Quality Capture of Eyes](https://www.youtube.com/watch?v=v3X5OmHXa4c)
- [Realistic poligon eye modeling](http://www.3dtotal.com/tutorial/948-realistic-eye-modeling-for-3d-characters-maya-by-krishnamurti-martins-costa-pupil-iris-texture)
- [Procedural Eye](http://toddpilger.blogspot.ca/2012/10/procedural-eye.html)
- [Pinterest: realistic eye](https://www.pinterest.com/pin/472244710905510215/)
--------------------------
## Practice E: Alternate UV texturing
### Blender UV texturing
Related tutorial:
- [Modeling, UVmapping And Texturing A Low Poly T-Rex In Blender](http://cgi.tutsplus.com/tutorials/modeling-uvmapping-and-texturing-a-low-poly-t-rex-in-blender-part-2--cg-12861)
1. Using Blender version 2.68
- Download and install.
- to use Maya navigation interface:
- In the Blender interface, open File/User interface
- Go to Input and set the preset to 'Maya', and the hotkey option to 'Maya', and save user settings.
- Import .obj modeling data.
- Choose the object and go to the edit mode (tab key). With edge mode, select the edge which will become UV seams later. (Shift + Alt + edge to choose continous edges)
- Ctrl + E to open the window and choose 'Mark Seam'
- With face mode, select all faces and push U key to open UV texture window and 'Unwrap'.
- You can check the result to open the UV Editing window.
- If you like the result, export the obj for import into Maya. Now your object will have good UV textures.

- An UV unwrap example screenshot using the monkey primitive mesh.
- You can download the obj data [here](obj/monkey.obj) from the right button of a mouse do as Save Link As.
### Bonus Tools
- Bonus Tools 2016 is a free collection of useful Maya scripts and plug-ins. After installing Bonus Tools, an additional pull-down menu will be added to the end of the main Maya menu. This new menu provides easy access to a variety of tools and utilities for daily use. The BonusTools menu sets have been reorganized to match that of the Maya 2016 UI overhaul.
You can download it from Help / Maya Resources and Tools / Download Bonus Tools
________________________
## Lab work to do
- Review & practice based on today's lecture & lab class material.
- You can start to work on project 2: shading on the project 1.
____________________________
## Assignment
- By Sunday Oct 30 midnight, please complete your shading practices from today and upload screenshots to the class Tumblr with simple descriptions: **"a07 by your name, date"**.
- Three images: one dice or box UV texturing result, one 3D paint texturing image, and one eye texturing image.
-------------------