Don't click here unless you want to be banned.

LSL Wiki : lighting

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org

Lighting


As of 1.10, the lighting model has been changed completely, moving from software rendering that further taxed the already-overworked CPU to hardware-based lighting that uses the GPU instead.

Under the current lighting system, the world is lit by the sun and moon and up to 6 object-based lights. It's important to design lighting systems in such a way as to reduce the chances of other users' lights turning off and on due to their distance from the camera.

The following needs to be changed:

SL light is used in various things and can be changed in different ways. Sims emit a light source (and cast shadow) based on the day-night light cycle (see llGetSunDirection--this is a "directional" light source, meaning it is equally bright all over the sim).

Light affects things in different ways. Because SL lighting is vertex-based, lights will only appear to be working if the light source is near a vertex, where it is brightest, fading away uniformly towards other vertices. Untextured prims/objects appear much brighter than textured ones due to the nature of hardware-based transform and lighting (T&L). Avatars remain very dark even when large, fully bright (not "full bright") white lights are shining directly on them. Hopefully this bug will be fixed soon. Particles also reflect light except when prelit due to being set to "glow" in their options.

A "Light" material-type prim/object acts as and uses a "point" light source.

Prelighting ("full bright" in SL) is where a prim/object is lit but does not actually emit a light source. However, SL's lit objects automatically become prelit yet also emit light. SL can fake full prelighting (but still emit an "invisible" light source that counts against framerate) by changing the color of side "0" (positive z-axis--"top") of a prim to black. (SL 1.9- only)

Functions

llGetPrimitiveParams
llGetSunDirection
Kliknij Tutaj
Resources
Read This
Blog Articles
Click Here
llParticleSystem
llSetPrimitiveParams


llSetPrimitiveParams Flags Effects
PRIM_FULLBRIGHT Makes all faces light up as if the object were a light
PRIM_MATERIAL, PRIM_MATERIAL_LIGHT Sets object material to light
PRIM_COLOR When used on side 0 (zero), changes color of light
PRIM_POINT_LIGHT Toggles light property and attributes: color, intensity, radius, and falloff.

There is no Example for Light Scripts available at this time.

Q: Why are we limited to only 6 lights at a time?
A: 8 lights is a common OpenGL/hardware limit, but it appears that the Lindens may have a system for dealing with more in the works.


Color | Material | Shadow
Comments [Hide comments/form]
Re-routed existing Wiki infrastructure around petrification caused by ACL policies attempted to be enforced by single individuals against the wishes of the Wiki community at large.

All individuals may modify this page, I will make no further edits to it except to correct hyperlinks, revert vandalism, and block vandals of this specific page from this specific page via ACL modifications, to prevent any accusations of being a biased party. If someone makes an improvement to this page, and requests ownership of it, I will transfer ownership to them if two other editors on this Wiki second their request.
-- WolfWings (2005-09-04 13:42:12)
Any updates to this page with 1.10 release? I am VERY interested in what scripting will be still useable after local-lighting goes into effect.
-- DoLpHpUn (2006-05-23 02:01:27)
1.10 breaks all old scripts that worked with lighting. Setting the Light material (now known as Fullbright(Legacy)) doesn't cause an object to emit light. Scripts to manipulate the new lighting can be written using llSetPrimitiveParams(), changing the PRIM_POINT_LIGHT flags.
-- ShirleyMarquez (2006-06-04 06:21:45)
Attach a comment to this page: