Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The full implementation of GetParamTable() for this plugin would look something like this:

Code Block
languagecpp
RixSCParamInfo const *
MyPattern::GetParamTable()
{
    static RixSCParamInfo s_ptable[] =
    {
        // outputs
        RixSCParamInfo("resultC", k_RixSCColor, k_RixSCOutput),
        // inputs
        RixSCParamInfo("density", k_RixSCFloat),
        RixSCParamInfo("placementMatrix", k_RixSCFloat, k_RixSCInput, 16),
        RixSCParamInfo(), // end of table
    };
    return &s_ptable[0];
}

The ordinal position of a parameter in the parameter table is the integer paramId used to evaluate parameter inputs using the RixShadingContext::EvalParam method. Because these need to be kept in sync, it is recommended that you create a parameter enumeration to keep track of the order that your parameters were created in the table. The enumeration can be used later on when calling RixShadingContext::EvalParam  in the body of the shader. Following the three parameter table entries above:

Code Block
languagecpp
enum paramId
{
    k_resultC=0, // output
    k_density,
    k_placementMatrix,
    k_numParams
};


Anchor
synchronization
synchronization
Synchronization

...