计算机应用 ›› 2015, Vol. 35 ›› Issue (5): 1439-1443.DOI: 10.11772/j.issn.1001-9081.2015.05.1439

• 虚拟现实与数字媒体 • 上一篇    下一篇

基于后处理的实时景深模拟与应用

曹彦珏, 安博文, 李启明   

  1. 上海海事大学 信息工程学院, 上海 201306
  • 收稿日期:2014-12-09 修回日期:2015-01-13 出版日期:2015-05-10 发布日期:2015-05-14
  • 通讯作者: 曹彦珏
  • 作者简介:曹彦珏(1991-),女,上海人,硕士研究生,主要研究方向:虚拟现实、图像处理; 安博文(1969-),男,湖北黄冈人,教授,博士,主要研究方向:数字图像处理、图像识别; 李启明(1982-),男,山东五莲人,讲师,博士,主要研究方向:虚拟现实、增强现实.
  • 基金资助:

    国家自然科学基金资助项目(61171126);上海重点支撑项目(12250501500);交通运输部应用基础研究项目(2014329810060);上海市自然科学基金资助项目(14ZR1419700);上海高校青年教师培养资助计划项目(ZZshhs13024).

Real-time simulation and application of depth-of-field based on post-processing

CAO Yanjue, AN Bowen, LI Qiming   

  1. College of Information Engineering, Shanghai Maritime University, Shanghai 201306, China
  • Received:2014-12-09 Revised:2015-01-13 Online:2015-05-10 Published:2015-05-14

摘要:

针对虚拟现实系统中的景深模拟问题,提出了一种改进的基于图形处理器(GPU)的后处理景深模拟算法.该算法在场景渲染时将全分辨率纹理图存入离屏缓存区,利用该离屏缓存区的Alpha通道输出每个像素的线性化深度信息;对这个全渲染的场景纹理图作下采样处理,得到原图像1/16大小的图像;对下采样后的场景纹理进行可分离二维高斯滤波,生成模糊的场景纹理图;通过泊松采样方法,在弥散圈内将两幅纹理图基于线性化深度信息进行融合,模拟出了景深效果.最后将该算法应用于一个海上搜救虚拟现实系统.实验结果表明,所提算法较好地仿真了景深效果,改善了传统后处理滤波算法的深度连续性差、亮度扩散等问题,并能满足实时交互需求.

关键词: 景深模拟, 线性化深度, 下采样, 实时性, 虚拟现实

Abstract:

In order to solve the problem of rendering Depth Of Field (DOF) in Virtual Reality (VR) system, an improved post-processing algorithm of DOF based on Graphics Processing Unit (GPU) was proposed. First, the scene at full resolution was rendered to an offscreen buffer, and the linear depth of each pixel was output to the alpha channel of the buffer. Then, the fully-rendered scene was downsampled into 1/16 of the original size. Next, the downsampled scene was blurred by running the image through two passes of a separable Gaussian filter, and stored as a texture. Finally, the two textures were blended according to the linear depth of each pixel in the size of Circle of Confusion (CoC). The algorithm was applied in a virtual roaming scene and a good simulation of real-time DOF effect was achieved. The experimental results show that the algorithm has improved some problems in the traditional post-processing filter algorithm, such as poor continuity and brightness diffusion, and it meets the demand of real-time interaction in VR.

Key words: Depth Of Field (DOF), linear depth, downsampling, real-time performance, Virtual Reality (VR)

中图分类号: