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

Implement cross-chunk-border lighting propagation #6555

Open
dktapps opened this issue Dec 3, 2024 · 0 comments
Open

Implement cross-chunk-border lighting propagation #6555

dktapps opened this issue Dec 3, 2024 · 0 comments
Labels
Category: Core Related to internal functionality Category: Gameplay Related to Minecraft gameplay experience Performance Type: Enhancement Contributes features or other improvements to PocketMine-MP

Comments

@dktapps
Copy link
Member

dktapps commented Dec 3, 2024

Problem description

Crops in shadowed areas in e.g. overhangs will currently not grow correctly due to the lack of cross-chunk-border light propagation.

Basically: If the only available light source for crops is in an adjacent chunk, currently the crops won't know about the light from that light source, because we don't propagate it across chunk borders.

This would also lead to problems with mob spawning.

Proposed solution

Implement pass 2 light propagation as described here: https://github.com/dktapps/lighting-algorithm-spec?tab=readme-ov-file#pass-2-propagate-light-across-chunk-borders

We already have pass 1 light propagation (Chunk->isLightPopulated() === true means "has pass1 lighting").

Why hasn't this been done already?

It's not hugely difficult, but it is a bit complicated to implement and doesn't provide a huge amount of benefit at present. It could also cause a hit to performance if done poorly.

  • Chunk would need to add a set of flags to track which pass2 positions it's received light propagation from
  • Adjacent chunks would need to update their pass2 flags when an adjacent chunk is replaced

Alternative solutions that don't require API changes

@dktapps dktapps added Category: Gameplay Related to Minecraft gameplay experience Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP Performance labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Category: Gameplay Related to Minecraft gameplay experience Performance Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

No branches or pull requests

1 participant