Creating Shader Definition Plug-ins

 
 
 

In the XSILoadPlugin callback, the ClassName and Major and Minor version are registered using the PluginRegistrar.RegisterShader or PluginRegistrar::RegisterShader method. These three pieces of information, along with the name of the plug-in itself, are used to build the ProgID, which uniquely identifies the shader definition in Softimage.

When a shader is loaded in Softimage, the Definfe callback is fired. The DefineInfo callback is responsible for adding the name of the shader definition to the preset manager. You indicate how and where the new shader definition will appear in the preset manager by specifying the ShaderDef.DisplayName or ShaderDef::PutDisplayName and the ShaderDef.Category or ShaderDef::PutCategory using context attributes. For more information, see Populating the Preset Manager.

Finally, when the shader is instantiated, the Define callback is fired. The Define callback is the real workhorse, because it allows access to the ShaderDef or ShaderDef object (returned from the Definition context attribute), which allows you to:

Note

If you want to skip right to look at some code, check out the example at the end.