Programming Hardware Shaders
 
 
 

This topic describes how to program hardware shaders using DirectX. Any version of the DirectX SDK can be used as long as the core runtime component is DirectX 9.0c or DirectX 10.

Plug-ins can be built to use any version of DirectX because different versions of Direct X sit side by side (i.e. later versions do not replace earlier version). Only the utility functions are updated with the DirectX updates; the core runtime does not change. Autodesk does not ship with a DirectX 8 driver anymore. However a developer is free to create his or her own window using a DirectX 8 device.

It is the core DirectX runtime that needs to be consistent. So if a developer request for the main DirectX device from 3ds Max, then they need to be using the same runtime component.

There are two main components to DirectX

D3DX consists of utility/helper functions. This is what changes with each SDK update. It contains the High Level Shader Language (HLSL) compilers, which is why Autodesk updates its usage when required. The core does not change except for a new runtime. These are shipped side by side, if you have Vista - they are copied along side DirectX 9.

In addition to reading this section, you should examine dxstdmtl.cpp anddxstdmtl.h in the samples\material folder.