Yes I know that.
I don’t know how roblox handles the stuff internally, but I’m pretty sure they know how much light and what color is it at each voxel. This could just be exposed in the Lua API
It could of course be:
workspace.Terrain:GetLightCell(x, y, z)
or perhaps an additional return value for GetCell?
Another addition to this would be getting a table of all lightsources (that reach that point) with their lightstrength.
This would allow us to have (for example) light that heals a player, depending how strong the player is shined on.
(And if that property is enabled that makes part block light, have that be accounted for of course)
EDIT: A better example:
Having a survival game that uses temperature stuff.
A campfire’s light would produce a lot of heat, compared a flashlight, which might shine brighter but gives no heat.
It should be easier to implement this because it’s voxel based. I’m not entirely sure if this should be exposed though, because it might make it more difficult to upgrade lighting internals in the future.
Great idea! This would be really useful for stealth mechanics in games. I am concerned that a client’s graphics settings could have a profound effect on an API like this though. Personally, I think it might make more sense to have this as a method of Lighting instead.
Ignoring collisions, you could possibly just do radius-based calculations from each light object based on the light object range. I did that once for detecting light intensity. Of course, that ignores global game lighting, so not as useful.
Yes, and there are ways to get a close approximate but the ways are terribly inefficient and overly complicated when we could just have an API for revealing pre-existing values