Özet:
Shadowing terrains is a challenging problem. Mainstream shadowing algorithms like shadow volumes and shadow maps, do not work very well with height map geometry. Shadow volumes need silhouette extraction which is a very expensive operation for a height map tessellated into thousands of triangles. Shadow mapping is a better alternative, but it su ers from aliasing and self-shadowing artifacts. Additionally, shadow mapping needs two rendering passes to function, this means rendering the height map twice in each frame. In this thesis, we propose a new specialized terrain shadowing algorithm to generate shadows caused by the directional light of the Sun. We propose the use of shadow height map (SHM), which is a discretized version of the shadow volume of the height map. A pixel in the SHM texture represents the height of the shadow on the current height map location. It is a hybrid method which borrows elements from shadow mapping, shadow volumes and ray casting. For each sunlight direction we generate a new SHM, by casting parallel sunlight rays onto the terrain. We rotate the SHM texture, such that each ray corresponds to a single column of the image and we apply a simple, iterative 2D shadow volume extraction algorithm on each column, storing the current height of the shadow to the current pixel in the column, as the algorithm progresses. A pixel of an arbitrary object or to the terrain compares its world height with the sampled shadow height from the SHM and marks itself in shadow if it is below the shadow surface. We de ne two models to simulate realistic soft shadows, rst, by using a constant penumbra and second, by using an adaptively varying penumbra height. According to our tests, our algorithm performed better than the state-of-the-art shadow mapping variant, Parallel Split Shadow Mapping (PSSM), both in the quality and performance aspects.