r3mpproc

r3mpproc

Class

real/code/r3mpproc.h

Library

r3code

Description:

Procedure body shader. This shader is a level which defines new kind of 'material properties' called 'parameters'. The shader coan constain any number of sub shaders. This shader corresponds to 'functions' in programming languages.

See Also

real/code/r3mpleve.h

Super Class

r3Mplevel

R3CLID_MPLEVEL

JavaScript

r3Mpprocedure

Class Identifier

R3CLID_MPPROCEDURE - 822

Methods

ENUMPARAMETERS, NEWPARAMETER, DELPARAMETER, RENAMEPARAMETER, SETPARAMETERTYPE, GETPARAMETERTYPE, UPDATECHILDRENCALL,

Attributes

Parameters, CallName, StackParamCount,

Registration

int R3RegisterMPProcedureClass(R3APP *app);

R3MPPROCM_ENUMPARAMETERS

Method

ENUMPARAMETERS

Identifier

R3MPPROCM_ENUMPARAMETERS

Param 1:

R3OBJ*, callback object

Param 2:

R3INT, callback method

Param 3:

void*, user specific data

JavaScript

obj.ENUMPARAMETERS(p1, p2, p3);

Description

Enumerates defined parameters. The callback method is send as follows: R3SendMsgA3((R3OBJ *)p1, (R3INT)p2, char *name, (R3INT)id, (void *)msg);

R3MPPROCM_NEWPARAMETER

Method

NEWPARAMETER

Identifier

R3MPPROCM_NEWPARAMETER

Return

R3INT, parameter id unique in this shader

Param 1:

char*, name for the parameter

Param 3:

R3INT, type id

JavaScript

rc = obj.NEWPARAMETER(p1, p3);

Description

Create a new parameter for the shader

R3MPPROCM_DELPARAMETER

Method

DELPARAMETER

Identifier

R3MPPROCM_DELPARAMETER

Return

R3BOOL, TRUE if found

JavaScript

rc = obj.DELPARAMETER();

Description

Delete parameter

R3MPPROCM_RENAMEPARAMETER

Method

RENAMEPARAMETER

Identifier

R3MPPROCM_RENAMEPARAMETER

Return

R3BOOL, TRUE if found

JavaScript

rc = obj.RENAMEPARAMETER();

Description

Rename parameter

R3MPPROCM_SETPARAMETERTYPE

Method

SETPARAMETERTYPE

Identifier

R3MPPROCM_SETPARAMETERTYPE

Return

R3BOOL, TRUE if found

Param 3:

R3INT, type id

JavaScript

rc = obj.SETPARAMETERTYPE(p3);

Description

Change the type of parameter

R3MPPROCM_GETPARAMETERTYPE

Method

GETPARAMETERTYPE

Identifier

R3MPPROCM_GETPARAMETERTYPE

Return

R3INT, type id of the parameter, or NULL if a parameter with the given name is not defined

JavaScript

rc = obj.GETPARAMETERTYPE();

Description

Change the type of parameter

R3MATPRPM_UPDATECHILDRENCALL

Method

UPDATECHILDRENCALL

Identifier

R3MATPRPM_UPDATECHILDRENCALL

JavaScript

obj.UPDATECHILDRENCALL();

Description

used internally to notify children that they should update their name

Parameters

Attribute

Parameters

Identifier

R3MPPROCA_Parameters

JavaScript type

r3List

C type

R3LIST*

Description

list of procedure parameters

Syntax


jsobj.SetParameters(value);
value = jsobj.GetParameters();


R3LIST* value = ...;
R3SetAttrs(r3obj, R3MPPROCA_Parameters, value, R3TAG_END);
R3LIST* value;
R3GetAttrs(r3obj, R3MPPROCA_Parameters, &value, R3TAG_END);

CallName

Attribute

CallName

Identifier

R3MPPROCA_CallName

JavaScript type

String

C type

char*

Description

call name

Syntax


jsobj.SetCallName(value);
value = jsobj.GetCallName();


char* value = ...;
R3SetAttrs(r3obj, R3MPPROCA_CallName, value, R3TAG_END);
char* value;
R3GetAttrs(r3obj, R3MPPROCA_CallName, &value, R3TAG_END);

StackParamCount

Attribute

StackParamCount

Identifier

R3MPPROCA_StackParamCount

JavaScript type

Integer

C type

R3INT

Description

number of local parameters in rendering stack

Syntax


value = jsobj.GetStackParamCount();


R3INT value;
R3GetAttrs(r3obj, R3MPPROCA_StackParamCount, &value, R3TAG_END);