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

Minimally optimize light rendering #675

Merged
merged 3 commits into from May 24, 2024

Conversation

BenCheung0422
Copy link
Member

This fixes #672
Currently, when there are enough amount of light sources, the mass amount of "lighting circles" can slow down rendering as each circle is rendered by gradients, handled by Java2D. This turn the light sources neighbouring other light sources in all 8 directions into a square of a tile (16-by-16 pixels) instead of a circle. This is done because when there are "circles" eventually overlapping the central circle, there is no difference when it is rendered only on itself. 16-by-16 square is chosen because it is intended to handle tile light sources. This cannot completely resolve the problem, but should be enough (from around 10 FPS raised up to over 50 on my end) to resolve the critical performance issue by light rendering. The resultant lighting behavior should have kept the same by this change. Different lighting mechanism may be used in the future.

BenCheung0422 and others added 3 commits May 1, 2024 23:18
Lights neighbouring lights in all 8 directions are rendered as a square of tile instead of circle
@Litorom Litorom merged commit 5ac8397 into MinicraftPlus:main May 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FPS dropping near lava
2 participants