t-affeldt / climate

The complete weather bundle for Minetest
https://forum.minetest.net/viewtopic.php?f=9&t=24569
5 stars 4 forks source link

Lack of color saturation when running on 5.7.0 #7

Open pquesinb opened 1 year ago

pquesinb commented 1 year ago

After updating the server to 5.7.0 (from 5.6.1), the colors are severely washed out, almost black & white, when regional_weather is enabled. Disabling it returns colors to normal. Also, if you are below -100m, the color returns to normal so I guess it's related to fog or other atmospheric effects being disabled underground.

pquesinb commented 1 year ago

Looks like that color-saturation calculation is done here, in line 40 of ../ca_weathers/ambient.lua: local light_saturation = map_range(cloud_shadows + daytime_shadows, 0.9, 1.1)

I made the following change to line 53 to just plug a value of 1 in there as a temporary fix, but it of course messes up the cool weather-related lighting/saturation effects:

root@racknerd-xxxxxx:/var/games/minetest-server/.minetest/mods/climate/regional_weather/ca_weathers# diff ambient.lua.org ambient.lua

53c53 < saturation = light_saturation --- > saturation = 1

AyeGeeToo commented 2 months ago

Just installed the mod in 5.8.0 and am getting the same issue. The game runs ok for a few seconds before the colours wash out.

Have used the temporary fix by @pquesinb so I can play with the mod active. Thank you for that.

53c53 < saturation = light_saturation --- > saturation = 1

PS I am enjoying the weather features, great job.

jgordon510 commented 1 week ago

This appears to fix it. On line 17 in map_range, change the return to this: return val*(high-low)+low

(I think the algebra is just wrong for the map function.)