Phenomenon Definitions

Phenomena are declared after all the subshaders to be used inside the phenomenon have been declared. Inside the phenomenon, subshaders will be defined, complete with shader name and parameters. Parameters may have constant values, like in a regular shader definition, or they may have subshaders assigned to them, or they may have phenomenon interface parameters assigned to them. It is important to understand that the phenomenon declaration contains shader definitions.

mi_api_phen_begin
    miFunction_decl *mi_api_phen_begin(
        miParameter     *outparms, /* one of miTYPE_* */
        char            *name,     /* phenomenon name */
        miParameter     *inparms)  /* parameter list */

Begin the declaration of a new phenomenon name, along with its result and input parameters that must have been previously built with calls to mi_api_parameter_decl, mi_api_parameter_append, and mi_api_parameter_child.

mi_api_phen_end
    miTag mi_api_phen_end(void)

After the declaration returned by the previous function has been set up, this function terminates the phenomenon declaration. If an error occurs, a null tag is returned; otherwise the tag of the new phenomenon element is returned. The type of the returned element is miSCENE_FUNCDECL.

Copyright © 1986-2009 by mental images GmbH