Add dynamic lighting with Fast/Fancy quality toggle#1330
Closed
MCbabel wants to merge 2 commits intosmartcmd:mainfrom
Closed
Add dynamic lighting with Fast/Fancy quality toggle#1330MCbabel wants to merge 2 commits intosmartcmd:mainfrom
MCbabel wants to merge 2 commits intosmartcmd:mainfrom
Conversation
Collaborator
|
This PR is REJECTED and will be closed because: Heavy AI usage. Look at our CONTRIBUTING.md for more info. |
Contributor
Author
|
@mattsumi “vibe coded”? Well, I'd really appreciate a more specific reason other than just that my changes are “vibe coded.” |
Contributor
Author
|
@mattsumi To be honest, I think it's pretty ridiculous and disrespectful to label my changes as “vibe coded” and then not give me a specific reason why my code is supposed to be “vibe coded” now. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This adds dynamic lighting to the game, similar to how OptiFine handles it in Java Edition. A lot of people on the discord server have been asking for this so I went ahead and implemented it. It's off by default and can be toggled on in the graphics settings menu.
There's two modes: Fast (cheaper, only player held items glow, smaller radius) and Fancy (full entity lighting including dropped items, blazes, burning mobs etc).
Gameplay footage
https://youtu.be/0wDQjRi5HqM
Changes
Previous Behavior
No dynamic lighting existed. Holding a torch in your hand didn't illuminate the area around you. Only placed light sources (torches, glowstone blocks etc) emitted light.
Root Cause
The original LCE codebase never had dynamic lighting - it wasn't part of TU19. OptiFine added this to Java Edition as a popular mod feature but it never made it into the console versions.
New Behavior
Players holding light-emitting items (torches, glowstone, lava buckets etc) now light up the surrounding area in real-time. In Fancy mode, dropped items and certain entities also emit light. The setting persists between sessions.
Fix Implementation
getDynamicLight()andupdateDynamicLights()toLevelwhich collects light sources from players/entities each tick and provides additional brightness to the rendering pipeline viaRegion::getLightColor()andLevel::getLightColor()Item::getItemLightLevel()to query light emission for held/dropped itemsCRITICAL_SECTIONsince chunk rebuilds happen on separate threadsuiBitmaskValuesbitmask (bits 24-25) so they persist insettings.datRelated Issues