DirectX Shader Material
 
 
 
Command entry: Material/Map Browser Materials Standard DirectX Shader

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 only when you are using the Direct3D Display driver and DirectX 9.0 or DirectX 10.0 is chosen as the Direct3D version.

NoteTypically, this material is visible in the Browser only if DirectX 9 or DirectX 10 is available on your system, and you are using the Direct3D display driver with DirectX 9.0 or DirectX 10.0 chosen as the Direct3D version. 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 can use the following types of shaders:

Light Support

Typically FX and CGFX shaders are coded to use a specific number of lights: usually just a single light. If the FX/CGFX 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

Shader button

Click to display a file dialog that lets you open a Direct3D Effects (FX) file. By default, the default.fx file is chosen.

To open a CGFX or XMSL file, choose that file type from the Files Of Type drop-down list in the file dialog.

Reload

Click 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.

Shader-specific rollouts

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

For example, when you choose an XMSL file, a rollout appears for each MetaSL shader in the shader tree. You can adjust the shader settings locally for the current scene, although the XMSL file remains unchanged.

Example of locally editable MetaSL shader rollouts for a DirectX material using an XMSL file

When you load a shader that is not appropriate for 3ds Max, then instead of parameters you might see a rollout that displays an error message. For example:

An XMSL file can contain more than one shader. When you open one of these, 3ds Max prompts you to choose which shader the material will use. For example:

Software Render Style rollout

Specifies a material that controls software shading and rendering of objects to which the DirectX Shader material is applied. Viewports use DX shading unless the Software or OpenGL driver is active. Renderings always 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.

NoteThe 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 equivalent 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.

See Also