For this assignment, the assigned students were challenged to reproduce the natural phenomenon of fog by rendering it in computer graphics. In order to overcome this challenge, the students were tasked to first define fog, research methods already used in the industry, and then implement their own method(s) based on their findings.
Part 1. Definition of Fog
What is Fog? As defined by Dictionary.com, fog is "a cloudlike mass or layer of minute water droplets or ice crystals near the surface of the earth, appreciably reducing visibility." [1]
The Challenge: Visible clouds and fog are created by millions and millions of water droplets refracting and reflecting light. Modeling each droplet is impractical – it might provide a more realistic rendering but comes at the expense of an impossibly huge amount of geometry to render.
Solution: Instead of defining each particle, focus on the visually interesting aspects that comes from the aggregation of these particles.
Part 2. Linear Fog/Exponential Fog
Below is an example of Exponential Fog, however, for our solution we wanted a more cloud like appearance to fog.
Figure1: Rendering of Fog using the Exponential Method [2]
For more information about Linear and Exponential Fog, please click here [3].
Part 3. Perlin's Noise
Perlin’s Noise provides a method to create cloud-like texture which we can use to make fog!
Figure 2: Example of Perlin's Noise [4]
For more information about this, please click here [6].
Part 4. Our Implementation
For our solution, we used a Perlin’s noise algorithm to create cloud-like texture which we put on geometries and positioned between objects and the eye position. This effect provided the illusion of fog on the screen which interacts with objects.
Figure 3: Illustation of our implementation
Part 5. Our Results
Figure 4a: Image with No Fog Applied
Figure 4b: Image with Fog Applied, Using a Rectangle Geometry (1 Slice)
Figure 4c: Image with Fog spheres using 10 slices
Part 6. Future Work and Limitations
1. Enhance the boundary of our fog slices. Current implementation shows obvious transition from fog to no fog.
2. Implement User Interface where the user can define the density of the fog instead of number of slices.
3. Implement mode to switch between Perlin and Exponential methods.
References:
[1] http://dictionary.reference.com/browse/fog
[2] http://www.opengl.org/resources/code/samples/redbook
[3] http://msdn.microsoft.com/en-us/library/bb173398(v=vs.85).aspx
[4] http://en.wikipedia.org/wiki/Perlin_noise
[5] http://dunnbypaul.net/perlin/
[6] http://www.cg.tuwien.ac.at/hostings/cescg/CESCG-2004/web/Zdrojewska-Dorota