This section contains the following topics
To define the user interface of a realtime shader, create a SPDL file. You can create it by hand or you can use the shader wizard that comes with the SOFTIMAGE|XSI SDK (right-click on the SPDLs folder in the XSI Plugins Tree and choose New > Shader from the context menu).
Example of a SPDL file generated by the wizard:
# SPDL Generated by XSI Shader Wizard
SPDL
Version = "2.0.0.0";
Reference = "{E4367113-30EC-4D16-9107-725EDE386618}";
PropertySet "Halo_pset"
{
Parameter "out" output
{
GUID = "{B63F5024-A49D-4B7A-834F-3DB8033B42EE}";
Type = color;
}
Parameter "inner_ring" input
{
GUID = "{56022339-041A-4DBD-8F86-4C092F0A9966}";
Type = scalar;
Value = 1.0;
}
Parameter "outer_ring" input
{
GUID = "{C94AF607-105B-4CD4-A065-3596B661195E}";
Type = scalar;
Value = 1.1;
}
Parameter "color" input
{
GUID = "{9480CAB5-6DB6-44EC-8EF9-BFC23A12363B}";
Type = color;
Value = 1.0 0.0 0.0 0.5;
}
}
MetaShader "Halo_meta"
{
Name = "Halo Shader";
Type = texture;
}
Defaults
{
color
{
UIType = "rgba";
}
}
Layout "Default"
{
Row
{
inner_ring;
outer_ring;
}
Row
{
color;
}
}
Plugin = Shader
{
FileName = "Halo";
}
To register the shader in XSI, open a SOFTIMAGE|XSI command prompt and type
xsibatch –i <file>.spdl
In this case, xsi should return something like:
-- Copied SPDL file C:\Documents and Settings\Alex\My Documents\Softimage\dev\Halo\Halo.spdl
to c:\users\Alex\Softimage\XSI_4.0\Application\spdl
-- Registered file c:\users\Alex\Softimage\XSI_4.0\Application\spdl\Halo.spdl
-- Created preset file c:\users\Alex\Softimage\XSI_4.0\Data\DSPresets\Shaders/RealTime\Halo.Preset
** Warning: No associated library found.
Press [Enter] to continue...
Ignore the warning for now. Once the shader is compiled, the warning should disappear.