Feature 7 Post Mortem
Adding fog to my scene was much simpler than I had expected. At first, I was not very satisfied with how the fog appeared. I had a couple of ideas for improvement, none of which panned out very well. The most promising of these was to create multiple boxes of fog, so that it would appear as if the camera was inside of a volume of fog. This was fine, as long as the player never looked to the side, lest he/she see through the sides of the box. I also tried a skybox of fog, and this also wasn’t what I was looking for. Anyway, eventually I decided that I would just go ahead and use a bunch of planes, and I made sure that they were always aligned with the camera’s eye by excluding the camera.GetViewMatrix() when I passed my transformations to the vertex shader as xform. Finally, I put a deserty touch on things by using glsl’s mix() function to give my fog a sandy color. Hence… a sand storm! That’s about all there is to it, and I didn’t have to use anything other than Dr. Johnson’s videos.
Here are some pictures.