Call of Duty 4 :: Day and Night Cycle
with Film, Sun and Fog lerping ++ Volumetric Clouds

GitHub Repository :: CoD4 Shader Tutorial :: Discord Server


Night example:


  1. Grab the latest IW3xo Release
  2. Load up a map and use Devgui->DayNight to enable the day and night cycle
  3. Tweak to your heart’s content

GUI Settings In-Depth:

General Settings

|-> Enable Time of Day Lerping          :: Enable lerping between time of day states.
|-> Enable Auto Sun Rotation            :: Automatically rotate the sun. Disable for manual mode using Sun Direction.
|-> Sun Direction                       :: r_lightTweakSunDirection (X) - position of the sun and thus, the lighting state.
|-> Day Length Scalar                   :: General day length scalar.
|-> Day Speed Scalar                    :: Speed up / Slow down daytime.
|-> Night Speed Scalar                  :: Speed up / Slow down nighttime.

Cloud Settings (not all)

|-> Skydome Scale                       :: Cloud sphere size
|-> Cloud Coverage                      :: Amount of clouds
|-> Cloud Step Distance XZ              :: Distance scalar at which to draw "half-resolution" clouds

Time of Day Settings

|-> Film Interpolation Speed            :: Time it takes to lerp to current filmtweak settings
|-> Sun Interpolation Speed             :: Time it takes to lerp to current lighttweak settings
|-> Tweak Fog                           :: Use custom fog settings for this state (uses default map settings otherwise)

Config files are saved and loaded from:

Go completely crazy if you want: