-
Bug
-
Resolution: Fixed
-
1.19.3, 23w05a, 23w06a, 23w07a, 1.19.4 Pre-release 1, 1.19.4 Pre-release 2, 1.19.4, 23w16a, 1.20, 1.20.1, 1.20.2, 23w45a, 1.20.3, 24w11a, 1.20.5, 1.21, 24w36a
-
None
-
Confirmed
-
Rendering
-
Low
-
Platform
This is a very old bug, but I think it wasn't reported before, since it is really hard to spot the difference between old, expected behavior and the new one. This used to happen since Beta 1.8 pre-release, but only on multiplayer. After 1.3, which made single player worlds server-side, it also affects singleplayer.
Technical Review (code analysis)
Prior to Beta 1.8, the skyDarken field present on Level.java used to be updated client-side to check for updating all chunk's render sky brigtness. This was removed on Beta 1.8 because apparently wasn't used anymore for the client. However, it is used in getMaxLocalRawBrightness to subtract the gotten sky light with the night light level reduction.
Method getMaxLocalRawBrightness(BlockPos), present in LevelReader.java. For the client, it is used at:
- ScreenEffectRenderer.java to calculate the water overlay brightness, method renderWater.
- EntityRendererDispatcher.java to calculate the shadow strenght (or if it is necessary to render), method renderBlockShadow.
- Gui.java to update vignette brightness, method updateVignetteBrightness.
This bug it is really easy to fix, as it only requires to use updateSkyBrightness at ClientLevel.java's tick(BooleanSupplier) just like in ServerLevel.java.
For everyone to understand
This bug basically makes 'water overlay'/vignette/'entity shadows' to render as if it was day (full bright), when you're directly under skylight at night. For better understanding, see the images attached below
- relates to
-
MC-136392 Underwater fog does not darken at night
- Open