RTSHADER_API XSI_RTS_Attribute* (*RTS_Shader3_GetAttributeList) { IRTSExecutionState *in_pExecState, void *in_pParams, void **io_pShaderInstanceData }
Enables a shader to tell Softimage which attribute it needs in order to perform rendering. The attributes are returned as an array of _XSI_RTS_Attribute elements.
The _XSI_RTS_Attribute structure works together with a set of helper functions to enable shaders to request any type of data on the mesh or point cloud to be used in rendering. Each attribute is defined by an _XSI_RTS_Attribute structure which holds the name of the attribute and optionally an enum indicating which hardware register will hold the data (only needed when using the rendering functions exposed by the IRTSExecutionState). Each shader must export the GetAttributeList callback which notifies Softimage of which attributes the shader needs.
in_pExecState | The execution state interface |
in_pParams | The shader property page parameters |
io_pShaderInstanceData | Pointer to the shader's instance user data |
useColor
is true, it tells Softimage that it needs the position, normal, 2 vertex colors and an attribute called Foobar
to do its rendering. If it's false, it doesn't ask for vertex colors. XSI_RTS_Attribute __gAttributesWithColor [] = { XSI_RTS_ATTRIBUTE_POSITION, ePOSITION, XSI_RTS_ATTRIBUTE_NORMAL, eNORMAL, XSI_RTS_ATTRIBUTE_COLOR, eCOLOR0, XSI_RTS_ATTRIBUTE_COLOR, eCOLOR1, "Foobar", eTEXCOORD0 }; XSI_RTS_Attribute __gAttributesWithoutColor [] = { XSI_RTS_ATTRIBUTE_POSITION, ePOSITION, XSI_RTS_ATTRIBUTE_NORMAL, eNORMAL, "Foobar", eTEXCOORD0 }; struct ShaderPPG { bool useColor; }; RTSHADER_API XSI_RTS_Attribute* MyShader_GetAttributeList ( IRTSExecutionState *in_pExecState, void *in_pParams, void **io_pInstanceData ) { ShaderPPG* options = (ShaderPPG*)in_pParams; if (options->useColor) { return __gAttributesWithColor; } else { return __gAttributesWithoutColor; } }