beako 13 Posted June 21, 2019 HI all, I'm trying to set the brightness of an object based on the ambient brightness of the environment. But so far the only way I found how to do this is based on the time of day. Is there a way to determine the ambient brightness in the based on the current time of day? _intensity = 0; _timeOfDay = daytime; switch (TRUE) do { case ( (_timeOfDay >= 0) and (_timeOfDay < 2) ) : {_intensity = 0.5}; case ( (_timeOfDay >= 2) and (_timeOfDay < 3) ) : {_intensity = 0.75}; case ( (_timeOfDay >= 3) and (_timeOfDay < 4) ) : {_intensity = 1.0}; etc... }; ... Share this post Link to post Share on other sites
atmo 29 Posted June 21, 2019 The only one I know of which may be helpful is 'sunOrMoon' (https://community.bistudio.com/wiki/sunOrMoon) but I suspect you have already seen that. I am not sure of the number it returns. Atmo. Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted June 22, 2019 Alternatively you can use BIS_fnc_sunriseSunsetTime and go from there. Cheers Share this post Link to post Share on other sites
The Real Bunc 137 Posted June 22, 2019 I was hunting for something to directly find ambient brightness for my DynamicCamo script but couldn't find anything so I used the sunrise and sunset times to calculate a day/night factor which works quite well to represent what the sun is doing. BUT ambient light is also impacted of course by overcast, rain, fog etc. The way I put these together in DynamicCamo is essentially a proxy for overall light level. Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted June 22, 2019 40 minutes ago, The Real Bunc said: I was hunting for something to directly find ambient brightness for my DynamicCamo script but couldn't find anything so I used the sunrise and sunset times to calculate a day/night factor which works quite well to represent what the sun is doing. BUT ambient light is also impacted of course by overcast, rain, fog etc. The way I put these together in DynamicCamo is essentially a proxy for overall light level. Well you could also use the radiation function from this neat package: Might be what you're after. Cheers 1 Share this post Link to post Share on other sites
The Real Bunc 137 Posted June 22, 2019 GOM, I spotted the shadow function on that one when it was mentioned before but somehow completely missed the irradiation function. Plus one for that then if its giving an actual irradiation value at unit position. Share this post Link to post Share on other sites