This has been suggested before, but the last time (that I could find) was in 2014, and I hardly think discussions from back then are really relevant now.
Simply put, I’m requesting some form of function to either get the parts affected by a light or get the lights that are affecting a part. Ideally, it’d be the latter of the two.
While it is technically possible to estimate the lighting of a given point, it is a.) inefficient and b.) irreliable.
This is something that you could do in lua (loop through all of your lighting objects) and it would be much more flexible to boot (exactly what kind of format would this be…?). So realistically, this isn’t something that’s going to happen.
Have you tried doing it in lua and have you had any of the problems you mentioned?
We can’t check light from the sun or lack of it due to shadows cast by other parts. @Sharksie (iirc) made something that estimated lighting at any given point including the sun and shadows from other parts, but it was slow and not something you’d want to update/check often.
Lighting level per cell. A method that returned the color of lighting (Color3) in cells would give enough information to be applied to most use cases.
No, I haven’t tried, but while searching to see if someone else had found a solution I found a library demo@Maximum_ADHD, and it was slow. It was visibly lagging the game while I was messing with it, and the code was fairly optimized (not heavily optimized, but it wasn’t infinitely looping or anything of that sort).
And because of the way dynamic lighting works, there are shadows. Different times of days will result in different shadows, and while it’s possible to get the angle and distance of a shadow given the angle of the sun (read: extremely easy), it adds in another calculation to something that is already constantly looping through every lighting instance in the game, slowing it down even further.
Just because something can be made in Lua, and be flexible, doesn’t mean it will be good or efficient. This is the same argument for canvas based drawing in GUIs.
Nah, the code in there could be done a lot better. I’ll try to update it now.
The current problem I noticed right away with my library, is that I’m not queuing lights outside of the GetAmbientHue function, rather I’m regathering all of the lights every time the function is called.
The fact remains, no matter how well you do this, it will still be slower than if ROBLOX had a function for it.
(If you could update it that would save me a lot of trouble. Currently working on something other than my main project just to avoid having to do what the library does, but I will eventually have to deal with it.)
It would be nice if we could evaluate the amount of light at a point [x,y,z]. So we could tell when a part is in a shadow cast by the sun. This might help you determine if a part is being effected by a light.