r3frls
real/raytr/r3frls.h
r3raytr
Renderer's light source base class
r3Frbaseobject
R3CLID_FRBASEOBJECT
r3Frlightsource
R3CLID_FRLIGHTSOURCE - 455
Shadows, Color, WorldSize, Falloff, Radius, HasFixedPosition, Position, HasFiniteAngle, Angle, Direction, VolumeLighting, DiffuseOnly, HasFixedDirection, CreatesCaustics,
int R3RegisterFRLightSourceClass(R3APP *app);
R3FRLSM_CASTLIGHT
CASTLIGHT
R3FRLSM_CASTLIGHT
obj.CASTLIGHT();
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
Shadows
R3FRLSA_Shadows
Boolean
R3BOOL
if true, casts shadows
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
Color
R3FRLSA_Color
color of the light source
jsobj.SetColor(value);
R3FLOATCOLOR3 value = ...;
R3SetAttrs(r3obj, R3FRLSA_Color, value, R3TAG_END);
WorldSize
WorldSize
R3FRLSA_WorldSize
Number
R3FLOAT
diameter of the current scene, ray tracer gives it during optimizations
jsobj.SetWorldSize(value);
R3FLOAT value = ...;
R3SetAttrs(r3obj, R3FRLSA_WorldSize, value, R3TAG_END);
Falloff
Falloff
R3FRLSA_Falloff
Integer
R3INT
see defines below - defines how intensity drops as a function of distance
jsobj.SetFalloff(value);
R3INT value = ...;
R3SetAttrs(r3obj, R3FRLSA_Falloff, value, R3TAG_END);
Radius
Radius
R3FRLSA_Radius
Number
R3FLOAT
used to define space for fallof functions
jsobj.SetRadius(value);
R3FLOAT value = ...;
R3SetAttrs(r3obj, R3FRLSA_Radius, value, R3TAG_END);
HasFixedPosition
HasFixedPosition
R3FRLSA_HasFixedPosition
Integer
R3INT
read-only attr to find out optim. proprties
value = jsobj.GetHasFixedPosition();
R3INT value;
R3GetAttrs(r3obj, R3FRLSA_HasFixedPosition, &value, R3TAG_END);
Position
Position
R3FRLSA_Position
read-only attr for asking fixed position
value = jsobj.GetPosition();
R3VECTOR value;
R3GetAttrs(r3obj, R3FRLSA_Position, &value, R3TAG_END);
HasFiniteAngle
HasFiniteAngle
R3FRLSA_HasFiniteAngle
Integer
R3INT
read-only attr to find out optim. properties
value = jsobj.GetHasFiniteAngle();
R3INT value;
R3GetAttrs(r3obj, R3FRLSA_HasFiniteAngle, &value, R3TAG_END);
Angle
Angle
R3FRLSA_Angle
Number
R3FLOAT
read-only attr for asking spot angle
value = jsobj.GetAngle();
R3FLOAT value;
R3GetAttrs(r3obj, R3FRLSA_Angle, &value, R3TAG_END);
Direction
Direction
R3FRLSA_Direction
read-only attr for asking spot dir or fixed radiation dir
value = jsobj.GetDirection();
R3VECTOR value;
R3GetAttrs(r3obj, R3FRLSA_Direction, &value, R3TAG_END);
VolumeLighting
VolumeLighting
R3FRLSA_VolumeLighting
Boolean
R3BOOL
if true illuminates volume
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
DiffuseOnly
R3FRLSA_DiffuseOnly
Boolean
R3BOOL
if true only default diffuse shading is computed
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
HasFixedDirection
R3FRLSA_HasFixedDirection
Integer
R3INT
read-only attr to find out optim. proprties
value = jsobj.GetHasFixedDirection();
R3INT value;
R3GetAttrs(r3obj, R3FRLSA_HasFixedDirection, &value, R3TAG_END);
CreatesCaustics
CreatesCaustics
R3FRLSA_CreatesCaustics
Boolean
R3BOOL
read only, if TRUE then caustics are computed from R3FRLSA_Position or R3FRLSA_Direction (latter when R3FRLSA_HasFixedDirection=TRUE)
value = jsobj.GetCreatesCaustics();
R3BOOL value;
R3GetAttrs(r3obj, R3FRLSA_CreatesCaustics, &value, R3TAG_END);
additional parameter information for callback
Distange weight = falloff types
r3appobj *