Get amount of light shining on player?

Hi! I’m looking for something that allows me to get the amount of light shining on player, and reduce\increase player visibility based on it, much like in Splinter Cell.

I don’t currently have an enemy detection system, but I am working on it and would like to know how to do this.


what about each lamp that produces hard shadows in a area cast a ray at the player,
(like a max of 5 or so?)

hitting the player elevates the meter?

idea 2

localize the player position to each close lamp

use the light casting axis for

if playerLocal.z < 0:
(player is in front of lamp)
    if playerLocal.x<5+(abs(playerLocal.z)) and playerLocal > -5+(-abs(playerLocal.z)):
        (this defines a cone :D)


That might work. I have a feeling that I won’t be able to get this fully working without point light shadows.

playerLocal = (player Position localized to lamp)

playerLocal = lamp.worldOrientaiton.inverted*(player.worldPosition-lamp.worldPosition)

I think*

It might not be really possible, since Splinter Cell uses a heavily modified UE 2.5

Thanks for your suggestions, though. I’ll give them a shot.

Or you can ask someone to write you a shader to do this. This should be a simple one.

Sent from my LG-H440n using Tapatalk


If someone would, I’d much appreciate it.

Would it not be better to use rayCast?