Geometry Data

Geometry is passed to realtime shaders as multiple fixed-size, flat arrays of floating points. For polygon meshes and NURBS, topology is defined as a list of indexed triangles. Particle clouds are fully supported, passed as arrays of points.

Each realtime shader requests a list of attributes it needs to render the geometry. This is done by defining which information needs to be passed to the renderer in XSI_RTS_Attribute structures and then returning these structures from the GetAttributeList callback function.

For more information, see the Realtime Shader API reference.

Attribute Size

Softimage decides the size of the attribute and sends it to you in the Execute callback. This is done to avoid potentially costly conversion code. For example, you may ask for the attribute Foobar defined on a certain Point Cloud and think it is a vector of 3 floats, but in fact, Foobar might have been defined as a single float. This is why it is important to make sure you handle the size of attributes correctly in the Execute function.

If you plan to use the rendering function exposed by the Execute State, you do not have to worry about size of attributes. They are handled automatically by Softimage.

Vertex Colors and Texture Coordinates

You can use the pre-defined XSI_RTS_ATTRIBUTE string constants instead of explicit names for the attributes. For example, consider this structure in which the shader asks for an attribute called XSI_RTS_ATTRIBUTE_COLOR twice:

    XSI_RTS_Attribute __gExplicitAttributes [] =
    {
       XSI_RTS_ATTRIBUTE_POSITION, ePOSITION,
       XSI_RTS_ATTRIBUTE_NORMAL, eNORMAL,
       XSI_RTS_ATTRIBUTE_COLOR, eCOLOR0,
       XSI_RTS_ATTRIBUTE_COLOR, eCOLOR1
    };

This tells Softimage to return the data for the first 2 vertex color properties found on the mesh regardless of their names. You can also specify the name of the property in GetAttributeList explictly, like this:

    XSI_RTS_Attribute __gExplicitAttributes [] =
    {
       XSI_RTS_ATTRIBUTE_POSITION, ePOSITION,
       XSI_RTS_ATTRIBUTE_NORMAL, eNORMAL,
       "MyVertexColors0", eCOLOR0,
       "MyVertexColors1", eCOLOR1
    ;

The same rule applies for Texture coordinates (XSI_RTS_ATTRIBUTE_TEXUVW) and weight maps (XSI_RTS_ATTRIBUTE_WEIGHTMAP).

Autodesk Softimage v7.5