This example shows how to create a self-installing custom shader language parser in JScript. A number of parseable file definitions (with the .bck and .pck extensions) are included to demonstrate how the parser system works, both valid and invalid.
Location | |
Files |
ShaderParserExample.js
AnotherBadParamPuckShader.bck
BadParamPuckShader.bck
DisorderedParamPuckShader.bck
NoRendererPuckShader.bck
ArrayCnxPuck.pck
BogusPuckShader.pck
ColorShare.pck
WellorderedParamPuckShader.pck
|
To install the example
Connect to the Softimage SDK workgroup at %XSISDK_ROOT%\examples\workgroup.
To view the help page for an example
To instantiate the Puck shader definitions
Start Softimage and open the render tree.
You can see a number of presets in the preset manager under the
Parsed (Good) and Parsed (Bad) sub-categories under the main
Example Shaders category:
You can instantiate it by running the following in the Script Editor::
// [JScript]
NewScene("", false);
CreatePrim("Cone", "MeshSurface");
CreateShaderFromProgID("Puck.ArrayCnxPuck.1.0", "Sources.Materials.DefaultLib.Scene_Material");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.Array_Cnx_Puck.out_vector3",
"Sources.Materials.DefaultLib.Scene_Material.Phong.bump", false);
This example uses the following keywords:
JScript example, JScript, RegisterShaderLanguageParser, QueryParserSettings, Parse, ParseInfo, ShaderDef, Context, GetSource