| With the development of computer graphics,the realism of the virtual environment are increasingly high requirements. Adding shadow in the virtual scene, can effectively demonstrate the spacial relationships between objects and geometric informations of the objects, thus greatly enhance the sense of the realism. As the calculation of the shadow is a very time-consuming process, some compromise must be made between the demanding for the real-time and reality of virtual scene. The main research purpose of this thesis is to improve the realism of virtual scene by Real-time shadow rendering based on limited graphics hardware.First, we summarized the real-time shadow rendering algorithm systemicly, clarified the basic principles of several major shadow rendering algorithms, compared the shadow rendering algorithm of shadow map and shadow volume, pointed out the strengths and limitations of each, then we analysed the aliasing problem of the shadow map and the time-consuming problem of shadow volume deeply. This thesis described a way of combining these algorithms to achieve both accuracy and scalability.——We first use a shadow map to find pixels in the image that lie near shadow silhouettes, then apply the shadow volume algorithm only at these pixels, the shadow map determines shadows for the remaining nonsilhouette pixels. In the algorithm, we used hardware-accelerated PCF to find silhouette areas, and used the comtutation mask to mask off the framebuffer addresses of nonsilhouette areas.Second, this thesis analyzed the feasibility of the scene graph system's expansion program, then provided a scheme to add real-time shadow to the visual simulation system, using the callback mechanism of vega to achieve many times rendering. Experiments showed that this algorithm overcomed aliasing problem obviously, greatly enhanced the realism of the urban simulation, and had a good real-time performance. |