Function for lamps to react to current local environment
tracked
Nescolet Resident
Would be nice to be able to add to lamps some script that allow them to detect the "light level" of current local environment, so for example, if I switch to midday sky these lamps will switch off and if I switch to midnight they will switch on automatically.
Log In
Alix Sable
I wrote a script that does this in my own lighting at home but naturally it has to work from the sun position in the parcel or region shared environment.
If it reacted to your personal viewer settings then if someone else was standing next to you with different environment settings how would it know which avatar’s environment to compare to?
If you would like the automatic light script contact me IW - same name.
Peter Stindberg
Nice idea, but your local settings ("if I switch to Midday") are local, only you see them, everyone else sees whatever settings they have.
One option would be to tie lamps to the Region time of day. Switching them on at night, and switching them off in the morning. This is possible already now, and some lights already do this.
Bleuhazenfurfle Resident
Peter Stindberg: Do the time of day commands actually work again yet? They were broken for a long time with the advent of EEP, and I have a feeling that might have been fixed relatively recently, but I'm not sure I ever bothered to check ("time of day" hasn't meant much, having been almost exclusively on a text viewer for about five years straight).
Peter Stindberg
Bleuhazenfurfle Resident I recently experimented with a friend for a while until we got it working. I forgot the exact solution, but the percentage-of-day function did the trick.
Nyx Onyx
Peter Stindberg Also LlGetSunRotation() could possibly be of interest, or llGetSunDirection(), which should reasonably work to determine if the sun is above the horizon, regardless of how the daycycle is set up. It's still on my todo-list to see how I can use these for my own purposes, if they even still work.
Peter Stindberg
Nyx Onyx We experimented with those, with mixed results. Sometimes they worked, sometimes they did not. There where countless "point at sun" cone prims littered all over, but none of them got it right all the time. So this "percentage of the day" (forgot the functon name) turned out to be the only one working reliably.
Contact Ivanova Shostakovich in-world if you want to know more.
Nyx Onyx
Peter Stindberg How interesting. Now I'm wondering if perhaps it would be possible for LL to introduce a LSL function that emulates the functionality of a photometer. It could return an integer or float ranging from "in total dark" up to "maximum light" (whatever that would mean, really), perhaps as a result of sampling at the four corners of its bounding box and returning the average. This could have parameters too, where you could set it to only detect ambient light, point lights, or both. But I am guessing this would be difficult to do - my guess is that this is only known within the render pipeline, and so the information needed is only available viewer side? In any case, thank you, Peter, for having already made the tests! It's unfortunate that "percentage of the day" solution is the only way to go, since not all daycycles are set up the same, the end user would be required to alter that percentage setting depending on their daycycle.
Peter Stindberg
Nyx Onyx The level of light you see is
individual to you
- no script will be able to detect that. I, for example, are almost always on Midnight, as I am photosensitive and can't stand too bright light. No script would be able to detect that.SL Feedback
tracked
SL Feedback
Hello, and thank you for your feature request regarding lamps reacting to the current local environment. This idea has been brought up in the past and is currently tracked. We understand the appeal of having lighting that adapts to different times of day, enhancing the realism and aesthetic of your Second Life experience. While we have no estimate on when this feature might be implemented, please keep an eye on future updates. We appreciate your input and hope you continue to share your ideas to help improve Second Life. Thank you!