r3mpleve

r3mpleve

Class

real/code/r3mpleve.h

Library

r3code

Description:

Base class for all hierarchical material shaders. Level shader defines new kind of 'material properties' called 'local variables'.

See Also

real/code/r3matprp.h

Super Class

r3Matprop

R3CLID_MATPROP

JavaScript

r3Mplevel

Class Identifier

R3CLID_MPLEVEL - 396

Methods

_WAS_ENUMVARIABLES, _WAS_NEWVARIABLE, _WAS_DELVARIABLE, _WAS_RENAMEVARIABLE, _WAS_SETVARIABLETYP, _WAS_GETVARIABLETYP, ENUMSTACKITEMS, INSERTPROP, SETPARENT, INSERT, ADDHEAD, ADDTAIL, REMOVE,

Attributes

Children, Variables, StackTotalCount, StackLocalCount, Open, StackLocalInitValue, EvaluateSuper, PublicAttrCount, PublicAttrChannels, PublicAttrNames, InitVarCount,

Registration

int R3RegisterMPLevelClass(R3APP *app);

R3MPLEVM__WAS_ENUMVARIABLES

Method

_WAS_ENUMVARIABLES

Identifier

R3MPLEVM__WAS_ENUMVARIABLES

Param 1:

R3OBJ*, callback object

Param 2:

R3INT, callback method

Param 3:

void*, user specific data

JavaScript

obj._WAS_ENUMVARIABLES(p1, p2, p3);

Description

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

R3MPLEVM__WAS_NEWVARIABLE

Method

_WAS_NEWVARIABLE

Identifier

R3MPLEVM__WAS_NEWVARIABLE

Return

R3INT, variable id unique in this shader

Param 1:

char*, name for the variable

Param 2:

R3INT, type id

Param 3:

R3INT, see codes below

JavaScript

rc = obj._WAS_NEWVARIABLE(p1, p2, p3);

Description

Create a new local variable for the shader

R3MPLEVM__WAS_DELVARIABLE

Method

_WAS_DELVARIABLE

Identifier

R3MPLEVM__WAS_DELVARIABLE

Return

R3BOOL, TRUE if found

JavaScript

rc = obj._WAS_DELVARIABLE();

Description

Delete local variable

R3MPLEVM__WAS_RENAMEVARIABLE

Method

_WAS_RENAMEVARIABLE

Identifier

R3MPLEVM__WAS_RENAMEVARIABLE

Return

R3BOOL, TRUE if found

JavaScript

rc = obj._WAS_RENAMEVARIABLE();

Description

Rename local variable

R3MPLEVM__WAS_SETVARIABLETYP

Method

_WAS_SETVARIABLETYP

Identifier

R3MPLEVM__WAS_SETVARIABLETYP

Return

R3BOOL, TRUE if found

Param 3:

R3INT, type id

JavaScript

rc = obj._WAS_SETVARIABLETYP(p3);

Description

Change the type of local variable

R3MPLEVM__WAS_GETVARIABLETYP

Method

_WAS_GETVARIABLETYP

Identifier

R3MPLEVM__WAS_GETVARIABLETYP

Return

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

JavaScript

rc = obj._WAS_GETVARIABLETYP();

Description

Change the type of local variable

R3MPLEVM_ENUMSTACKITEMS

Method

ENUMSTACKITEMS

Identifier

R3MPLEVM_ENUMSTACKITEMS

Param 1:

R3OBJ*, callback object

Param 2:

R3INT, callback method

Param 3:

R3TAG*

JavaScript

obj.ENUMSTACKITEMS(p1, p2, p3);

Description

Enumerates defined local stack items. The callback method is sent as follows: R3Do3((R3OBJ *)p1, (R3INT)p2, char *name, (R3INT)id, R3MPLEVA_StackCallDepth, depth, R3MATPRPA_OutputType, type, R3MATPRPA_OutputChannel, channel_clid, R3MATPRPA_OutputIdentifier, id, R3RA_HookData, context, R3TAG_END);

R3MPLEVM_INSERTPROP

Method

INSERTPROP

Identifier

R3MPLEVM_INSERTPROP

Return

R3OBJ*, address of the shader object or NULL if failed

Param 1:

R3OBJ*, if not NULL insert child after this. if p1 == obj then insert child as the 1st shader.

Param 3:

R3OBJ*, child shader

JavaScript

rc = obj.INSERTPROP(p1, p3);

Description

Insert a shader under parent

R3MPLEVCM_SETPARENT

Method

SETPARENT

Identifier

R3MPLEVCM_SETPARENT

Param 1:

R3OBJ*, old parent

Param 2:

R3OBJ*, new parent

Param 3:

R3OBJ*, child whose parent is to be changed.

JavaScript

obj.SETPARENT(p1, p2, p3);

Description

callback method for R3MATPRPCA_SetParentXxx.

R3MPLEVM_INSERT

Method

INSERT

Identifier

R3MPLEVM_INSERT

Return

R3BOOL, true of node was found

