r3rmprop

r3rmprop

Class

real/raytr/r3rmprop.h

Library

r3raytr

Description:

Renderer's material property base class (also called shader base class) A renderer material property has one major function: to evaluate the value of a channel/variable.

See Also

real/raytr/r3mapsrc.h

Super Class

r3Frmapsource

R3CLID_FRMAPSOURCE

JavaScript

r3Rmatprop

Class Identifier

R3CLID_RMATPROP - 418

Methods

EVALUATE, EVALBYPARAM, PHASECHECK,

Attributes

OutputChannel, OutputName, OutputType, OutputSubCount, InputChannels, InputNames, InputCnt, InputTypes, InputSubCounts, Operation, AntiAlias, Normalize, TransformToMappingSpa, AntiAliasStart, OutputIndex, OutputOffset, InputIndices, InputOffsets, CastFloatParams, InputSubChannels, OutputSubChannel, CallbackMethod, CallbackObject, ChangesInputs,

Registration

int R3RegisterRMatPropClass(R3APP *app);

R3RMPM_EVALUATE

Method

EVALUATE

Identifier

R3RMPM_EVALUATE

Param 1:

R3INT, phase to be evaluated

Param 2:

R3OBJ*, parent mapping object.

JavaScript

obj.EVALUATE(p1, p2, 0);

Description

evaluate the object at given phase

R3RMPM_EVALBYPARAM

Method

EVALBYPARAM

Identifier

R3RMPM_EVALBYPARAM

Return

R3BOOL, TRUE if evaluation succeeded

Param 1:

R3FLOAT, Result channel

JavaScript

rc = obj.EVALBYPARAM(p1, 0);

Description

When this base class receives R3RMPM_EVALUATE, it computes the address of the target and input channels and sends this message to the object. So, when your custom prop receives R3RMPM_EVALUATE, you may let the super class to handle it. Then your object will receive this message sent by this basic class. The basic property class may send several R3RMPM_EVALBYPARAM calls originating from one R3RMPM_EVALUATE in order to do anti-aliasing. The basic property class takes care of using correct operation type i.e. replacing the previous channel value, summing it etc.

R3RMPM_PHASECHECK

Method

PHASECHECK

Identifier

R3RMPM_PHASECHECK

Param 1:

char**, pointer to error message pointer

Param 3:

R3INT, active phases from the parent objects

JavaScript

obj.PHASECHECK(p1, p3);

Description

phase related error checking after channel link. * Return FALSE if object is in invalid state (the object is not suitable for use in the specified phase)

OutputChannel

Attribute

OutputChannel

Identifier

R3RMPA_OutputChannel

JavaScript type

Integer

C type

R3INT

Description

class id of the output channel

Syntax


value = jsobj.GetOutputChannel();


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

OutputName

Attribute

OutputName

Identifier

R3RMPA_OutputName

JavaScript type

String

C type

char*

Description

name of the output channel

Syntax


value = jsobj.GetOutputName();


char* value;
R3GetAttrs(r3obj, R3RMPA_OutputName, &value, R3TAG_END);

OutputType

Attribute

OutputType

Identifier

R3RMPA_OutputType

JavaScript type

Integer

C type

R3INT

Description

type code (see enum below) for the output channel

Syntax


value = jsobj.GetOutputType();


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

OutputSubCount

Attribute

OutputSubCount

Identifier

R3RMPA_OutputSubCount

JavaScript type

Integer

C type

R3INT

Description

(read-only) sub count of the output channel

Syntax


value = jsobj.GetOutputSubCount();


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

InputChannels

Attribute

InputChannels

Identifier

R3RMPA_InputChannels

JavaScript type

Integer

C type

int*

Description

array of class id of the input channels

Syntax


value = jsobj.GetInputChannels();


int* value;
R3GetAttrs(r3obj, R3RMPA_InputChannels, &value, R3TAG_END);

InputNames

Attribute

InputNames

Identifier

R3RMPA_InputNames

JavaScript type

String

C type

char**

Description

array of input channel names

Syntax


value = jsobj.GetInputNames();


char** value;
R3GetAttrs(r3obj, R3RMPA_InputNames, &value, R3TAG_END);

InputCnt

Attribute

InputCnt

Identifier

R3RMPA_InputCnt

JavaScript type

Integer

C type

R3INT

Description

number of input channels

Syntax


value = jsobj.GetInputCnt();


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

InputTypes

Attribute

InputTypes

Identifier

R3RMPA_InputTypes

JavaScript type

Integer

C type

int*

Description

array of type codes (see enum below) for the input channel

Syntax


value = jsobj.GetInputTypes();


int* value;
R3GetAttrs(r3obj, R3RMPA_InputTypes, &value, R3TAG_END);

InputSubCounts

Attribute

InputSubCounts

Identifier

R3RMPA_InputSubCounts

JavaScript type

Integer

C type

int*

Description

array of sub counts for the input channels. Read only

Syntax


value = jsobj.GetInputSubCounts();


int* value;
R3GetAttrs(r3obj, R3RMPA_InputSubCounts, &value, R3TAG_END);

Operation

Attribute

Operation

Identifier

R3RMPA_Operation

JavaScript type

Integer

C type

R3INT

Description

see operation codes below

Syntax


jsobj.SetOperation(value);
value = jsobj.GetOperation();


R3INT value = ...;
R3SetAttrs(r3obj, R3RMPA_Operation, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3RMPA_Operation, &value, R3TAG_END);

AntiAlias

Attribute

AntiAlias

Identifier

R3RMPA_AntiAlias

JavaScript type

Number

C type

R3FLOAT

Description

