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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make lighting updates block for less time #125

Open
stackotter opened this issue Sep 10, 2022 · 0 comments
Open

Make lighting updates block for less time #125

stackotter opened this issue Sep 10, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@stackotter
Copy link
Owner

At the moment when joining Hypixel there is a period of time when hardly any chunks render and then they super quickly render all at once. It's not a rendering issue because the fps stays at a healthy 60 while this is happening. After profiling I found that it was all the lighting updates happening from block updates. They were triggered before any chunks were queued to render so the renderer has to wait for them to complete.

One improvement would be to group the lighting updates from multi-block changes. Grouped lighting updates is already implemented but just isn't used, so that optimisation shouldn't be too difficult. Doing that alone probably won't be enough of an improvement.

The other improvement I have thought of would be having the lighting engine take a copy of lighting data before it starts and then operating on the copy without any blocking required. It can then replace the old lighting with updated lighting. Lighting updates should probably also be handled on a background thread so that they don't block packet handling (like they currently do). Although that should only be done if it measurably reduces lag because otherwise it is unnecessarily complicating the World system.

@stackotter stackotter added the bug Something isn't working label Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant