BACK TO TEACHING HOMEPAGE

BACK TO COURSE HOMEPAGE

   
     

MAA 3312: Advanced Texturing and Lighting

In this course the students will learn to apply traditional paint concepts, tools, and techniques for use in computer animation. They will develop critical ideas for surface treatment, texture, and lighting and demonstrate the layering of light in space to create mood, emotion and theme.
Furthermore, they will demonstrate an understanding of global illumination, final gather, Radiosity, and HDRI. Finally, upon completion they will be able to critically understand how light affects a surfaces’ color based on material: Diffusion, Gloss, Specularity, Reflectivity, Translucence, and Ambience.

 
     
JUMP TO A SPECIFIC WEEK:

 

Week 3: Creating Various Shaders (aka Shader Networks):

What is a shader network? How does it differ from what we call a Material (or Surface)? How does it differ from a texture?

In the image above, you can see the described breakdown.


TEXTURE--- A texture (sometimes called a file) is an element that is either Vector or Bitmap, which is either created in an external program (such as photoshop), or created procedurally within the 3d program (such as maya). Most commonly, the texture is saved as a jpg, tiff, tga, png, bmp, or other bitmap format, in a powers of two file size (128x128, 256x256, 512x512, etc...). These files drawn by hand, or taken from photos, and are REFERENCED into the program, meaning that their file path to the save destination of the 3d file is relative.

Textures rely on UV coordinates to determine how they apply to model. Textures are pased through a Material node on their way to the model, in which case they may be modified by the material (more on that later).
In the image shown above, the brick texture (file1) is a .jpg 512x512 texture, loaded into a Lambert Material, and applied to a model through a tiled UV layout. Ramp 1 is also a texture, However, there are two differences between it and file1. First, it is a procedurally generated element, internal to Maya, based on mathematical parameters. Second, It is currently not being mapped to the model through UVs, it is being re-controlled by the Sampler Info Node (see RIM SHADERS below), so that it's ramp qualities extend from the visual edge of the model to the visual center at all times, adjusting as the object or camera move.


MATERIAL--- A material (sometimes called a surface) is an element that has various different properties (color, ambient color, transparency, specular color, reflectivity, etc....) which may be edited with a slider to adjust values over the whole surface, or mapped via a texture. In general, the properties of Materials can be broken up into two catagories (which will be examined more in week 4 and 5 of this course): Textures that show how the material will always be (such as Bump, Transparency, Ambient Color, or Incadescense, which will always have the same look regardless of the lighting setup), and Textures that show how a material COULD be (color, specular color,... which will be modified by the available light).

Materials range in scale from diffuse to reflective based on the properties of their surfaces when examined under a microscope:






Maya and Mental Ray allow you to create all differnt types of Materials. Below is an image showing a spectrum of Materials available, listed from left to right in increasing order of time they take to render (on average):


The Surface Shader is the most basic type of material. It only shows Flat Color, without any light effects. That is, it has no shading, and no highlights. Any texture applied to it's Color channel will ALWAYS look that way.


The Lambert is still a very basic material type. It can display flat color AND has shading influenced by the light source. It is good for very diffuse surfaces, as it cannot have a specular highlight.

The Phong is a material type which allows for basic specular highlights ontop of the abilities fo the Lambert. It's highlights have a single control governing the size and brightness of the highlight.

The Blinn is just like the Phong, except is has two different controls covering the size/tightness and brightness of the highlight.

The Anisotropic is a material which is just like the Blinn, except it allows for the user to ascribe directionality to the highlight. Good for brushed metals.

The SSS materials are a Mental Ray type (all the previous listed materials are Maya native). This material has all the properties of the Blinn, but can also render the effects of light passing through the object internally from the front side and the back side.

 


SHADER--- A shader (or shader network), is the conglomertaion of all these parts mentioned so far. It can exist without textures, and creates a basic look for the surface as a whole. It is comprised of a shading group node, from which the material connects. It might also have a photon or shadow shader, a lightmap, a volumetric shader, or displacement shader node attached into the shading group (each of which will be examined later in the quarter).

THE IMPORTANT THING(s) TO UNDERSTAND ABOUT SHADERS are that they control the way the object responds to light, are created through chains of nodes, do not need UVs to look the way they do, and are more than the sum of their parts. It is this definition which should be your guide in exectuing this current project.

 


Using RIM Shader techniques for Skin, Glass, and Toonshaders:

Rim shaders use ramps to govern effects from the center of the object to the edge of the object:



A Rim shader generally requires a sampler info node and a ramp, in the configuration seen above, to create the desired effect.

Rim Shaders may be used for creating the effects of peach fuz on skin:

 

Rim Shaders may also be used for creating proper refraction and transparency on glass.
Click the image below for a tutorial on glass:

 


image from Ken Walter


image from Jessica Brunson

image from Stephanie Barnes


Image by Marlena Hammond


image from Yi Ou

The properties of glass are also determined by refraction, which we will discuss more in class:

Rim shaders may also be used to create toon, cloud, x-ray, or heat-map effects:

Image by Rais Huang

 

Maya - Rim Light Shader from CG Bootcamp on Vimeo.

 


Using the Flipped Normals Command for shaders:

The Sampler Info node also has a Flipped Normals command, which is useful in addtion to the afformentioned Facing Ratio.

This technique is excellent to use for texturing things such as leaves which are flat planes, but need different textures for the top and bottom, as well as paper that has been written on, or numerous other situations. As you see, one side accepts one color texture node, while another side accepts a differnt node. This can also be done with transparency maps for interesting effects.

And here is the render:

 

 


Using Sub-Surface Scattering (SSS) Shaders:





SubSurface Scattering Video Tutorials, free from Gnomon (requires login name and password):

 

How to create the misss_fast_skin maya node:

- bring into work area and apply to object
- Shading groups tab: miss_fast: right click: graph network
- misss_fast_skin_maya shading group attributes: mental ray drop down
- model NEEDS uvs for SSS to work

Light map:
- general scalers that control how much light gets through
- don't touch most of it
- Lightmap Write: Lightmap is linked into the mentalrayTexture
- mentalrayTexture is identical to the file hill node and can bring files in
- EXCEPT the check box that says "Writable", Means it can change every frame, its width and height are based off of render settings

- If the results of light coming through are noisy just increase the amount of samples

 

How to Create Scattering in Regular Maya Materials (Blinn, Anisotropic, Phong, etc...)

Scatter attributes are available in the Anisotropic, Blinn, Lambert, OceanShader, Phong and PhongE surface material nodes in the mental ray section. By tuning these attributes, you can blur the diffuse component of that particular shader creating the look of subsurface scattering.

These attributes are for use with the mental ray for Maya renderer only.
When scattering is turned off, the Scatter Radius value is 0: the material on the model appears solid, hard and flat.
When the Scatter Radius value is greater than 0, scattering is turned on and you can adjust the other scattering attributes.This gives the material on the model a glow beneath the surface, but still appears relatively solid.
The scattering fades with the falloff of the light and glows along the shadowed edge.

 

Sub-Surface Scatter 03: Adding SSS to Any Shader from CG Bootcamp on Vimeo.


Creating Materials from ENV texture samples------------ THE MIP GRAYBALL MATERIAL
How to bring a Zbrush Material into Maya:

Render Zbrush MatCaps in Mental Ray from CG Bootcamp on Vimeo.

 

You can download the production shaders here: http://www.pixelcg.com/blog/wp-content/uploads/2009/09/Production_Shaders.rar
Then you need to place “mentalrayCustomNodeClass.mel” and the other files into this folder:
C:\Program Files\Autodesk\Maya2009\scripts\others
(or on a Mac: Users/*yourname*/library/preferences/autodesk/maya/2009/scripts/ )

Or you can expose them typing the following in the script editor: optionVar -iv “MIP_SHD_EXPOSE” 1;

How to bring a Maya Material into Zbrush:

You can also go in the other direction:


With this vespa model, I wanted to put materials that I used in Maya into Zbrush so that I could have both versions look similar (in this case, it was for my submission to the Pixologic Turntable Gallery). Getting the materials out was tricky. I created a sphere and framed it in the center of the camera in Maya, and set my render size to 1024sq.I applied each material in my scene, 1 by 1, and rendered them on this sphere.


Then I brought those images into zbrush using the texture palette and created a set of new materials with them under the Materials Palette by modifying the sample of a cloned MATCAP white material. Then I finished by saving out these materials and applied them 1 by 1 to each subtool.

this method has dramitic impacts on speed, when rendering in Maya as well. Take a look here at two images, side by side. In the first, I have rendered using a the mi_carpaint material, and a reflection dome and lights to capture a shiny paint look. With so many reflection angles to calculate, the speed of the full render is 16seconds. When I apply the grayball substitute which comes from rendering off a spherical sample first, the result is pretty much visually similar, but the render time is now 4seconds, a reduction of 400%!

 

How to create a sample in Photoshop, and turn that into a Maya Material:

Here I created a square 1024x1024 document in photoshop. I used the circle shape tool to draw out the basic form onto the background. Then I stroked the object with a black outline, and used gradients to give a lit-toonshader look.

Using the process in the video above, I created a mip_grayball material and assigned the texure into the DGSmaterial's Shading group.

And when rendered, here is the effect:

 

How to create a sample in Photoshop, and turn that into a Zbrush Material:
It's pretty much an identical process to what is described above. Make a spherical image in photoshop, save as a PSD or JPG, and bring into ZBrush as a texture. Clone a default white MatCap material and plug the texture into the Material Sample (then turn of the texture slot itself). Seen here, my ObaMatCap (also availble in my faculty folder):

 

 


Creating Scaly and Wet Skins:

