Node

Used to define a render tree in the BeginText...EndText section of a MetaShader Renderer section.

Node specifies a node in the render tree of a MetaShader. Typically, a node is a subshader:

    Node "node_name" = guid "<guid_value>" ;

You can also use a Node statement to as an alias or a variable representing a constant value or an interface parameter:

    Node "node_name" = value <constant_value> ;
    Node "node_name" = interface "<parameter_name>" ;

| Assigning a constant value or interface parameter to a node is like using #define (or const) to define a constant instead of typing the value directly into your code in multiple places. For example, suppose you want to assign an interface parameter to a number of different subshader parameters. You can declare a node to represent that interface parameter, and then connect that node to the subshader parameters.

node_name

node_name is a local identifier used to refer to the subshader node in subsequent Connection statements. For example:

    Node "rayswitch" = guid "{8604221E-BCFA-11D1-90E9-0000F804EB21}";
    ...

    Connection "rayswitch::reflection" = "reflect";
    Connection "rayswitch::shadow" = "shadow";
    Connection "rayswitch::photon" = "photon";

guid

The guid identifies the phenomenon that implements the subshader. This is the GUID specified by the Reference statement at the top of the phenomenon’s SPDL file. For example:

    # In sib_illum_lambert.spdl:
    SPDL
    Version = "2.0.0.0";
    Reference = "{6FD4A9B4-F0CD-11D1-8056-00A0C906835D}";
       PropertySet "sib_illum_lambert_params"
       {
           ...
       }
    END

    # In material-lambert.spdl:
    Node "lambert" = guid "{6FD4A9B4-F0CD-11D1-8056-00A0C906835D}";

value

Used in a Node statement, a constant value is assigned to a local variable. In Connection statements, using a constant value assigns a the specified value to the connection node directly. For example:

    # Declare whatever constant values you will need
    Node "myLimit" = value 2;
    Node "allOnes" = value 1.0 1.0 1.0 1.0;
    Node "initSetting" = value off;

    # And then you can use it in multiple places throughout the SPDL file, such as:
    Connection "mixer2::mode1" = "myLimit";
    Connection "mixer2::weight1" = "myLimit";
    Connection "mixer2::alpha1" = "allOnes";

    # Or you can explicitly assign values to the connection nodes:
    Connection "mixer2::mode1" = value 2;
    Connection "mixer2::weight1" = value 1.0 1.0 1.0 1.0;
    Connection "mixer2::alpha1" = value off;

interface

The interface keyword declares that the following string is the name of a parameters in the current SPDL file (declared in the PropertySet section). In the context of a Node expression, this sets up a kind of a variable to use if you have to refer to this parameter in multiple places. For Connections it allows you to establish a parameter-to-parameter connection between this and other shaders in the render tree:

    # Declaration of mode parameter
    PropertySet "phong_marble_params"
    {
       Parameter "mode" input
       { ... }
    }
    ...
    # Set up connections to other shader definitions
    Node "phong" = guid "{89C75826-BCFA-11D1-90E9-0000F804EB21}";
    Node "translucent" = guid "{E22730A1-BDD4-11D1-90EB-0000F804EB21}";

    # Create an alias for the parameter
    Node "mode" = interface "mode";
    ...
    # Connect the local mode parameter with mode parameters from other shaders
    Connection "phong::mode" = interface "mode";
    Connection "translucent::mode "= interface "mode";

Autodesk Softimage v7.5