Measure Brightness of Light on Actor

Hey all,

I have a stealth game where I’m trying to measure the amount of light falling on to a character as it moves around a level. First thought was that there might be some sort of blueprint node that would measure this but I couldn’t find one. Second thought was to raycast to get distance from lights but that seems overly complicated and expensive. Other research seems to involve measuring a volumetric lightmap or doing pixel sampling with a 2D scene capture. Everything I’ve found doesn’t happen to have a clear path that I’m able to follow.

Am I out of luck without diving into C++? Has anyone done anything similar?
Thanks

Any luck figuring this out? I am trying to create a game like Tenchu Z and this is a must have feature.

I was thinking on the scene capture too, so you can “measure” the color of a pixel of the character, having a scene capture 2D component camera infront of the character, for example.

I would use line traces personally. Doing GPU readbacks from sampling a render target is going to be very slow by comparison.

Great, but to ‘read’ what? (with the line trace I mean)

Trace from the character to the lightsource if the trace reaches the light then the character is lit, else it is in shadow. I’ve seen people trace from sockets attached to the character to get a better representation than using a single trace.

To determine the quantity of light hitting the character you would calculate that based on the light’s falloff and intensity.

Won’t account for indirect lighting.

There are tutorials all over youtube for this btw, and plugins on the marketplace.

2 Likes