Request: Blueprint node to detect shadows

I have a big obsession into dynamic shadows in games. Would be great to be able to use blueprint node to detect if location is in shadow. Or maybe even actor making the node return float value between 0 and 1.

Would allow adding old thief/deus ex style gameplay where player could hide in shadows. With static shadows you could already use placed triggers, but especially would like to see this working in dynamic enviroment with dynamic shadows.

Deriving this from the actual shadowmaps of an dynamic light would be a pain, but you could try this:

  • Check if your object is within the radius of a dynamic light, if so do the next steps per light:
  • Trace from your object to the light source.
  • If you hit something in between, you are in shadow, if not you are in the light.

Note that this would not handle partial coverage well. If you need that, you might want to consider multiple traces spread over your object and averaging the result to get a range value.

for further accuracy you could also apply an inverse square falloff to the trace length to match the light’s attenuation.

Thanks :slight_smile: will try that.