Sodium

Sodium

35M Downloads

Brightness menu option resets to 44 from 45 after game restart

vichvich4444 opened this issue · 4 comments

commented

Expected Behavior

Brightness stays the same

Actual Behavior

Brightness changed to 44 from 45

Reproduction Steps

  1. Set brightness to 45
  2. Restart the game
  3. Brightness is now 44
commented

Issue has been resolved at some point, it does not flip from 45 to 44 anymore with Sodium 0.4.11

commented

Can confirm as fixed, thanks for bumping.

commented

The difference with vanilla, here, is that Sodium’s slider return a value with only two decimals so when the loss of precision reduce the gamma value, the first two decimals (which are displayed) are affected.

In vanilla, where the slider return more decimal, it’s rare to have a value where the loss of precision affect the first two decimals. (But when that's the case, it can go to the superior percentage too which is impossible with Sodium which can only go to the lower.)

commented

This is due to a precision issue where Minecraft casts double to a parsed float.

If you go to options.txt in your Minecraft instance folder, you should see that your 45 brightness corresponds to the gamma value 0.45, but once you restart and open up settings menu, the options.txt gamma value would be something along the lines of 0.4499... Hence becoming 0.44 when lazily casted to a double.

However, I am not sure if it's in Sodium's scope to change how the gamma value is stored.