Shader Basics

Shader Basics

Common Shader Types and Their Functions

Antisotropic

Stretches and rotates highlights according to position of the camera to the object with this shader.

Objects using this shader appear to have parallel micro-grooves as found in brushed metal objects.

Blinn

Calculates surfaces similar to Phong, but the shape of the specular highlights reflect better.

Excellent for use on objects that are metallic in nature with soft highlights.

With the right adjustments, it can also be used for flat plastic appearing surfaces.

Lambert

Renders a flat surface without highlights. This shader does not calculate surface reflectivity unlike almost every other shader type.

This shader is good for creating surfaces that have a matte surface such as unglazed ceramics, chalk, unpolished stone and wood.

Layered Shader

Allows users to combine several shaders into one. Think of this shader like a Photoshop file with layers.

Transparency is very important when working with Layered Shader.

When creating a Layered Shader, add the shaders you are going to use and remove the green shader. When Maya creates the Layered Shader, by default it creates a green shader listing within it. The reason for this is that the Layered Shader cannot exist without something in it.

This shader is great for creating very complex shaders for complex surfaces. One can create a planet complete with a surface, atmosphere, and cloud layer. The possibilities are limitless when using masks and multiple shaders.

Phong

This shader reflects light according to the surface curvature, intensity of the lights in the scene and the angle of the camera to the applied surface to generate shadows and highlights.

This shader is a standard to start with for any material type (a good general purpose shader).

The highlight for this shader is very tight which is very excellent for polished surfaces.

Sometimes, the specular highlights of a Phong shader can flicker. If that is the case, try using a Blinn shader.

Phong E

Very similar to Phong but renders slightly faster and has a softer highlight than Phong.

This shader is used most often for glass objects.

By default, Maya creates three shaders each time a new scene file is created: lambert1, particleCloud1, and shaderGlow1. These three shaders should never be used for your geometries because Maya uses these three for base shader information. All shaders in Maya draw their glow attribute from the shaderGlow1 shader. Any changes in this shader affect all the shaders in the scene if they are using the glow attribute. Whenever you create a new surface, Maya automatically assigns the surface the lambert1 shader. If you wish to make any changes to that surface’s appearance, you should create a new shader and apply it accordingly. The same applies to particleCloud1 as lambert1 when working with particles.

Common Shader Attributes

Color
Transparency
Ambient color
Incandescence
Bump Mapping
Translucence

Using the Hypershade

What is the Hypershade?

The hypershade is graphical layout that has many tools and functions for creating shaders, textures, utilities and so forth all in one convenient interface.

To activate the hypershade window, go to Window > Rendering Editors > Hypershade.

Interface

Toggle Create Bar

This button toggles the Create Bar on and off. If you want more screen space for working with shaders, just leave it off. All the items can still be accessed under the Create in the menu.

Materials Tab

This is a library of all the shaders used in the scene file whether or not they are used on any geometry.

This button toggles the Materials tab on and off.

Toggle Work Area Tab

This area is used to show the networks of one or more shaders.

This button toggles the Work Area on and off.

Toggle Top and Bottom tabs

This button turns both views of the Materials Tab and Work Area Tab back on again.

Focusing on selected objects or all objects

Other Tabs

Textures

2D Textures

  1. Normal
  2. As projection
  3. As stencil
  4. Maya comes with a good number of default textures. Instead of spending hours describing what each texture is for, it would be better for you to experiment with each one. Below, I have listed a few that might be of particular use for beginners.
    • Checker
      • This texture map is useful for figuring out where your UVs lie on a surface.
      • Although this texture is useful, an external file with a numbered and colored checkerboard would be best for figuring out the UVs.
    • File
      • The texture node known as File is used to link any shader attribute to an external file. When creating realistic shaders, 9 times out of 10, you will use this texture node to link the shader to a file that was photographed, manipulated in Photoshop and so forth.

3D Textures

List of default 3D textures with a wide variety of uses.

Env Textures

List of default textures for use of reflections maps.

Other Textures

Layered Texture

Utilities

General Utilities

Until this heading, are several utilities that have a bazillion uses. Below, I have listed the more commonly used nodes:

  1. Bump 2d
  2. Bump 3d
  3. 2d Placement
  4. 3d Placement
  5. Projection
  6. Color Utilities

Color Utilities nodes are used to create several effects such as creating a toon shader, adjusting contrasts, gamma correction per shader and so forth.

Switch Utilities

Switch Utilities allow you to share shader information with several surfaces and their various inputs/outputs.

Particle Utilities

Image Planes

Image Plane is used to create just what it name suggests. Image planes are good for setting up an image to a camera for use of outlining a character model and/or various other objects from scanned or photographic references.

Glow

Optical FX adds various optical effects that is applied to the Glow attribute of each shader. There are various effects the Optical FX can accomplish.

Lights

This tab will list all the lights that are currently listed in your scene.

The Create Bar has the following items:

Cameras

This tab will list all the cameras that a listed in the current scene.

Working with Shader Networks

Graphing shader networks

To display a shader network, you can either LMB-hold and select Graph Network or go to Graph > Add Selected to Graph in the Hypershade window.

Reading a network of nodes

Each node is connected to one another by a line or series of lines depending on the node it’s connecting to and from.

To find out what each node is connected to, you can either hover the line connecting the nodes or in the Attribute Editor of the shader, click on the Output Connections button to see what it connections to.

Connecting nodes to other nodes

You can use the same node more than once if you wish. Using the same node more than once cuts down on the need for multiple nodes, which in turn reduce, render time.

To connect one node another to another, select the node, MMB-drag a node onto another. A dialogue will pop up asking for which type of input to connection to.

Be warned! Not all nodes can be connected to one another. Nodes that cannot be connected will be grayed out when you attempt to connect them. Input connections that are italicized mean they are already connected to another node. Connecting nodes that are already italicized breaks the current connection and replaces with the new selection.

Breaking Connections

To break a connection between nodes, but not delete any nodes, simply select the connection between the two nodes and hit the delete key.

Another way to break a connection between nodes but without deleting any nodes is through the Attribute Editor. RMB-hold on the attribute with a connection to another node and select Break Connection.

Assigning Material to Selection

There are two quick ways to assign a shader to a surface:

Attribute Editor

Output/Input Connections

Another way to view your connections, but one at a time, is to use the Attribute Editor of the selected shader and click the Upstream and Downstream Connections button.