Dienstag, 18. November 2014

Skydome


Since the project specification requires a full scene with clouds placed in the sky the next step is to procedurally generate the sky. To achieve this, different approaches can be chosen. As spheres were previously successfully generated, I preferred a skydome over other concepts – i.e. a cube with a texture mapped on each face or a planar texture relative to the observer’s point of view. The basic idea of a skydome is to pull a hemisphere over the scene. This can easily be achieved by removing half of a sphere (for a more detailed description on the spheres see the first post on generating a single cloud).

Simulating time

The color of the sky changes throughout the day. In this section, the effect is modeled by illuminating the hemisphere. Therefore, two different colors were defined, the zenith color and the horizon color. Hereafter, the color is interpolated between those two values depending on the mapped y-coordinate. Independent of the top color at the zenith of the hemisphere, the color of the horizon changes to from red in the morning hours to white during the day back to red during sunset to black through the night. The interpolation along the y-axis is done with the radicular influence of the light intensity which is zero at sunset and sunrise and 1 for the highest position of the sun. Figure 1, Figure 2 and Figure 3 show distinguished results during from the day-night-cycle.

Figure 1  skydome during lunchtime with white horizon
Figure 2 skydome during night with black horizon
Figure 3 skydome during sunset / sunrise with red horizon

Light

Additional to the ambient illumination of the surface of the sphere, a strong specular component is incorporated to represent the sun. Depending on the intensity of the sun (cf. description above), the position is calculated on a curved trajectory on the hemisphere. The intensity also determines the impact of the specular sun component. Thus, the sun fades near sunset. Figure 4, Figure 5 and Figure 6 display the combined result of the skydome and the integrated sun.

Figure 4 sun during lunchtime near the zenith
Figure 5 sun during afternoon
Figure 6 sunset with fading intensity near the horizon

References


Keine Kommentare:

Kommentar veröffentlichen