Maya> Rendering>How Shaders Work In Maya

How Shaders Work In Maya

Share |

This tutorial teaches you how materials work, and how to create materials in Maya.


Step one - Download 3spheres.mb.

Step two - To follow this tutorial, you should have a basic knowledge of the Maya interface, but I'll try and explain as much as I can.

What Makes A Shader

Shaders are more commonly known as shading networks, because they rarely ever include one item (node). What a shader network is, is a shading group which has a surface material connected to it. The shading group engine is what's actually connected to your model, or, more specifically, the shape node of your model (this is the part that actually contains the geometry information of the model) and the surface material, which is connected to the shading group is the material which will appear on the model. Multiple models can share the same shading group. I'll explain this all better later.

Surface Materials

These are the materials that actually define the color of your model when rendered or seen in the view port. There are a couple of different surface materials that you can choose from.





Phong E

Ramp Shader

Surface Shader

These are just the basic materials that you will be using most often. Each material has different attributes to define the appearance of the material. Almost all of them will look uniquely different, even when set up with similar settings. Example: The phong, which is the shiny plastic-like material, will look much different than a lambert, a matte finish material.

Assigning Shaders/Materials To Your Model

The default material that's assigned to your model is a gray lambert connected to the initial shading group.

There are more than a couple of ways to do this, so we're going to list off the most useful ones. The attributes editor may open with the material settings loaded in it. Don't bother with it, because we'll cover editing the material setting later.

Step one - Select your model (in our case, a sphere), go to the rendering shelf.

click to enlarge

Step two - Click on the material that you want to use. This will automatically create a material and shading group, and then connect the shading group to the selected model.

Here is another way to do it.

Undo the last steps.

Step one - Once again, select your sphere and right click on top of it, and go to assign new material>and select the material from the list. If you have mental ray loaded, your selection of materials will be larger. Once again, this will create a shading group and surface material, and assign it to the model.

Or, instead of going and creating a whole new shading group and surface shader, you can use one that's already in your scene. It might be assigned to another model and you want them both to have the same material. Right click and go to assign existing material instead.

Here is another way to do it.

Undo the last steps.

Go to window>rendering editors>hypershade.

click to enlarge

In the create Maya node side.

click to enlarge

Click on the material you want to create. This will add it to the work area and create a surface shader and its shading group.

click to enlarge

Now select your model in the view port, right click on the surface material in the work area, and click assign material to selected. This will assign the material shading group to the model shape node; in other words assigning the material to the model.

Editing The Surface Materials Settings

The quickest way, to access the materials settings, is to open them in the attributes editor. The quickest way, to load the surface material attributes of the selected model into the attributes editor, is to select the model, go to the rendering shelf, and click the show shading group button. The attributes editor, by default, will open the shading group, but go to the surface material tab.

click to enlarge

Another way to do it is to open the hypershade again and select the material in the materials section, then go to window>attributes editor.

click to enlarge

Whichever way you chose, it will load the shaders attributes into the attributes editor. Since all materials are different, I'll cover the standard settings for almost all shaders.

Color - When you click on the color swatch, it will open the color chooser; this is the overall color of the model.

Transparency - This attribute can be grayscale (black, gray, and white), or it can be colored. The lighter the color, the more transparent it is. White is completely transparent.

Ambient Color - The ambient color is mostly affecting the color when an object is shaded on a model. It acts as a multiplier to the color.

Incandesence - Imagine this is an overall color. When editing this attribute, be careful that you don't make a shader that looks washed out when rendering. A way to prevent this is to make sure the v (value) of the color is lower than 0.1; in other words, keep this color dark.

Looking At A Shading Network

Now we're going to see what a standard shading network looks like. First, open the hypershade (wondow>rendering editors>hypershade). Go to the tab shading groups. Right click the initialshadinggroup and select "graph network".

click to enlarge

We can see all three of the spheres connected to the shading group. Basically, it's connecting the object groups from the shape nodes in the models to a dag set members array, stored in the shading group.

click to enlarge

Now select the shading group and open the attributes editor. Click on the initialShadingGroup tab.

click to enlarge

We can see the surface material slot has the lambert1 surface material connected to it. You can also see this is in the hypershade.

click to enlarge

So this takes the output of the surface material (in this case, lambert1) and connects it to the surface shader for the shading group.

Addional Notes

Shaders don't have to be assigned to an entire object - they can be assigned to individual faces on an object. For this to work, instead of connecting a shading group to an entire model, it will create a subgroup Id it can use to connect the shading group from an array to the faces. But, unlike in the standard example, the shading group will need to send the color information back to the model for shading that particular region.

Different shaders take different amounts of time to render. A phong shader will render faster than a blinn shader.

Some shaders, such as the "surface shader", have no "shading" at all; it's just a flat-colored surface.

click to enlarge

Models with multiple shape nodes (this happens when you combine two models without appending geometry together) will be connected to the shader, similar to how individual faces are connected to shaders.

For information on how to take creating shaders to the next level, check out this tutorial:


Hope this tutorial has taught you how to create shaders in Maya.

Good luck.

Home Tutorials About the Author Site Map
User Agreement Privacy Policy ©2015