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 DefineInfo callback is fired. The DefineInfo callback is responsible for adding the name of the shader definition to the preset manager. You can 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

To refer to a code example, see the Custom Shader example in the SDK examples section.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License