See if an object is in a 'shadow' area.

Is there a way for us to register whether or not a pawn is receiving direct light from a specific light source?

We effectively have two player pawns, one is casting light and the other is not. We want to be able to tell if the non-casting sphere is being lit by the light from the casting sphere. Is there an easy way to do that? Open to any suggestions!

if it’s just sphere on both, it might be easier. I’ll assume that your light casting sphere have certain decay, so the light volume in between your light and shadow receiving sphere is sort of like a cone with sphere cap, where your end/cap radius is the radius of receiving sphere.

you can then do properly distributed single line trace to check if receiving sphere is being hit. if your scene shadow casting geo are not complex shape, you can get away with really low sample amount.

if it’s 2d and have multiple casting source, then build shadow volumn is more efficient.

In the end we did a line trace and it worked perfectly, just had to think about the idea a bit more. We would cut it off after a certain distance.

By some stroke of luck our two ‘pawns’ ended up being spheres, so wasn’t too complicated to do the trace :slight_smile: