I am trying to get a clear example of how to set up a light that actually illuminates other objects (say at midnight) in SL I have read through the wiki and searched all the lighting stuff I could find, but it still doesn't work. below is the DoLight fragment of my code. I assign the values of the variables elsewhere. The lights turn on and off, but I am having a problem getting the difference between a "light source" (that illuminates the area around the light) and the LightBright parameter for prim surfaces, which just make the prim as bright as possible.
Any help would be great.
CODE
//this is a lighting script that turns on lights that are listening for the message
//from channel 0
vector LightColor= < .5,1,1>; //default color is light yellow
integer LightBright = FALSE;
//TRUE = light color is fullbright; FALSE = Light color is not fullbright;
integer LightState = FALSE;
//TRUE = Lights cast light; FALSE = Lights glow
DoLights() {
if (LightState == FALSE and LightBright == FALSE) { //lights are off - light gray
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <.8,.8,.8>, 0.75]);
}
else { //set the color to the LightColor color
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, LightColor, 0.75]);
}
// determine if the light is light emitting or just a bright material
if (LightState == FALSE) {
//Set the prim material to glass (not light emitting
llSetPrimitiveParams([PRIM_MATERIAL, PRIM_MATERIAL_GLASS]);
llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, <1, 1, 1>, 1.0, 10.0, 0.75]);
}
else {
//Set the prim material to light emitting
llSetPrimitiveParams([PRIM_MATERIAL, PRIM_MATERIAL_LIGHT]);
llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1, 1, 1>, 1.0, 10.0, 0.75]);
}
//color fullbright or not depending on value of LightBright
llSetPrimitiveParams([PRIM_FULLBRIGHT, ALL_SIDES, LightBright]);
}