value 0.0 ... infinity, the higher the value, the higher the antialiasing level

Syntax


jsobj.SetAntiAlias(value);


R3FLOAT value = ...;
R3SetAttrs(r3obj, R3RMPA_AntiAlias, value, R3TAG_END);

Normalize

Attribute

Normalize

Identifier

R3RMPA_Normalize

JavaScript type

Boolean

C type

R3BOOL

Description

if set, result channel is normalized

Syntax


jsobj.SetNormalize(value);
value = jsobj.GetNormalize();


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

TransformToMappingSpa

Attribute

TransformToMappingSpa

Identifier

R3RMPA_TransformToMappingSpa

JavaScript type

Boolean

C type

R3BOOL

Description

if set, result is transformed to material space

Syntax


jsobj.SetTransformToMappingSpa(value);
value = jsobj.GetTransformToMappingSpa();


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

AntiAliasStart

Attribute

AntiAliasStart

Identifier

R3RMPA_AntiAliasStart

JavaScript type

Number

C type

R3FLOAT

Description

value 0.0 ... infinity, the lower the value, the easier a_a starts

Syntax


jsobj.SetAntiAliasStart(value);


R3FLOAT value = ...;
R3SetAttrs(r3obj, R3RMPA_AntiAliasStart, value, R3TAG_END);

OutputIndex

Attribute

OutputIndex

Identifier

R3RMPA_OutputIndex

JavaScript type

Integer

C type

R3INT

Description

read-only. 'Compiled' output data selector

Syntax


value = jsobj.GetOutputIndex();


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

OutputOffset

Attribute

OutputOffset

Identifier

R3RMPA_OutputOffset

JavaScript type

Integer

C type

R3INT

Description

read-only. 'Compiled' output data offset

Syntax


value = jsobj.GetOutputOffset();


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

InputIndices

Attribute

InputIndices

Identifier

R3RMPA_InputIndices

JavaScript type

Integer

C type

int*

Description

read-only

Syntax


value = jsobj.GetInputIndices();


int* value;
R3GetAttrs(r3obj, R3RMPA_InputIndices, &value, R3TAG_END);

InputOffsets

Attribute

InputOffsets

Identifier

R3RMPA_InputOffsets

JavaScript type

Integer

C type

int*

Description

read-only

Syntax


value = jsobj.GetInputOffsets();


int* value;
R3GetAttrs(r3obj, R3RMPA_InputOffsets, &value, R3TAG_END);

CastFloatParams

Attribute

CastFloatParams

Identifier

R3RMPA_CastFloatParams

JavaScript type

Boolean

C type

R3BOOL

Description

read-only, TRUE if called should cast float params to vectors

Syntax


value = jsobj.GetCastFloatParams();


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

InputSubChannels

Attribute

InputSubChannels

Identifier

R3RMPA_InputSubChannels

JavaScript type

Integer

C type

int*

Description

input sub channel selections. 0=input all sub channels, 1-3=input a selected sub channel.

Syntax


value = jsobj.GetInputSubChannels();


int* value;
R3GetAttrs(r3obj, R3RMPA_InputSubChannels, &value, R3TAG_END);

OutputSubChannel

Attribute

OutputSubChannel

Identifier

R3RMPA_OutputSubChannel

JavaScript type

Integer

C type

int

Description

output sub channel selection. 0=write to all sub channels of the output, 1-3=output to a selected sub channel.

Syntax


value = jsobj.GetOutputSubChannel();


int value;
R3GetAttrs(r3obj, R3RMPA_OutputSubChannel, &value, R3TAG_END);

CallbackMethod

Attribute

CallbackMethod

Identifier

R3RMPA_CallbackMethod

JavaScript type

Integer

C type

R3INT

Description

Syntax


jsobj.SetCallbackMethod(value);


R3INT value = ...;
R3SetAttrs(r3obj, R3RMPA_CallbackMethod, value, R3TAG_END);

CallbackObject

Attribute

CallbackObject

Identifier

R3RMPA_CallbackObject

JavaScript type

Object

C type

R3OBJ*

Description

callback hook. Called from EVALUATE method

Syntax


jsobj.SetCallbackObject(value);


R3OBJ* value = ...;
R3SetAttrs(r3obj, R3RMPA_CallbackObject, value, R3TAG_END);

ChangesInputs

Attribute

ChangesInputs

Identifier

R3RMPA_ChangesInputs

JavaScript type

Boolean

C type

R3BOOL

Description

set to TRUE if object outputs data via its input channels

Syntax


value = jsobj.GetChangesInputs();


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

I/O target types:

R3RMP_PARAMS
R3RMP_RAYSAMPLE
R3RMP_RAYSAMPLE2

In EVALUATE message, the parameter p3 points to a NULL terminated array of pointers to data sections. Each section is specified by the enumeration below. These defines can be used to index the array.

/

R3STACKINDEX_PARAMS
R3STACKINDEX_FIRSTRAYSAMPLE

This macro finds a data item from the p3 parameter set of EVALUATE method, when R3RMPA_Input(Output)Index (one of defs above) and R3RMPA_Input(Output)Offset is known.

Values for Operation (see inccode 3matprp.h)

R3RMPOP_ASSIGN
R3RMPOP_ADD
R3RMPOP_SUBTRACT
R3RMPOP_MULTIPLY
R3RMPOP_DIVIDE
R3RMPOP_MIN
R3RMPOP_MAX
R3RMPOP_ABS

Tags

Tags

R3RMPA_OutputIdentifier
R3RMPA_OutputSelector
R3RMPA_InputIdentifiers
R3RMPA_InputSelectors