These examples show how to create self-installing custom shader definitions using various implementation languages.
Color Sampler
These examples were ported from the SPDL-based
Environment Blur
These examples were ported from the SPDL-based
Fast Volume Effects
These examples were ported from the SPDL-based
Model Map
These examples were ported from the SPDL-based
Location | |
Files |
JSShaderExample.js
PYSShaderExample.py
VBShaderExample.vbs
CSShaderExample.cs
CSShaderExample.csproj
CPPShaderExample.cpp
CPPShaderExample.vcproj
GNUmakefile
|
To install the example
Connect to the Softimage SDK workgroup at %XSISDK_ROOT%\examples\workgroup.
To view the help page for an example
To run the Color Sampler example
In the script editor, type the command and click Run:
// [JScript]
NewScene(null, false);
CreatePrim("Cube", "MeshSurface");
CreateShaderFromProgID("JSShaders.JSColorSampler.1.0", "Sources.Materials.DefaultLib.Scene_Material");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.JS_Color_Sampler.out",
"Sources.Materials.DefaultLib.Scene_Material.lightmap", false);
// [C++]
NewScene(null, false);
CreatePrim("Cube", "MeshSurface");
CreateShaderFromProgID("CPPShaders.CPPColorSampler.1.0", "Sources.Materials.DefaultLib.Scene_Material");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.CPP_Color_Sampler.out",
"Sources.Materials.DefaultLib.Scene_Material.lightmap", false);
To run the Environment Blur example
In the script editor, type the command and click Run:
// [JScript]
NewScene(null, false);
CreatePrim("Cube", "MeshSurface");
CreateShaderFromProgID("JSShaders.JSEnvBlur.1.0", "Sources.Materials.DefaultLib.Scene_Material");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.JS_Environment_Blur.out",
"Sources.Materials.DefaultLib.Scene_Material.photon", false);
// [C#]
NewScene(null, false);
CreatePrim("Cube", "MeshSurface");
CreateShaderFromProgID("CSShaderExample.CSEnvBlur.1.0", "Sources.Materials.DefaultLib.Scene_Material");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.CS_Environment_Blur.out",
"Sources.Materials.DefaultLib.Scene_Material.photon", false);
To run the Fast Volume Effects example
In the script editor, type the command and click Run:
// [JScript]
NewScene(null, false);
CreatePrim("Cube", "MeshSurface");
CreateShaderFromProgID("JSShaders.JSBionicVolume.1.0", "Sources.Materials.DefaultLib.Scene_Material");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.JS_Fast_Volume_Effects.out",
"Sources.Materials.DefaultLib.Scene_Material.volume", false);
' [VBScript]
NewScene , false
CreatePrim "Cube", "MeshSurface"
CreateShaderFromProgID "VBShaders.VBBionicVolume.1.0", "Sources.Materials.DefaultLib.Scene_Material"
SIConnectShaderToCnxPoint "Sources.Materials.DefaultLib.Scene_Material.VBS_Fast_Volume_Effects.out", _
"Sources.Materials.DefaultLib.Scene_Material.volume", false
To run the Model Map example
In the script editor, type the command and click Run:
// [JScript]
NewScene(null, false);
CreatePrim("Cube", "MeshSurface");
CreateShaderFromProgID("JSShaders.JSModelMap.1.0", "Sources.Materials.DefaultLib.Scene_Material");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.JS_Model_Map.out",
"Sources.Materials.DefaultLib.Scene_Material.Phong.ambient", false);
# [Python]
app = Application
app.NewScene("", False)
app.CreatePrim("Cube", "MeshSurface")
app.CreateShaderFromProgID("PYSShaders.PYSModelMap.1.0", "Sources.Materials.DefaultLib.Scene_Material")
app.SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.PYS_Model_Map.out",
"Sources.Materials.DefaultLib.Scene_Material.Phong.ambient", False)
Follow the instructions below to build the examples.
To build the Color Sampler example on Windows
Open a Softimage command prompt, and type devenv to start Visual Studio .NET.
Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).
Tip To load the Simple Command project from the command line, type:
devenv cppsrc_CPPColorSampler\CPPShaderExample.vcproj
To build the Color Sampler example on Linux
In a shell (tcsh) window, type:
source $XSI_HOME/.xsi_<xsi_version>
Change directories to
cppsrc_CPPColorSampler
To remove all intermediate files before building the example, run this command:
gmake clean
To compile the example, run this command:
gmake
Follow these instructions to build the C# plug-in.
Note: You can either use Visual Studio .NET 2005 or Visual C# 2005 Express Edition to build the example. Visual C# Express can be downloaded freely at http://msdn.microsoft.com/vstudio/express/visualcsharp/.
To build the example on Windows
Open a Softimage command prompt, and type devenv to start Visual Studio .NET.
Starting Visual Studio .NET or Visual C# Express from a Softimage command prompt ensures that environment variables such as XSI_USERHOME are set (otherwise you'll get build and link errors).
Tip To load the CSShaderExample project from the command line, type:
devenv cssrc_CSEnvBlur\CSShaderExample.csproj
This example uses the following keywords:
C++, JScript, Python, VBScript, C++ example, JScript example, Python example, VBScript example, C# example, RegisterShader, Define, DefineInfo, ShaderDef, Context, GetSource