The bug
When exploring mineshafts using night vision, I found that the blocks nearing light sources always become darker and more orange. But the block just beside the light source is normal.
How to reproduce
Set brightness in video options to minimum
Make/Go to a place with light level 0. (Note: It does something else if exposed to sky, but still looks weird though.)
Get Night Vision effect.
Place any kind of light source.
The blocks near but not beside the light source are rendered darker. (Note: Lava blocks and Fire blocks are rendered too dark too!)
New founds added 6/24:
Finally I got the idea why night vision looks weird under night sky. I found a ravine with a hole above it, and compare to the non exposed area, the place under the night sky are extremely blue.
How to reproduce
Set brightness in video options to minimum
Make (since it's a little difficult to find) a huge (at least 30x10x30) room with light level 0. (Suggested that use stone with some lapis ores)
Get Night Vision effect.
Make sure it's night time in game.
Break a hole on the roof.
Enjoy! Don't forget to try Fire blocks, they look FUNNY!! (?! Just kidding XD)
Code analysis
Code analysis by @unknown can be found in this comment.
Related issues
relates to
Attachments
Comments


Is your Java already the latest Java, if it is please add it to the "Java 7" in your environment.

can confirm with brightness on minimal

Somewhat confirmed with brightness on minimum.

Lava blocks and Fire blocks also have REALLY WEIRD dark blue color! :I

Confirmed for 14w26a and b

Still a concern in 14w27a and 14w27b.

Is this still an issue in 14w30c ?

Yes~ It still works for me

Still an issue up to 1.8.2-pre1.

Can confirm for 1.11. Easiest to see with moody brightness and smooth lighting off.

The issue appears to be that some values can be outside of the range expected by the night vision effect code.
Fix is easy, just requires moving the code in EntityRenderer.updateLightmap()
a little:
private void updateLightmap(float partialTicks)
{
// ...
// move this block from here ---
if (this.mc.player.isPotionActive(MobEffects.NIGHT_VISION))
{
float f15 = this.getNightVisionBrightness(this.mc.player, partialTicks);
float f12 = 1.0F / f8;
if (f12 > 1.0F / f9)
{
f12 = 1.0F / f9;
}
if (f12 > 1.0F / f10)
{
f12 = 1.0F / f10;
}
f8 = f8 * (1.0F - f15) + f8 * f12 * f15;
f9 = f9 * (1.0F - f15) + f9 * f12 * f15;
f10 = f10 * (1.0F - f15) + f10 * f12 * f15;
}
if (f8 > 1.0F)
{
f8 = 1.0F;
}
if (f9 > 1.0F)
{
f9 = 1.0F;
}
if (f10 > 1.0F)
{
f10 = 1.0F;
}
// to here ---
float f16 = this.mc.gameSettings.gammaSetting;
float f17 = 1.0F - f8;
float f13 = 1.0F - f9;
float f14 = 1.0F - f10;
f17 = 1.0F - f17 * f17 * f17 * f17;
f13 = 1.0F - f13 * f13 * f13 * f13;
f14 = 1.0F - f14 * f14 * f14 * f14;
f8 = f8 * (1.0F - f16) + f17 * f16;
f9 = f9 * (1.0F - f16) + f13 * f16;
f10 = f10 * (1.0F - f16) + f14 * f16;
f8 = f8 * 0.96F + 0.03F;
f9 = f9 * 0.96F + 0.03F;
f10 = f10 * 0.96F + 0.03F;
// ...
}

Confirmed for 1.13.1.

Confirmed for 1.14-prerelease-5

Confirmed for 19w42a. It also affects the UI, color now, tinting it blue and darkening it. Should I make a separate bug report for that?
@@unknown, 19w42a is this ticket MC-161849.
Is this fixed in 19w45a? It's hard for me to tell 😛

Yeah it seem to be fixed in 19w45a for me.

Still fixed in 19w45b.

this seems to be a glitch in 1.18!
[media]