How Shaders Work In MayaThis tutorial teaches you how materials work, and how to create materials in Maya. Set-upStep one - Download 3spheres.mb. What Makes A ShaderShaders 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. 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. ![]() 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. ![]() In the create Maya node side. ![]() 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. ![]() 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 SettingsThe 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. ![]() 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. ![]()
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. Looking At A Shading NetworkNow 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". ![]() 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. ![]() Now select the shading group and open the attributes editor. Click on the initialShadingGroup tab. ![]() We can see the surface material slot has the lambert1 surface material connected to it. You can also see this is in the hypershade. ![]() 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. ![]()
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. Conclusion
Hope this tutorial has taught you how to create shaders in Maya. |
![]() ![]() |