Create and render hardware shaders

Hardware shaders enable you to create interesting graphical effects through small binary programs that are uploaded to the GPU. GPUs are much more efficient than CPUs for performing select tasks that are commonly found in computer graphics applications.

To write these binary programs, you can use high-level shader languages such as HLSL and GLSL to create an effects file.

Three plug-ins are available in Maya that enable you to create hardware shaders that load these effects files:

Note: The use of Cg shaders is no longer recommended as it is based on legacy technology. Use the GLSL shader instead.
  1. Load the required shader plug-in.

    The corresponding hardware shader appears in the Create tab of the Hypershade.

  2. Ensure that you are running Maya in the correct display mode.

    To create and render GLSL shaders, you must run Maya in OpenGL Core Profile mode in Viewport 2.0. Select Windows > Settings/Preferences > Preferences to open the Preferences window, and from the Display category, select OpenGL Core Profile as your Rendering engine.

    Alternatively, to create and render HLSL shaders, you must run Maya in DirectX 11 mode. From the Preferences window, Display category, select DirectX 11 as your Rendering engine.

  3. Click the shader node to create it, and load your effects file from the Attribute Editor.
  4. Click Hotkey 6 or select Shading > Hardware Texturing from the panel menu.

    Hardware shaders are used when texturing mode is enabled in the viewport.

Note:

To see hardware shaders, you must have a supported video card. Check the Autodesk website (www.autodesk.com/hardware) for the most accurate information about qualified hardware.

Hardware shader attributes

Technique

A single effect can specify one or more techniques to provide different shading variations. Maya exposes the available techniques in a drop-down list in the Attribute Editor.

Shader parameters and shader mesh data

Uniform parameters are used to map Maya information such as file textures and lighting, as well as to expose shader inputs. Maya exposes these as shader attributes in the Attribute Editor.

Varying parameters allow you to route per-vertex data from geometry. This includes selecting the UV sets, color sets, tangents and normals your shader will use. Maya exposes these parameters with a right-click menu from which you can select the data to pass to the shader.

Related topics