How 'lit' is a Hull?


For stealth systems, it'd be helpful to have some sort of system in place that takes a Vector2 and determines how lit that point is.

Let's say I've got a light with range 20 and intensity 0.3, and a character's ShadowHull at the far reach of that light. The hull returns 0.01f. Closer to the source of the light, it's 1.0f.

This way, it's easy to determine whether or not a character is concealed in darkness, or lit up and visible.


xixonia wrote Apr 5, 2011 at 2:45 PM

There's a few variables to this problem. To name a few:
  • What is the intensity of the light at a given distance from the light?
    ** This is a simple question, if you're using the build in light texture generator, but what if someone has provided their own texture? This cannot be determined using a linear function at that point. Or at least, there would be a need to provide the user with their own way of supply a linear function (delegate function, lambda, or a "HowLitIsItBase" module to override and implement).
  • How large is the character / sprite / actor in comparison to the light?
    ** What if the character is right on top of the light, but the light is so small that it couldn't rightfully "light" the character.
    ** What happens when the character is quite small compared to the light, and is quite far from the light, but the light fades so slowly that one can actually perceive the character, seeing as how the entire character has been partially lit.
Those are the questions we need discuss and answer before I can proceed with implementing this feature.

xixonia wrote Dec 1, 2011 at 5:24 PM

Wow, I really don't know what I was thinking... We can totally just get the final lightmap texture and map a world space vector to pixel space and see how lit that area of the lightmap is. Totally going to do this in the next version.