Realtime Shaders (v2.0) in XSI

Realtime shaders are a fully integrated set of SOFTIMAGE|XSI shaders that allow you to build and control the realtime rendering pipeline, using the render tree. You can connect these shaders together to achieve a multitude of sophisticated rendering effects, from basic surface shading to complex texture blending and reflection.

Realtime shaders are designed primarily for games and interactive media development. Using realtime shaders allows artists to apply in-game shading and effects to characters and environments from directly within the XSI interface, without having to involve developers. There are two sets of factory shaders that are provided with SOFTIMAGE|XSI, which are designed to operate with an OpenGL or DirectX display.

Although realtime shaders cannot be connected to SOFTIMAGE|XSI’s mental ray shaders, they are designed to have the same workflow. You connect realtime shaders together in the render tree, where realtime shader trees plug into the material node’s realtime input. Realtime shaders also support animation, scripting, expressions, and parameter linking.

Supporting 64-bit Platforms

To to support 64-bit platforms, realtime shaders must use the #pragma pack directive to remove padding between the fields of PPG structures:

    #pragma pack(push, 1)
    // PPG structures...
    #pragma pack(pop)

Viewing Realtime Shading effects in XSI

• To see your OpenGL based realtime shader effects, set any viewport to the OpenGL display mode, which uses the OpenGLŪ API to provide direct realtime shader support.

• To see your DirectX based realtime shader effects, set any viewport to the DirectX9 display mode.

Once a realtime shader tree is connected to an object’s material node, you’ll get instant feedback of shader effects in any realtime shaded viewport.

| OpenGL based shaders are not compatible with DirectX based shaders and vice-versa. OpenGL based shaders have no visible effect in a DirectX9 viewport and DirectX based shaders have no visible effect in an OpenGL viewport.

Realtime Shaders vs. mental ray Shaders

Though you work with mental ray and realtime shaders in much the same way, they are not compatible with one another. They do, however, coexist peacefully when applied to the same object. Here are some important things to remember when using realtime shaders and mental ray shaders in the same scene.

• You’ll notice that there are no connection icons for parameters in realtime shader property editors. Unlike mental ray shaders, you can connect realtime shaders only in the render tree.

• Both types of shaders are visible in the render tree. The realtime shader tree plugs into the material node’s realtime input, while the mental ray shader tree can use any of the other material node ports. Image clip nodes are shared between both types of shader when they use the same images.

• Realtime shader effects are visible in any viewport that is set to Realtime Shader display mode. Mental ray shaders are visible in any viewports that are set to Textured or Textured Decal mode, as well as in the render region.

• Drawing a render region in any viewport set to Realtime Shaders display mode displays the mental ray shaders’ output.

• In Realtime Shaders display mode, any objects that don’t use realtime shaders are displayed as they would be in a Textured display mode.

A Note about Graphics Cards

The extent to which you can use realtime shaders depends the graphics card and/or drivers on your machine.

For a list of graphics cards that are certified for use with XSI, see the Hardware Certification pages of the Partners section at www.softimage.com

Backward Compatibility

SOFTIMAGE|XSI does not support binary compatibility with Realtime Shader version 1.0 (used in SOFTIMAGE|XSI version 3.5 or previous). However, the shader parameters that are persisted in old scenes will be preserved. You can ensure backward compatibility by porting shaders uto the Realtime Shader v2.0 API.