The equation for a sunset
I’ve always been a big fan of sunsets. I get some really nice ones most evenings in the summer from my current flat but with winter approaching I wanted to try and make something virtual and consistent. One of my goals was that after I got my quest 2 to try and sit coding with a sunset in the background. There are a number of issues on the road to realising that dream in its entirety however I got a long way with watching the sunset over the ocean. Bellow, I present a shader (Code dedicated to programing the shader section of the graphics card pipeline) for a sunset over ocean waves. Ocean waves in deep water are much easier to generate than shallow-water waves as you can get away modelling them as not interacting with anything. That permits an ontogenetic style where you can skip to the future without calculating the intermediate steps. The surface is based on the sums of sin waves which is not true to how water actually moves as it moves in Gerstner waves . So I based the ...