Brightness on location

Hey guys,

i’m looking for a solution to get the brighness on a location.
The aim is, to have a AI that know that it is in bright location or in the dark.

My first idea was to look for the next lights or spotlights and than get the radius and intensety of it. But what about shadows. So this is not a good soulution for me.
The Second idea was to make a line trace down and get the pixel color and brighness. But the trace result don’t give me that. I know, i can get the material, but then it has no light information.
The Third idea was to generate a map of the area, in like a texture (Dynamic Material)? And read that information out of it while calculate position to textur position. But is there a way to create a light map or maybe read the lightmap of the engine?

I think, all ideas was not good at all. So i decided to look here, i know here are a lot of masters and maybe one of you have already a good solution :slight_smile:

I’m happy for every hint i can get <3

Thanks guys,
Sam

That is a cool problem. :slight_smile: I am not doing anything like it but i would love to see the solution for it. I tried to find some but with no results.
One thing i can think of is something like your first idea. But it will take a lot o work if your levels are big.
You can add every light as part of actor and in that actor add the collision sphere and set its radius to the radius of the light so you can get overlap events from it .
As for the shadows, you can manually add some trigger zones in shadows but like i said it will take a lot of work and actually is almost stupid when i think of it. :wink:

Best regards
Kavaar