I don’t think fog typically follows a daily cycle, so I did not include it.
Fog color would be fairly easy to do. It would use the same logic as colorShift_Top. You would need to declare a new “color list”.
Note: I have not calibrated any colors in these examples.
-- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
local r2ColorList = {000,000,000,000,000,255,255,255,255,255,255,255,255,255,255,255,255,255,255,000,000,000,000,000}
local g2ColorList = {165,165,165,165,165,255,215,230,255,255,255,255,255,255,255,245,230,215,255,165,165,165,165,165}
local b2ColorList = {255,255,255,255,255,255,110,135,255,255,255,255,255,255,255,215,135,110,255,255,255,255,255,255}
local r2
local g2
local b2
And add another instance of the color lerping algorithim to the while loop (you don’t need to re declare pointer).
r2=((rColorList[pointer%24+1]-r2ColorList[pointer])*(mam-pointer+1))+r2ColorList[pointer]
g2=((gColorList[pointer%24+1]-g2ColorList[pointer])*(mam-pointer+1))+g2ColorList[pointer]
b2=((bColorList[pointer%24+1]-b2ColorList[pointer])*(mam-pointer+1))+b2ColorList[pointer]
game.Lighting.FogColor=Color3.fromRGB(r2,g2,b2)
As for FogStart/FogEnd, I can’t think of a reason why it might be changed on a daily schedule, so I can’t really think of a algorithm that would be useful for that. Presumably you could use a single channel of the colorShiftTop algorithim
-- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
local fEndList = {000,000,000,000,000,255,255,255,255,255,255,255,255,255,255,255,255,255,255,000,000,000,000,000}
local fStartList = {165,165,165,165,165,255,215,230,255,255,255,255,255,255,255,245,230,215,255,165,165,165,165,165}
and in the loop
game.Lighting.FogStart=((fStartList[pointer%24+1]-fStartList[pointer])*(mam-pointer+1))+fStartList[pointer]
game.Lighting.FogEnd=((fEndList[pointer%24+1]-fEndList[pointer])*(mam-pointer+1))+fEndList[pointer]