作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2011, Vol. 37 ›› Issue (8): 291-292. doi: 10.3969/j.issn.1000-3428.2011.08.100

• 开发研究与设计技术 • 上一篇    

基于顶点着色器的雾化因子定义方法

王 彦   

  1. (暨南大学信息科学技术学院,广州 510632)
  • 出版日期:2011-04-20 发布日期:2012-10-31
  • 作者简介:王 彦(1986-),女,硕士,主研方向:高性能数据库技术,信息集成,数据网格

Definition Method of Fog Factor Based on Vertex Shader

WANG Yan   

  1. (College of Information Science and Technology, Jinan University, Guangzhou 510632, China)
  • Online:2011-04-20 Published:2012-10-31

摘要: Direct3D提供的线性、指数与指数平方3种雾化参数可便捷地渲染场景,但仅有的参数限制了雾化的多样性。雾化因子在定义参数的公式中起决定作用,顶点着色器则具有单独渲染顶点的能力。为此,结合两者特性,提出一种雾化因子定义方法,并给出一个根据顶点高度、观察距离及雾的密度产生雾化效果的实例。实验结果表明,该方法突破了原有参数的限制,能灵活模拟现实中的雾化环境。

关键词: Direct3D图形系统, 顶点着色器, 雾化因子, 雾化效果

Abstract: Fog effect can enhance the realism and distance of scene. Linear, exponential and exponential-squared fog parameters are enumerated in Direct3D, and they make the real-time rendering rapid and convenient, however, the various transformations of fog are limited by the only three parameters. Fog factor is the key to define the formula of parameters, and vertex shader has the ability to render vertex separately. This paper discusses a way to reconstruct the formula of fog factor by combination of the features above, gives an example, which can implement the fog effect according to the altitude of scene, the distance between observer and scene and the density of fog. Experimental results show that the restriction of original parameters can be improved in this way, and fog effect in reality can be imitated freely.

Key words: Direct3D, vertex shader, fog factor, fog effect

中图分类号: