This section describes how to set up DirectX effects in XSI using the DXFx realtime shader. This shader allows you to load and display .fx files in 3D views using the DirectX9 display mode. The DXFx real-time shader supports SAS 1.0, SAS 0.8, and RTZen semantics to implement data binding.
|
To display DirectX effects, you must have DirectX 9.0c installed and your graphics hardware must support DirectX 9.0c. |
Although you can author .fx files directly in XSI, this example assumes that you have a valid .fx file that want to display in an XSI 3D view.
|
The following procedure does not describe all of the DXFx shader’s parameters. For information about individual parameters, click the ? icon in the DXFx shader property editor to consult the help topic for the shader. |
To set up an effect shader on an object
1. Set any viewport to the Realtime Shaders > DirectX9 display mode.
2. Select the object to which you want to apply the effect.
3. If the effect requires texture coordinates, create them by choosing Get > Property > Texture Projection > [type of projection] from the Render toolbar.
4. If your effect requires tangents and binormals, assign a Tangent operator to it by selecting the object and choosing Get > Property > Tangent from the Render toolbar.
5. With the object still selected, open the render tree (press 7) and choose Nodes > Realtime DirectX > DXFx to add a DXFx node to the render tree workspace.
6. Connect the DXFx shader to the Material node’s RealTime port.
You should now see your object displayed in wireframe in the DirectX9 view.
7. Double-click the DXFx node to open its property editor.
8. Set the Vertex Attribute Mapping option to the type that is appropriate for your effect.
9. In the File Name text box, enter the name and path for the .fx file you wish to use. Alternatively, you can click the more button ( ) to select the file from a browser.
10. If your .fx was compiled properly, it is now displayed in the DrectX9 view with it's specified default value. When the effect is compiled, two things happen:
- A custom property set, called DXFxParams, is appended to the DXFx shader’s property editor. The parameters in this property set allow you to do things like tune effect parameters, select a different effect techniques, and pick input lights.
If you don't see the custom property set in the DXFx property page, close the property page and reopen it.
- The texture nodes required by your effect are automatically created and connected by the DXFx shader. However, you need open each texture shader’s property editor to make sure that the shader is using the correct texture projection.
SOFTIMAGE|XSI v.6.01