Mental ray has a bad habit (in my experience) of sometimes not loading up with Maya, so first I'm going to go over how to reload the plugin.
Window > Settings/Preferences > Plug-in Manager
Scroll down to Mayatomr.mll and check the Loaded and Auto load boxes.
This will ensure that mental ray loads up (nearly) every time you run Maya.
Shaders
Most of the work we'll be doing with shading involves jumping between your Hypershade and Attribute Editor. To open your Hypershade window navigate to: Window > Rendering Editors > Hypershade
Voila. The Hypershade, a veritable alchemist's lab.
When you select a shader in your Materials tab, all the relevant information and sliders are shown in your Attribute Editor. To bring up the Attribute Editor simply press the segmented folder icon on the top right portion of your screen. The Attribute Editor will open, attached to the right side of your screen.
Ok, back to the Hypershade. You'll notice in the Materials tab that we already have three shaders created by default.
lambert1: This shader is automatically assigned to any created geometry. Don't use or modify this shader as it is just a preview aid.
particleCloud1: A shader that will be automatically assigned to any particles you create. Particle systems are quite advanced so you won't really need to worry about this for the sake of our studies here.
shaderGlow1: I have no clue what this is for to be honest. I've never used it or messed with it.
To the left of our Materials tab above our Work Area is the Create section.
Here is where we'll find an abundance of shaders, procedural textures, and functions...in fact so many that upon first look this section can be intimidating. Just know that you can create pretty much any basic shader you need using a Blinn, a Lambert, or a Surface Shader.
To create a shader, simply click the relevant button and it will spring into existence in your Materials tab.
Blinn
With options that allow the artist to control various aspects relating to specularity and reflectivity, the Blinn shader is extremely customizable and can be made into a nice representation of nearly any kind of material imaginable.
Lambert
A basic shader that responds to light and shadow but is extremely simple with no controls for advanced function.
Surface Shader
Does not respond to light or shadow but instead blasts color/texture.
I'm going to make one of each. My scene is simple, three poly spheres on a poly plane with some lights thrown in. Notice that by default, all shaders on my models are lambert1.
To assign a shader, select your geometry in the viewport then hover your mouse over the intended shader in the Hypershade's Materials tab and hold a right click. You should see a variety of options. Still holding down the right click, drag your mouse over to the Assign Material to Selection option.
I'm going to assign (from left to right) my Surface Shader, new Lambert, and Blinn to the spheres and then make another Lambert to assign to the floor plane. Here is what they look like, rendered at their default values.
Let's play with the Surface Shader first.
Selecting the shader brings up the relevant options in the Attribute Editor.
In this pane, whenever you see a little checkerboard icon next to an attribute, it means you can insert a procedural texture or a file into that option. To play with this, we'll select the checkerboard next to the Out Color and, in the resulting pop up window, select the Ramp option (to map a painted texture or photographic texture you would select File).
Back in the Hypershade, to see everything connected to your shader, simply select the shader in question then click the icon that looks like a box with two arrows. This button is called Input and output connections. This will neatly lay out everything connected to your selected shader in the Work Area of your Hypershade. This way we can access the ramp1 we've just attached to our surface shader's out color.
Clicking the ramp in the work area will bring up all options related to that procedural texture in the Attribute Editor, allowing you to either modify a procedural texture or change the file location of a saved image texture.
Think of a 2D texture (like our ramp) as a picture on plastic, shrink-wrapped to the outer surface of an object. A 3D texture exists in 3D space and, depending on the objects physical location, may change as the object swims through it. For our Blinn, let's use a 3D texture for the Color. I'm going to choose Solid Fractal.
Adjust the parameters on the procedural texture to taste. In the Hypershade, show the Input and output connections. Notice the place3dTexture1 node connected to your solidFractal1. Clicking this will bring up its details in the Attribute Editor and click the Fit to Group BBox button. This will adjust the 3D texture to perfectly fit around every piece of geometry assigned to it collectively.
Aside from in-depth control over reflections and specular highlights, the Blinn shader will also allow for Bump Mapping (a way to sort of fake a displaced look over the surface without affecting the actual geometry). A bump map is a black and white image, the computer will make it look as though everything that is pure white is extruded and everything black is sucked in, gradient areas will be an in-between.
To perfectly match the procedural texture we've piped into the Color, lets select the place3dTexture1 node and the solidFractal1 node in the Work Area of our Hypershade. Copy and paste the two then change the colors on the fractal so it goes from black to white.
Select your Blinn to bring up its attributes and middle mouse drag the solidFractal2 into the Bump Mapping slot, then hit enter. You'll notice that new nodes have been created as the connection is set.
The default bump is usually pretty harsh so lets select our bump3d1 node and dial it back a bit (I've got mine set to 0.5 instead of 1, usually I'll pull it back as far as 0.1 to 0.01 depending on what I'm working on).
There you go, the basic rundown of shaders and procedural textures in Maya!
Hope this helped!
No comments:
Post a Comment