Alienhead Posted October 4, 2022 Share Posted October 4, 2022 Working on my competition entry, I'm kinda stuck on something, and I may end up ditching the idea before I spend to much time on it. . I was wondering if anyone may have derived a solution to detect when a player ( or any entity mesh ) is in a shadow volume ? Think back to the game Thief, when hiding in the shadows was possible via Lightmapping but I haven't found a way to do it with these real time lights.. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
IceBurger Posted October 4, 2022 Share Posted October 4, 2022 I've seen this asked elsewhere and the answer was to try casting rays at the lights. However, that method could trigger when only partially covered in shadow. 1 Quote i now hate love C++ Beeeeeeeeeeeeeep~~This is a test of the emergency signature system~~Beeeeeeeeeeeeeep RX 6800XT | i5-13600KF | 32GB DDR5 | 1440p is perfect Link to comment Share on other sites More sharing options...
SpiderPig Posted October 4, 2022 Share Posted October 4, 2022 What if you casted a ray from a few of the players AABB corners to the light and used a weighted average of each result? I'm not sure how fast each ray cast is though. You could do a quick ray cast to see if there are any AABB's along the way to the light, then do the more complex check after that. Maybe there's also a way to use the shadow map - if you can access it... I don't know exactly how the shadows work but if you could see how much of your player was visible in the shadow map that might do the trick. 1 Quote Link to comment Share on other sites More sharing options...
Genebris Posted October 5, 2022 Share Posted October 5, 2022 Thief also had very much approximate shadow detection so I don't think it was much more complicated than couple raycasts. I remember light indicator randomly changing while moving in an evenly dark hallway. What's much cooler is that supposedly the guards in Thief 3 can see your shadow even if they don't see you directly. 1 Quote Link to comment Share on other sites More sharing options...
IceBurger Posted October 5, 2022 Share Posted October 5, 2022 16 minutes ago, Genebris said: What's much cooler is that supposedly the guards in Thief 3 can see your shadow even if they don't see you directly. To get that effect one could probably make an object that positions itself so that the player is in-between it and the lights. And then check if the guards can see that object. Quote i now hate love C++ Beeeeeeeeeeeeeep~~This is a test of the emergency signature system~~Beeeeeeeeeeeeeep RX 6800XT | i5-13600KF | 32GB DDR5 | 1440p is perfect Link to comment Share on other sites More sharing options...
Genebris Posted October 6, 2022 Share Posted October 6, 2022 2 hours ago, IceBurger said: To get that effect one could probably make an object that positions itself so that the player is in-between it and the lights. And then check if the guards can see that object. I would say you project from a light into player bone and then further into first surface hit. This is basically a point inside player's shadow and you can check it's visibility now. But it might also be inside some other shadow 🙃 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.