r3frls

r3frls1d
r3frls2d
r3frls3d
r3frlsa
r3frlsd
r3frlsp
r3frlss

r3frls

Class

real/raytr/r3frls.h

Library

r3raytr

Description:

Renderer's light source base class

See Also

real/raytr/r3frbob.h

See Also

oops/r3matrix.h

Super Class

r3Frbaseobject

R3CLID_FRBASEOBJECT

JavaScript

r3Frlightsource

Class Identifier

R3CLID_FRLIGHTSOURCE - 455

Methods

CASTLIGHT,

Attributes

Shadows, Color, WorldSize, Falloff, Radius, HasFixedPosition, Position, HasFiniteAngle, Angle, Direction, VolumeLighting, DiffuseOnly, HasFixedDirection, CreatesCaustics,

Registration

int R3RegisterFRLightSourceClass(R3APP *app);

R3FRLSM_CASTLIGHT

Method

CASTLIGHT

Identifier

R3FRLSM_CASTLIGHT

JavaScript

obj.CASTLIGHT();

Description

The default lighting action done by this class in CASTLIGHT method is the following: * 1. The object sends R3FRLSM_EVALUATE message to itself with the same parameters * p1, p2, msg as in CASTLIGHT. The derived light source class should set its typical * information to lightray sample (=p1 param) and then inherit to the parent class. * The following channels should have valid values prior to inheriting: * - Ray direction - R3CLID_RAYCHANNEL. The direction of cast light ray. Set a unit vector! * - Distance - R3CLID_ZCHANNEL. From light ray origin to the target point given in * p2's R3CLID_ASCCHANNEL. * * 2. When the R3FRLSM_EVALUATE message receives this class, the class does the following actions: * - It initializes p1's R3CLID_ILMCHANNEL (light color). * - It moves the target point i.e. R3CLID_ASCCHANNELin p2 to the corresponding channel * in the lightray sample p1. * - It evaluates materials associated with the light source. * - Then it evaluates possible distance weighting function. * * 4. When control returns back from the parent class R3FRLSM_EVALUATE execution, the derived * light source class can find all relevant light information from the ray samples and can * perform whatever further modifications & tricks. * 5. After abovementioned steps, this class calls the appropriate callback function * given in the message parameter defined below. This illuminates the target point.

Shadows

Attribute

Shadows

Identifier

R3FRLSA_Shadows

JavaScript type

Boolean

C type

R3BOOL

Description

if true, casts shadows

Syntax


jsobj.SetShadows(value);
value = jsobj.GetShadows();


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

Color

Attribute

Color

Identifier

R3FRLSA_Color

Type

r3Vect

Description

color of the light source

Syntax


jsobj.SetColor(value);


R3FLOATCOLOR3 value = ...;
R3SetAttrs(r3obj, R3FRLSA_Color, value, R3TAG_END);

WorldSize

Attribute

WorldSize

Identifier

R3FRLSA_WorldSize

JavaScript type

Number

C type

R3FLOAT

Description

diameter of the current scene, ray tracer gives it during optimizations

Syntax


jsobj.SetWorldSize(value);


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

Falloff

Attribute

Falloff

Identifier

R3FRLSA_Falloff

JavaScript type

Integer

C type

R3INT

Description

see defines below - defines how intensity drops as a function of distance

Syntax


jsobj.SetFalloff(value);


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

Radius

Attribute

Radius

Identifier

R3FRLSA_Radius

JavaScript type

Number

C type

R3FLOAT

Description

used to define space for fallof functions

Syntax


jsobj.SetRadius(value);


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

HasFixedPosition

Attribute

HasFixedPosition

Identifier

R3FRLSA_HasFixedPosition

JavaScript type

Integer

C type

R3INT

Description

read-only attr to find out optim. proprties

Syntax


value = jsobj.GetHasFixedPosition();


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

Position

Attribute

Position

Identifier

R3FRLSA_Position

Type

r3Vect

Description

read-only attr for asking fixed position

Syntax


value = jsobj.GetPosition();


R3VECTOR value;
R3GetAttrs(r3obj, R3FRLSA_Position, &value, R3TAG_END);

HasFiniteAngle

Attribute

HasFiniteAngle

Identifier

R3FRLSA_HasFiniteAngle

JavaScript type

Integer

C type

R3INT

Description

read-only attr to find out optim. properties

Syntax


value = jsobj.GetHasFiniteAngle();


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

Angle

Attribute

Angle

Identifier

R3FRLSA_Angle

JavaScript type

Number

C type

R3FLOAT

Description

read-only attr for asking spot angle

Syntax


value = jsobj.GetAngle();


R3FLOAT value;
R3GetAttrs(r3obj, R3FRLSA_Angle, &value, R3TAG_END);

Direction

Attribute

Direction

Identifier

R3FRLSA_Direction

Type

r3Vect

Description

read-only attr for asking spot dir or fixed radiation dir

Syntax


value = jsobj.GetDirection();


R3VECTOR value;
R3GetAttrs(r3obj, R3FRLSA_Direction, &value, R3TAG_END);

VolumeLighting

Attribute

VolumeLighting

Identifier

R3FRLSA_VolumeLighting

JavaScript type

Boolean

C type

R3BOOL

Description

if true illuminates volume

Syntax


jsobj.SetVolumeLighting(value);
value = jsobj.GetVolumeLighting();


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

DiffuseOnly

Attribute

DiffuseOnly

Identifier

R3FRLSA_DiffuseOnly

JavaScript type

Boolean

C type

R3BOOL

Description

if true only default diffuse shading is computed

Syntax


jsobj.SetDiffuseOnly(value);
value = jsobj.GetDiffuseOnly();


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

HasFixedDirection

Attribute

HasFixedDirection

Identifier

R3FRLSA_HasFixedDirection

JavaScript type

Integer

C type

R3INT

Description

read-only attr to find out optim. proprties

Syntax


value = jsobj.GetHasFixedDirection();


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

CreatesCaustics

Attribute

CreatesCaustics

Identifier

R3FRLSA_CreatesCaustics

JavaScript type

Boolean

C type

R3BOOL

Description

read only, if TRUE then caustics are computed from R3FRLSA_Position or R3FRLSA_Direction (latter when R3FRLSA_HasFixedDirection=TRUE)

Syntax


value = jsobj.GetCreatesCaustics();


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

additional parameter information for callback

Distange weight = falloff types

R3LSDW_CONSTANT
R3LSDW_LOCAL
R3LSDW_INVLIN
R3LSDW_INVSQR


r3appobj *