ShaderParser
 
 
 

Custom Shader Parser Example

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.


Example Files

Location
Files
ShaderParserExample.js
AnotherBadParamPuckShader.bck
BadParamPuckShader.bck
DisorderedParamPuckShader.bck
NoRendererPuckShader.bck
ArrayCnxPuck.pck
BogusPuckShader.pck
ColorShare.pck
WellorderedParamPuckShader.pck

Running the 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:

    Preset Manager

  • 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);
    

Keywords

This example uses the following keywords:

JScript example, JScript, RegisterShaderLanguageParser, QueryParserSettings, Parse, ParseInfo, ShaderDef, Context, GetSource