uniform int world_time2;
uniform int world_day2;

float randFromDay2(float min, float max, float seedMultiplier) {

  uint todaySeed = uint(world_day2) * uint(seedMultiplier);
  uint tomorrowSeed = uint(world_day2 + 1) * uint(seedMultiplier);

  float todayRand = fract(sin(float(todaySeed)) * 43758.5453);
  float tomorrowRand = fract(sin(float(tomorrowSeed)) * 43758.5453);

  float percentDay;
  
  if(world_time2 >= 22000 || world_time2 <= 1000) {
    percentDay = smoothstep(0.0, 1.0, float(world_time2) / 24000.0); 
  }
  else {
    percentDay = 0.0;
  }

  float rand = mix(todayRand, tomorrowRand, percentDay);

  return rand * (max - min) + min;

}