-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
3D draw point generation #70301
Merged
Merged
3D draw point generation #70301
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
[C++]
Changes (can be) made in C++. Previously named `Code`
<Bugfix>
This is a fix for a bug (or closes open issue)
astyled
astyled PR, label is assigned by github actions
json-styled
JSON lint passed, label assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
labels
Dec 19, 2023
github-actions
bot
removed
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Dec 19, 2023
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Dec 20, 2023
Qrox
reviewed
Dec 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
Co-Authored-By: Jianxiang Wang (王健翔) <[email protected]>
Co-authored-by: Jianxiang Wang (王健翔) <[email protected]>
Co-authored-by: Jianxiang Wang (王健翔) <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
astyled
astyled PR, label is assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
<Bugfix>
This is a fix for a bug (or closes open issue)
[C++]
Changes (can be) made in C++. Previously named `Code`
json-styled
JSON lint passed, label assigned by github actions
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Bugfixes "3D draw point generation"
Purpose of change
Tiles draw sprites on screen by generating a draw_point for each grid. To handle visibility differences on different z-levels in 3D vision, draw_points recalculate their visibility variables on each z-level. However, there are situations where a grid that should not have a draw_point could inherit a draw_point from the grid above it which would cause the grid to show up as visible when it should not.
Fix #69973
draw_points generation now also includes caching and "occlusion culling" features, replacing my previous code. Doing these during draw_points generation is not only more efficient, but also substantially reduces code clutter.
Describe the solution
Describe alternatives you've considered
draw_points are stored in a map within a map (std::map<int, std::map<int, std::vector<tile_render_info>>>). Not sure if there is a more efficient way of storing the data.
Testing
Compiles ok.
Confirmed that #69973 is fixed.
Debug overlays work normally.
Up to 13% faster draw time when displaying multiple z-levels.
Additional context