Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Lighting Issues

Valradica Vanek
Registered User
Join date: 1 Aug 2006
Posts: 78
09-27-2006 13:25
I already posted this to the building forum, and it was suggested I post it here for help with the script.

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]);
}
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
09-27-2006 16:44
Check the PRIM_POINT_LIGHT parameters on this wiki page:
http://www.lslwiki.com/lslwiki/wakka.php?wakka=llSetPrimitiveParams
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
09-27-2006 16:53
Try removing the line:
llSetPrimitiveParams([PRIM_MATERIAL, PRIM_MATERIAL_LIGHT]);

PRIM_MATERIAL_LIGHT was the old point-light method, and was disabled.. maybe turning both the material light and the point light on... cancels the effect?
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
09-27-2006 19:43
From: DoteDote Edison
Try removing the line:
llSetPrimitiveParams([PRIM_MATERIAL, PRIM_MATERIAL_LIGHT]);

PRIM_MATERIAL_LIGHT was the old point-light method, and was disabled.. maybe turning both the material light and the point light on... cancels the effect?



Use [PRIM_FULLBRIGHT, ALL_SIDES, TRUE] now to give the same effect.
_____________________