How do I get the light levels at the player's position?
I'm trying to make a stealth game with mechanics similar to Thief. I want the player to hide in the shadows, so I tried raycasting against light sources, but only works with dynamic lights. With static lights, sometimes the indirect lighting can light up an area, making my previous technique less realistic. I want enemies to be able to see the player if the amount of light at their position is bright enough for the enemy to see. The problem is, I don't know how to do this. So, I've been searching around and found this from the UDK forums. I translated the visibility code into C++ and the UE4 API, but when I test it out, my code returns 0. Here's my function in full:
Honestly, I have no idea what I'm doing with that equation. I just can't find another way to do this. What's wrong with it? Is there a better way to do this?
Whoops, I misread the original code. I refactored the equation and now i'm getting some actual numbers. They're not the most precise results and I'm definitely gonna have to tweak the code, but it works!
Here's the refactored equation:
Follow this question
Once you sign in you will be able to subscribe for any updates here