-
Notifications
You must be signed in to change notification settings - Fork 792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redo Vision #6432
base: master
Are you sure you want to change the base?
Redo Vision #6432
Conversation
To be fair I'm not sure either. I just think it needs to be a cone (or since we are dealing 2d, triangle) shape from the character to model the idea that you see more further ahead than you do nearby. A simple "line" won't work well I think because of this. |
Desktop.2023.08.02.-.17.21.12.08.mp4I modified the function and now it casts 360 rays, utmost realism and precision |
A bit hard to judge compared to the original (or even to what one would consider "perfect", which I actually don't know), but that's looking good to me at least. Is there a significant performance implication with the change? |
Not sure. someone with a low end system will have to test |
I was able to reduce the amount of rays to 64 from 360 and still maintain a good level of accuracy |
float dx = std::cos(angle * M_PI / 180.0f); For your consideration. In the past, like 20 years ago, it was common to pre-calculate all possible answers at game startup and store these results in an array. Then when the game was running; lookup the answers from the array to avoid doing sin and cos when timing is critical. |
Title is misleading :(
|
Gotta redo time demo probably 😅 I incorrectly named the tables so I'll need to revise those. |
Creates a more consistent and realistic area of vision. Makes the vision radius as close to a circle as we can get, which also fixes the bug with the player turning invisible with lowest achievable light radius.
Before:
After:
Before:
After:
Before:
After: