Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip sunlight calculation on uniform z-levels #34391

Merged
merged 4 commits into from
Oct 3, 2019

Conversation

NotFuji
Copy link
Contributor

@NotFuji NotFuji commented Oct 2, 2019

Summary

SUMMARY: Performance "Skip sunlight calculation on uniform z-levels"

Purpose of change

Raycasting is unnecessarily done from the top of the sky. To avoid this, sunlight begins at the highest populated z-level in the reality bubble.

Describe the solution

On map::shift() the highest z-level of the current submaps is calculated and recorded in the level_cache to be used as an upper bound for suncasting.

Describe alternatives you've considered

Might be a better way to do this, but 馃し

Additional context

Closes #34348

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) Z-levels Levels below and above ground. labels Oct 2, 2019
@ZhilkinSerg ZhilkinSerg merged commit 6f8edc5 into CleverRaven:master Oct 3, 2019
@Relyksboa
Copy link
Contributor

wait, sunlight is raycasted in this game? neato.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) Z-levels Levels below and above ground.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce scope of sunlight shadowcasting.
3 participants