Param 1:

R3BOOL, don't send childchanged method

Param 2:

R3OBJ*, previous object

Param 3:

R3OBJ*, object to be inserted

JavaScript

rc = obj.INSERT(p1, p2, p3);

Description

Insert new object after the given node

R3MPLEVM_ADDHEAD

Method

ADDHEAD

Identifier

R3MPLEVM_ADDHEAD

Param 1:

R3BOOL, don't send childchanged method

Param 3:

R3OBJ*, object to be inserted

JavaScript

obj.ADDHEAD(p1, p3);

Description

Insert given object to the head of the children list

R3MPLEVM_ADDTAIL

Method

ADDTAIL

Identifier

R3MPLEVM_ADDTAIL

Param 1:

R3BOOL, don't send childchanged method

Param 3:

R3OBJ*, address of the object to be inserted

JavaScript

obj.ADDTAIL(p1, p3);

Description

Inserts new sub object at the head of the children list

R3MPLEVM_REMOVE

Method

REMOVE

Identifier

R3MPLEVM_REMOVE

Param 3:

R3OBJ*, sub object to be removed

JavaScript

obj.REMOVE(p3);

Description

Remove the given children from the children list

Children

Attribute

Children

Identifier

R3MPLEVA_Children

JavaScript type

r3List

C type

R3LIST*

Description

list of sub-shaders

Syntax


value = jsobj.GetChildren();


R3LIST* value;
R3GetAttrs(r3obj, R3MPLEVA_Children, &value, R3TAG_END);

Variables

Attribute

Variables

Identifier

R3MPLEVA_Variables

JavaScript type

r3List

C type

R3LIST

Description

list of variables

Syntax


jsobj.SetVariables(value);


R3LIST value = ...;
R3SetAttrs(r3obj, R3MPLEVA_Variables, value, R3TAG_END);

StackTotalCount

Attribute

StackTotalCount

Identifier

R3MPLEVA_StackTotalCount

JavaScript type

Integer

C type

R3INT

Description

number of items in rendering stack (retval,params,...,locals)

Syntax


value = jsobj.GetStackTotalCount();


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

StackLocalCount

Attribute

StackLocalCount

Identifier

R3MPLEVA_StackLocalCount

JavaScript type

Integer

C type

R3INT

Description

number of local variables in rendering stack

Syntax


value = jsobj.GetStackLocalCount();


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

Open

Attribute

Open

Identifier

R3MPLEVA_Open

JavaScript type

Boolean

C type

R3BOOL

Description

show child objects

Syntax


jsobj.SetOpen(value);
value = jsobj.GetOpen();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3MPLEVA_Open, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3MPLEVA_Open, &value, R3TAG_END);

StackLocalInitValue

Attribute

StackLocalInitValue

Identifier

R3MPLEVA_StackLocalInitValue

JavaScript type

String

C type

void*

Description

Reads R3MPLEVA_StackLocalCount init values of child variables to given vector array

Syntax


value = jsobj.GetStackLocalInitValue();


void* value;
R3GetAttrs(r3obj, R3MPLEVA_StackLocalInitValues, &value, R3TAG_END);

EvaluateSuper

Attribute

EvaluateSuper

Identifier

R3MPLEVA_EvaluateSuper

JavaScript type

Boolean

C type

R3BOOL

Description

TRUE if the class computes a shading action (not just a level construct)

Syntax


value = jsobj.GetEvaluateSuper();


R3BOOL value;
R3GetAttrs(r3obj, R3MPLEVA_EvaluateSuper, &value, R3TAG_END);

PublicAttrCount

Attribute

PublicAttrCount

Identifier

R3MPLEVA_PublicAttrCount

JavaScript type

Integer

C type

R3INT

Description

Syntax


value = jsobj.GetPublicAttrCount();


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

PublicAttrChannels

Attribute

PublicAttrChannels

Identifier

R3MPLEVA_PublicAttrChannels

JavaScript type

String

C type

void*

Description

R3CLID *, array of channel clids defining the pubattr type

Syntax


value = jsobj.GetPublicAttrChannels();


void* value;
R3GetAttrs(r3obj, R3MPLEVA_PublicAttrChannels, &value, R3TAG_END);

PublicAttrNames

Attribute

PublicAttrNames

Identifier

R3MPLEVA_PublicAttrNames

JavaScript type

String

C type

void*

Description

array of names

Syntax


value = jsobj.GetPublicAttrNames();


void* value;
R3GetAttrs(r3obj, R3MPLEVA_PublicAttrNames, &value, R3TAG_END);

InitVarCount

Attribute

InitVarCount

Identifier

R3MPLEVA_InitVarCount

JavaScript type

Integer

C type

R3INT

Description

number of initialized local variables

Syntax


value = jsobj.GetInitVarCount();


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

Codes for the NEWVARIABLE/p3 parameter

R3MPVAR_STATIC
R3MPVAR_AUTO

Tags

Tags

R3MPLEVA_StackCallDepth