Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Slightly alter star appearence time and full brightness time (#7921)
At sunset:
Stars first appear slightly later, at the time the sun disappears over the horizon,
this fixes seeing dark stars in front of the sun horizon glow texture.
Stars reach full brightness slightly earlier at time 20000, not so excessively long
after sunset.

The above behaviour is also applied at sunrise, but of course, time-inverted.
  • Loading branch information
paramat committed Dec 2, 2018
1 parent 327bad2 commit 5dd5424
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/client/sky.cpp
Expand Up @@ -445,12 +445,16 @@ void Sky::render()
// Draw stars
do {
driver->setMaterial(m_materials[1]);
// Tune values, so that stars begin to be drawn at the same time the
// sun disappears over the horizon, and so that star full brightness
// is reached at time 20000, for 8 'hours' of full star brightness.
float starbrightness = MYMAX(0, MYMIN(1,
(0.285 - fabs(wicked_time_of_day < 0.5 ?
wicked_time_of_day : (1.0 - wicked_time_of_day))) * 10));
(0.25 - fabs(wicked_time_of_day < 0.5 ?
wicked_time_of_day : (1.0 - wicked_time_of_day))) * 20));
float f = starbrightness;
float d = 0.007/2;
float d = 0.007 / 2;
video::SColor starcolor(255, f * 90, f * 90, f * 90);
// Stars are only drawn when brighter than skycolor
if (starcolor.getBlue() < m_skycolor.getBlue())
break;
#ifdef __ANDROID__
Expand Down

0 comments on commit 5dd5424

Please sign in to comment.