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:
parent
81313f4aa2
commit
39f761e171
1 changed files with 3 additions and 0 deletions
|
@ -882,6 +882,9 @@ void FGClimate::set_environment()
|
||||||
{
|
{
|
||||||
// https://weatherins.com/rain-guidelines/
|
// https://weatherins.com/rain-guidelines/
|
||||||
_wetness = 12.0*std::max(_gl.precipitation-50.0, 0.0)/990.0;
|
_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 {
|
} else {
|
||||||
_wetness = 0.0;
|
_wetness = 0.0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue