在研究透镜成像模型与针孔成像模型的基础上,在计算机三维场景成像中实时地模拟出景深效果。算法利用了MRT(multiple render targets)技术及GPU的可编程性,在渲染时将场景存为纹理,并输出了像素的深度值和模糊因子,利用模糊因子计算每像素模糊圈大小并对图像进行滤波,最终在模糊圈内对清晰图像和模糊图像进行融合,模拟出景深效果。以一个场景的景深模拟为例,展示了不同聚焦时的景深效果。
This paper proposed an efficient and real-time algorithm for the simulation of camera imaging in the three-dimensional scene based on both ideal and real camera models. The algorithm took extensive use of the multiple render targets (MRT) technology and graphics processing unit(GPU) for programmable performance. It outputed the image of the three-dimensional scene and stored as a texture, and also outputed each pixel' s depth and blurriness information and also stored as texture. "At last, filtered the image, calculated the size of confusion(CoC) for each pixel by the blurriness, and used CoC to blend between the original(clear) image and blurred image. Our experiments on simulation of depth-of-field in a geome-try scene demonstrate various effects with different parameters.