计算机应用 ›› 2010, Vol. 30 ›› Issue (3): 585-588.

• 虚拟现实 • 上一篇    下一篇

基于GPU的实时雾效模拟

胡贵菊1,吴志红1,王丹霞2   

  1. 1. 四川大学
    2.
  • 收稿日期:2009-09-27 修回日期:2009-11-08 发布日期:2010-03-14 出版日期:2010-03-01
  • 通讯作者: 胡贵菊
  • 基金资助:
    国家863计划重点项目;国家自然科学基金资助项目;国家863计划项目

Real-time simulation of fog on GPU

  • Received:2009-09-27 Revised:2009-11-08 Online:2010-03-14 Published:2010-03-01
  • Contact: HU GuiJu
  • Supported by:
    ;the National High Technology Research and Development Program of China under Grant

摘要: 在复杂的三维仿真系统中模拟雾效对系统的实时性和真实性都提出了较高的要求。在分析传统雾效模拟方法的基础上,提出了一种基于GPU的实时雾效模拟方法。基本思想是建立一个表示雾随高度渐变的指数函数,然后根据提出的算法公式在GPU上实时计算出雾浓度,最后将所计算出的雾效因子与片元颜色进行混合计算。实验证明,该方法能够实时生成真实感较强的雾效。

关键词: 平流雾, 雾密度, 雾效因子, GPU, 实时性

Abstract: Fog simulation is an important research topic in the field of three-dimensional simulation. It puts forward high requirements on real-time performance as well as realistic rendering results for complex three-dimensional simulation system. By analyzing the traditional simulation methods of fog, the authors proposed a Graphic Processing Unit (GPU)-based method to simulate the fog effect in real-time. The basic idea was to employ an exponential function to simulate the fade of fog with height. Then a GPU implementation of this formula was presented. And finally the fog color was blended with the fragment color according to the fog factor. The experimental results show that the proposed method can generate strongly realistic fog in real-time.

Key words: advection fog, fog density, fog factor, Graphic Processing Unit (GPU), real-time