ASHLI shader
 
 
 

You can use FX files containing HLSL (High Level Shading Language) and GLSL (SGI® OpenGL® Shading Language) shaders in Maya, with the ASHLI plug-in. The ASHLI plug-in is now available as part of the Maya Bonus Tools. Bonus Tools is a free collection of useful Maya scripts and plug-ins that are available from the Autodesk Web site (www.autodesk.com/maya-bonustools).

You can load this plug-in from Maya’s Plug-in Manager. ASHLI is available for Microsoft® Windows® and Linux® operating systems only.

The ASHLI plug-in makes a shading material available in Hypershade which contains an attribute that you can connect to an FX file. The plug-in then loads this FX file and displays any settings as attributes in Maya’s Attribute Editor. In the scene view, you’ll see the ASHLI shader when you enable Hardware Texturing.

Currently, the ASHLI plug-in supports file textures, 2D textures, and cube maps. To use the ASHLI plug-in, you’ll need a graphics card that supports fragment and vertex shaders under OpenGL. One of the following graphics cards are required:

For more information, see About hardware shaders.

Work with ASHLI shaders

To load the ASHLI plug-in

  1. Select Window > Settings/Preferences > Plug-in Manager.

    The Plug-in Manager appears.

  2. Load the AshliShader.mll plug-in.

    For more information on the Plug-in Manager, see Plug-in Manager.

  3. Click Close.

To create an ASHLI Shader material

  1. In Hypershade, select the Ashli Shader material from the Create Maya Nodes list.

    The new shading material appears in the Hypershade, and the AshliShader material node appears in the Attribute Editor.

  2. In the Shader section, type in the path to the FX file you want to use, or browse to the FX file.

    Once the FX file is connected to the AshliShader node, the plug-in automatically loads attributes (if any exist) into the Extra Attributes section in the Attribute Editor.

  3. Open the Extra Attributes section, and adjust any attributes as necessary.
  4. Assign your new Ashli Shader material to an object in your scene. For more information, see Assign existing materials to surfaces.
  5. In the scene view, turn on Hardware Texturing (Shading > Hardware Texturing). For more information, see Shading > Hardware Texturing.

Reloading, Editing and Viewing FX files

In the Attribute Editor of the AshliShader node, you can use the Reload, Edit and View buttons to work on the FX file you’ve specified.

Reload

Reloads the specified FX file from the disk.

Edit

Opens the specified FX file in Microsoft® Notepad on Windows, and vi on Linux, for editing. Edit the file as required, and save it. Maya automatically reloads the FX file.

If you want to use a different application for editing, see Setting viewing and editing preferences.

View

Opens the specified FX file in Notepad in read-only format on Windows, and vi on Linux.

If you want to use a different application for viewing, see Setting viewing and editing preferences.

Setting viewing and editing preferences

If you want to use an application other than Notepad (on Windows), and VI (on Linux) for viewing or editing FX files, you can set the appropriate Maya option variables in the Script Editor.

For more information on variables, see Variables. For more information on the Script Editor, see Script Editor.

To set viewing preferences

  1. In the Script Editor, enter the following:
    optionVar -stringValue ashliViewCommandOptionVar "<application_name>";

    where <application_name> is the name of the application you want to use for viewing FX files.

To set editing preferences

  1. In the Script Editor, enter the following:
    optionVar -stringValue ashliEditCommandOptionVar "<application_name>";

    where <application_name> is the name of the application you want to use for editing FX files.

Tips for working with ASHLI shaders

GLSL and Maya lights

If you’re using GLSL and you want to use Maya lights in your scene, you can take advantage of built-in keywords for the language. Using keywords makes it easier to track numerous lights in your scene.

The usage of keywords is described in OpenGL® Shading Language by Randi Rost (Published by Addison Wesley Professional; ISBN:0321197895). You can also see the OpenGL Shading Language specification documents on the 3Dlabs website (developer.3dlabs.com/documents/index.htm).

Rendering the same scene with Maya Software and Maya Hardware

You may have some scenes which you’d like to render in Maya Software and Maya Hardware. For such scenes, you can connect your ASHLI shader to your software shader. This way, you’ll have one shader on the mesh for each of the renderers.

To connect an ASHLI shader to a software shader

  1. In Hypershade, middle-click and drag the AshliShader swatch onto the software shader swatch that you want to connect it to.

    The Connect Input pop-up menu appears.

  2. Select Default.

    The nodes are connected.

Using RenderMonkey FX files

You can use ATI’s RenderMonkey to develop FX files to use with Maya’s ASHLI plug-in. The effects must be saved with the RenderMonkey FX Exporter plug-in in order to be used with Maya’s ASHLI plug-in.

Currently the RenderMonkey FX Exporter does not support GLSL, so you can only use HLSL shaders. In addition, RenderMonkey uses an identity world transformation, so some effects may need to be modified to display properly in Maya. To avoid this, change the ViewProjection semantic to WorldViewProjection.

ASHLI Limitations

Important information about the limitations of ASHLI are available on the ATI website (www.ati.com).