Search the Community
Showing results for tags 'getlighting'.
Found 1 result
-
I'm trying to make custom light source's impact on surrounding environment/objects at daylight as close, as during night conditions, as possible (for human eye). As a criteria I'm using subjective visiblity range of blue light tint on the surfaces around the light source. This code seems to work along described lines: RYD_LightEqualizer = { private _lght = getLighting select 1;//ambientLightBrightness if ((_lght > 570.06) and {(_lght < 1754.41)}) then { (linearConversion [570.06, 1754.41, _lght, 1.2808, 1.7545, false]) } else { ((_lght/1000) max 1) }; }; used like this: _someBrightness = 1; _brCoeff = [] call RYD_LightEqualizer; _someLightSource setLightBrightness (_someBrightness * _brCoeff); Exemplary result for native brightness 1: So, if anyone wants, can use it. But, as you can see, there's a certain (determined empirically) range of ambient light brightness values (happening at some time during sunrise and sunset), where general formula - (_lght/1000) max 1 - doesn't suffice (light not visible during that period) which enforced patching with linearConversion part. I could use any advice/improvement to avoid such patching and to have rather one, always working formula (and other good ideas, if any). PS code was tested on Altis with an assumption, it is the same on every map, but wasn't tested on other maps. Also overcast seem irrelevant as for ambient light brightness value.