Jump to content
beako

How to determine ambient brightness for time of day?

Recommended Posts

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

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
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

  • Like 1

Share this post


Link to post
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×