Roblox Engineers, Can we get a comment about what math you use to calculate the Umbra & Penumbra of Light Sources?

Prompt First, Examples second, and Usecase Last

This is a specific question for Roblox Engineers; as transparency in the graphics calculations for this may prove useful to a niche set of developers (which is why its a question as opposed to a Feature Request for an API addition)

In This post right here (Video Below as well)

We have a case where a developer wants to know if a user is being hit by a light-source. If you look to the sides of the light-source in the thumbnail you might notice the light tapers off into darkness according to the Range and Brightness properties of the given light source.

Generally speaking, the closest terms I can think of to match this are found in the image below:

If a developer wanted to calculate what brightness levels of an object they would have to sort of ‘tinker’ around with home-brewed math.

Can we get an answer as to how we should be properly calculating the Color/Brightness values of a light source’s Umbra/Penumbra?

Use cases:

  • Adjusting PostFX properties according to the lighting situation the Players-Camera finds itself in
  • NPC’s can have a better handle on visibility of Players/Objects in a unlit scene
  • Color Correction for UI can take place according to a players Camera view in a given scene

EDIT: I used this diagram and these terms to separate the ideas for the different zones of Brightness/color

EDIT 2: SurfaceLights and SpotLights were my main concern here

EDIT 3: For this post, I suppose Umbra refers to the ‘brightest threshold’ area of a light source

5 Likes

Now i dont know anything about this but i know of a game similar
https://www.roblox.com/games/4844849297/Silhouette&ved=2ahUKEwilnd-L4rr4AhVNIkQIHTyTDDsQjjh6BAgSEAE&usg=AOvVaw2I-p_Rt9kQ3Tt_wwq_cIxU

Only diff is it detects if you touch i lit surface.

I actually have made an open source light detection.
I just take the brightness and range into consideration and use some '“formula” that i made.

Also since the different behavior between the light instances i have to calculate the light detection differently.