DirectX Shader Material

The DirectX Shader material enables you to shade objects in viewports using DirectX (Direct3D) shaders.
With DirectX shading, materials in a viewport more accurately represent how the material will appear in another application, or on other hardware such as a game engine. You can use this material when you are using a Nitrous driver (the default driver is Nitrous Direct3D 11) or the Legacy Direct3D driver.
Tip: You can use the Quicksilver hardware renderer to render DirectX Shader materials.
Note: Typically, this material is visible in the Material/Map Browser only if a compatible driver is active. If this material is not visible, you can see it (in gray) if you choose Material/Map Browser Options Show Incompatible.

The DirectX Shader material uses FX files. An FX file defines a DirectX (DX9 or DX11) shader. It is a text file created using the Higher-Level Shading Language (HLSL) standard.

By default, DirectX shaders, including FX files, are saved in \maps\fx\ in the 3ds Max program directory.

Attention: For a DirectX shader's parameter to be visible in the DirectX Shader material's interface, the FX file must contain code to label the parameter, define its type, and (optionally) limit its range. (A few other UI settings are also provided.) You can find examples of files that contain this code in \maps\fx\ in the 3ds Max program directory.

The DirectX Shader material gives you access to ShaderFX, which lets you create hardware shader trees and save them as HLSL, CGFX, or GLSL files. You can save HLSL files with an FX file name extension, which makes them available to the DirectX Shader material.

The Quicksilver Hardware renderer can render DirectX materials that use FX files or ShaderFX trees.

Note: The DirectX Shader material does not load CGFX shader files.
Note: Autodesk 3ds Max 2014 corrected a Normal Bump map issue that appeared in versions prior to 2014, in which 3ds Max used a different tangent basis generation method than other rendering systems. There was no way to change this method. As of version 2014, 3ds Max provides three modes, each compatible with a particular method: 3ds Max, Maya, and DirectX. See Normal Bump Mode group.

Light Support

Typically FX shaders are coded to use a specific number of lights: usually just a single light. If the FX file you open is coded this way, the shader-specific rollouts display a control that lets you pick the light to use. For example:

XMSL shaders, on the other hand, are not coded to use specific lights, so they use all active lights in the scene.

Bitmap Support

When you assign a map to a mappable component of a DirectX shader, you can choose from among these map types:

Interface

DirectX Shader rollout

[method drop-down list]

Use this menu to choose the DirectX method:

  • HLSL File (The default.) Choose this to use an HLSL (FX) file.
  • ShaderFX Choose this to use the current ShaderFX shader tree as the active DirectX material.

    While Use ShaderFX is on, the ShaderFX node tree overrides the current FX or XMSL shader.

    Note: While Use ShaderFX is on, the Parameters rollout in the Material Editor shows controls for the ShaderFX shader tree. While it is off, the rollout shows controls for whichever other DirectX shader is active.
  • Stingray Choose this to use the Stingray physically based shader.

    The Stingray shader, like ShaderFX, uses the ShaderFX editor.

[shader button]

While HLSL File is active, click this button to display a file dialog that lets you open a shader. By default, the FX format (Direct3D Effects) is active and the shader is standardfx11.fx.

Reload

While HLSL File is active, click this button to reload the active shader file. To update a shader file, you can edit it and then click Reload. You don't have to restart 3ds Max to see the effect of the changes to the shader.

Open ShaderFX
While ShaderFX or Stingray is active, click this button to open the ShaderFX editor window.

Shader-specific rollouts

The rollouts that appear below the DirectX Shader rollout and above the Technique rollout are the interface to the shader you chose. These rollouts are specific to each shader.

Parameters for the default10.fx shader

Technique Rollout

An FX file can contain more than one shader. When you open one of these, the Technique rollout has a drop-down list that lets you choose which shader the material will use.

Software Render Style rollout

Specifies a material that controls software shading and rendering of objects to which the DirectX Shader material is applied. Nitrous and Legacy Direct3D viewports use DX shading. OpenGL viewports do not. Renderings other than the Quicksilver hardware renderer use software shading.

Usually you will want to choose a material that clearly identifies which objects in your scene have the DirectX Shader material applied.

Note: The DirectX Shader material has no specific settings for software shading. Any type of 3ds Max material will do. Scenes from previous versions that used DX-specific settings are assigned a Standard material with comparable rendering properties.

If DirectX is not available on your system, but you assign the DirectX Shader material anyway (by using the Material/Map Browser's Incompatible option), this is the only rollout that appears in the Material Editor.