A big characteristic of scaly or reptillain skins is their wet look caused a noisy highlight. In the case of the material below, a file texture is painted for the base color and applied to a blinn. this is then mixed with a very low intensity bump map, such as the one created by this leather texture*. To add a warmness to the skin and soften the surface, either an incadesence ramp can be used, mapped to the surface luminance node, or scattering can be used (see above). This Blinn is then plugged into the base layer of a layered shader, the top layer of which is another blinn. This second material is a transparent coating meant to provide a different highlight (such as water coating skin). A noise* or scale texture can be mapped into the material's eccentricity section to provide a wet scaly look.

*note, 3d procedural textures should be baked to file before using on an animated character. To bake a procedural texture into a file texture: select the UV mapped surface and the material node. In the Hypershade, choose: Edit Convert to File Texture: Maya Software, and set your image size and file type.

 



Creating Ambient Occlusion Shaders (click on text below for deeper discussion):

When two objects are close to each other, less light reaches the areas between the two objects (or two parts of the same object).
This is generally used to create "deep shadows" or the shadow within the shadow. Also, this effect is generally creatd in a separete render pass (to be examined later in the quarter) and composited with the base render (to be examined later in the quarter). We can render this physically in Maya using Mental Ray.
We need an mib_amb_occlusion node from the Mental Ray textures section, and a Surface Shader from the Maya Materials (surfaces) section. They hook up together as seen below:

The Ambient Occlusion Texture gets edited to clamp the values so that they do not extend too far.
If the AO shadow is noisy, up the number of samples. The default value is 16. Usually be 40, you get a good smooth result without taking too much of a hit to render time.
If the AO value extends too far, or not far enough, adjust the Max Distance. The default value is 0, which doesn't actually mean 0. This value means that Mental Ray is making up it's own mind in determining how far it should cast out. A value of .001 is actually a "true zero" in this case. Extend this number upwards until you get the desired distance.

Here we see the effects of occluded light on a simple surface:

Here it is on a more complex mesh:

Ambient Occlusion can also be baked to a texture file. For more information, see the tutorial below:
BAKING AO TUTORIAL:

 

 

 

 

 


Creating Mental Ray Materials and Shaders:

 

 

DGS- Individual sliders for Diffuse, Glossy, Specular, and Shininess by direction.

Dialectric- Simulates two objects of various refraction settings, such as a plastic bottle filled with water, or a diamond coated in your oh so salty tears.

MIA (architectural)-

The cool part about this material is that it can do soooo many things, and as seen in the glass demo above, has many presets.
The major features are:
Easy to use - yet flexible. Controls arranged logically in a "most used first" fashion.
Templates - for getting faster to reality.
Physically accurate - the material is energy conserving, making shaders that breaks the laws of physics impossible.
Glossy performance - advanced performance boosts including interpolation, emulated glossiness, and importance sampling.
Tweakable BRDF - user can define how reflectivity depends on angle.
Transparency - "Solid" or "thin" materials - transparent objects such as glass can be treated as either "solid" (refracting, built out of multiple faces) or "thin" (non-refracting, can use single faces).
Round corners - shader can simulate "fillets" to allow sharp edges to still catch the light in a realistic fashion.
Indirect Illumination control - set the final gather accuracy or indirect illumination level on a per-material basis.
Oren-Nayar diffuse - allows "powdery" surfaces such as clay.
Built in Ambient Occlusion - for contact shadows and enhancing small details.
All-in-one shader - photon and shadow shader built in.
Waxed floors, frosted glass and brushed metals... - ...all fast and easy to set up.

 

Here are some other Presets availble since Maya 2008:

Mental Ray Texture, MIA-Roundcorners:

This texture gets applied to the bump map section and automatically bevels corners. both models below have the exact same topology/polycount, yet as you can see, the one with this node applied, has automatically beveled edges and a smoother look.

CLICK ON THE IMAGE BELOW for a discussion on using the MIA_roundcorners node, and other bump/normal map utilities with Mental Ray Materials:

 


 

Creating Various Metal Shading Networks Using Maya Materials:


This glossy metal has a highly anisotropic highlight that runs perpendicular to the machined grain of the metal. Beveled edges are a key component to the process since they provide the tight highlight present at the edge. The mia roundcorners can also be used to produce this effect, as discussed above. Metals are characterized by the fresnel effect (just like glass), becoming less diffuse at the edges, and also more reflective (achieved automatically by anisotropic reflectivity). This reflectance change is catagorized by the Bidirectional Reflectance Distribution Function, BRDF, that can be set automatically with the MIA matreial for mental ray. With maya materials, as you see in the illustration above, a ramp is utilized with the sampler info node to achieve this sme effect. For more info on creating metal shaders, read pages 88-93 of the course text book: Advanced Lighting and Texturing by Lee Lanier.

 

 

BACK TO TOP

 

JUMP TO A SPECIFIC WEEK: