| The photon mapping algorithm is an important method to achieve global illumination rendering,which can well simulate global illumination effects including caustics,diffuse reflection,etc.However,the photon mapping algorithm needs to store the photon map of the entire scene,which makes it vulnerable to memory constraints when dealing with large-scale scenes.At the same time,insufficient sampling of pixels will also lead to noise in the rendering results.In addition,the high computational cost of the algorithm also makes it difficult to apply it to real-time rendering of dynamic scenes.Therefore,this paper conducts in-depth research on these problems and proposes optimization methods to relieve the memory pressure of the photon map,improve the noise problem,and realize real-time rendering in dynamic scenes.The main content and innovations of this paper are as follows:(1)Photon mapping optimization algorithm based on photon map segmentationAiming at the memory limitation problem in photon mapping,this paper proposes an object-based photon map segmentation method,which sets the photon map separately for each object and saves the photon in the photon map of the intersecting object,thus avoiding the continuous storage of all photons and improving the rendering efficiency of large-scale scenes.In addition,to solve the problem of insufficient pixel sampling,this paper proposes a frame mixing rendering method based on random sampling.This method randomly samples pixels between frames and mixes each frame image to improve the rendering quality of images.(2)Real-time photon mapping algorithm for dynamic scenesIn order to realize the real-time rendering of the photon mapping algorithm in dynamic scenes,this paper improves and optimizes the photon mapping algorithm.Firstly,a scene segmentation method based on the AABB bounding box is proposed,by which the scene is divided into multiple sub-scenes,so that each sub-scene can be tracked on the distributed server,so as to realize the parallelization of photon tracking and improve the speed of photon tracking.Secondly,a rendering method based on the camera’s visible area is proposed.In the rendering process,the vertices in the camera’s visible area are accurately estimated,and the vertices outside the camera’s visible area are approximately estimated,thereby reducing the amount of illumination calculation,increasing the speed of ray tracing.Finally,several different situations in dynamic scenes are analyzed,and corresponding improvement measures are proposed to realize real-time rendering of dynamic scenes. |