1
0
Fork 0

Terrain wetness: reimstate clamping term

Re-add this clamping of the terrain wetness value, to avoid out of bounds
values in shaders appearing as black. Thanks to Colin Geniet for the testing and fix.

SF-Id: https://sourceforge.net/p/flightgear/codetickets/2604/
This commit is contained in:
James Turner 2021-07-26 11:20:01 +01:00
parent 81313f4aa2
commit 39f761e171

View file

@ -882,6 +882,9 @@ void FGClimate::set_environment()
{
// https://weatherins.com/rain-guidelines/
_wetness = 12.0*std::max(_gl.precipitation-50.0, 0.0)/990.0;
// clamping term, see https://sourceforge.net/p/flightgear/codetickets/2604/
_wetness = pow(sin(atan(SGD_PI*_wetness)), 2.0);
} else {
_wetness = 0.0;
}