Final image
Added clouds and played around with the position of the sun
This includes both Mie and Rayleigh Scattering.
Rayleigh scattering is the idea that says that shorter wavelengths of light (i.e, blue) get scattered easier than longer wavelengths (red). This is what causes the sky to look more red the closer to the horizon, as the light from the sun has to travel through more atmosphere, resulting in more of the blue light being scattered.
Mie scattering is the light that is around the sun. This is caused by the light hitting particles in the sky. Since the light is scattered the same for different wavelengths, it still is white. In addition, since the affects of Mie scattering results in relativity small changes in the angle of the light. Finally, since there are more particles lower in the atmosphere, the strength of the scattering is increased at a shallower angle.
For the clouds, since I did not want to model them, they were generated procedural, using Brownian motion. If we have noise, we can layer different noise maps on top of each other and halve the intensity each time. e.g the overall noise is: n_1 + 0.5 n_2 + 0.25 n_3 + .... When a ray hits a certain altitude, it checks the noise in that location and if it is high enough, then there will be a cloud there.
For the ocean, I used the same technique as the clouds, but this time, it was used to randomize the surface normal of the ocean to make it look like waves.
also note, I got a lot of constants from here: https://www.scratchapixel.com/lessons/procedural-generation-virtual-worlds/simulating-sky/simulating-colors-of-the-sky.html (just click cancel and it will send you to the site)
Below was for the milestone
Sunset with the somewhat noisy ocean.
Sunset without the ocean.
From the base HW4, I have added a few things.
Rayleigh Scattering. This is how the light interacts with small molecules in the atmospheric. It scatters lights of shorter wavelengths. This results the dark orange close to the horizon and the blueish color in the corners.
It also has Mie Scattering. This is how the light interacts with the larger particles in the lower atmosphere. This results in the yellow around the actual sun.
The sun is rendered as a "background." i.e, all light rays escaping the scene that fall within a certain angle are counted as hitting the sun. This is opposed to having an object in the scene.
As with the water, it is done via using the BRDF properties of water, so I added nothing to the code there.