地球信息科学学报 ›› 2015, Vol. 17 ›› Issue (1): 31-36.doi: 10.3724/SP.J.1047.2014.00031

• • 上一篇    下一篇

三维地形颜色渐变渲染的光滑过渡方法研究

韩李涛1,2(), 范克楠1   

  1. 1. 山东科技大学 测绘科学与工程学院,青岛 266590
    2. 海岛(礁)测绘技术国家测绘地理信息局重点实验室,青岛 266590
  • 收稿日期:2014-03-25 修回日期:2014-05-12 出版日期:2015-01-10 发布日期:2014-01-09
  • 作者简介:

    作者简介:韩李涛(1978-),男,博士,副教授,研究方向为虚拟地理环境和空间信息可视化。E-mail:hlt1978@sohu.com

  • 基金资助:
    国家自然科学基金项目(41201381、41376108);山东省“泰山学者”建设工程专项经费资助;海岛(礁)测绘技术国家测绘地理信息局重点实验室资助项目(2012A04)

Research on Smooth Transition of Color Rendering for 3D Terrain

HAN Litao1,2,*(), FAN Kenan1   

  1. 1. Geomatics College, Shandong University of Science and Technology, Qingdao 266590, China
    2. Key Laboratory of Surveying and Mapping Technology on Island and Reed, NASMG, Qingdao 266590, China
  • Received:2014-03-25 Revised:2014-05-12 Online:2015-01-10 Published:2014-01-09
  • Contact: HAN Litao E-mail:hlt1978@sohu.com
  • About author:

    *The author: CHEN Nan, E-mail:fjcn99@163.com

摘要:

地形颜色渐变渲染是表达地形起伏变化或其他地学要素空间分布变化趋势的常用方法。在三维地学交互分析系统中观察分析三维地学信息时,需要依据观察位置和分析区域的范围大小不停地变化视角和视距。当观察距离很近时,利用包含一定颜色数的色带渲染地形会出现明显的颜色分层现象,不能很好地表达地形颜色的光滑过渡。针对三维地学交互分析系统对地形颜色渐变渲染的操作需求和存在的问题,分析了RGB和HSL两种颜色模型的特点,顾及OpenGL的颜色平滑过渡原理,在RGB颜色空间通过对所有颜色分量进行线性插值实现了地形双色渐变渲染,在HSL颜色空间通过固定饱和度、亮度,对色相进行线性插值实现了地形多色渐变渲染,并通过加入光照计算来增强地形颜色渐变晕渲的三维立体效果。实验结果表明:本文方法能很好地兼容OpenGL的平滑着色,实现三维交互环境下任意距离观察地形均能保持颜色之间光滑渐进过渡,达到更为光滑的地形颜色渐变渲染效果。

关键词: 地形可视化, 颜色模型, 颜色渐变, 光照计算

Abstract:

Terrain rendering using gradient color is a common way to express spatial distribution and change of topography or other geological factors. Observation and analysis of geological information in the three-dimensional interactive analysis system require users to change the visual angle and distance of the sight according to the observation location and the extent of the analysis area. When the observation distance is very close, an obvious stratification phenomenon will appear when using a color ribbon of selected colors to render terrain, which is unable to express perfectly the smooth transition effect of terrain color rendering. For operation requirements and to overcome existed problems of terrain gradient color rendering in the three dimensional geological interactive system, this paper analyzes characteristics of two color models: RGB and HSL. Combined with the color smooth transition principle of OpenGL, double-color gradient rendering for terrain is realized through interpolating linearly every color component in the RGB color space respectively. And multi-color gradient rendering is achieved for terrain through interpolating hue linearly and fixing saturation and lightness in the color space HSL. In addition, lighting calculation is proposed to be added to enhance the three-dimensional effect of color gradient shaded terrain. At last, a piece of terrain is selected to test the above methods. The rendered effects of the terrain using the double-color gradient interpolation, the multi-color gradient interpolation and a color ramp with 30 colors are compared with each other. Experimental results show that these methods can provide better compatibility with smooth shading algorithms of the OpenGL library, keep smooth gradual transition between colors in a three-dimensional interactive environment when observing the terrain from any distance, and achieve smoother color gradient rendering for the terrain.

Key words: terrain visualization, color model, color gradient, lighting computation