Journal of Geo-information Science >
Research on Smooth Transition of Color Rendering for 3D Terrain
Received date: 2014-03-25
Request revised date: 2014-05-12
Online published: 2014-01-09
Copyright
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
HAN Litao , FAN Kenan . Research on Smooth Transition of Color Rendering for 3D Terrain[J]. Journal of Geo-information Science, 2015 , 17(1) : 31 -36 . DOI: 10.3724/SP.J.1047.2014.00031
Tab. 1 Changes of color components in color ring under RGB mode表1 RGB模式下色环上颜色分量的变化 |
颜色分区 | R分量 | G分量 | B分量 | |
---|---|---|---|---|
红到黄 | 1.0 | 0.0-1.0 | 0.0 | |
黄到绿 | 1.0-0.0 | 1.0 | 0.0 | |
绿到青 | 0.0 | 1.0 | 0.0-1.0 | |
青到蓝 | 0.0 | 1.0-0.0 | 1.0 | |
蓝到洋红 | 0.0-1.0 | 0.0 | 1.0 | |
洋红到红 | 1.0 | 0.0 | 1.0-0.0 |
Tab. 2 Color gradient effect based on different color models表2 不同颜色模型下的颜色渐变效果 |
颜色模式 | 色带 | 首、末端颜色值 |
---|---|---|
HSL | 红(0.0,1.0, 0.5)到黄(120, 1.0, 0.5) | |
RGB | 红(1.0, 0.0, 0.0)到黄(1.0, 1.0, 0.0) | |
HSL | 红(0.0, 1.0, 0.5)到青(180, 1.0, 0.5) | |
RGB | 红(1.0, 0.0, 0.0)到青(0.0, 1.0, 1.0) |
Fig. 1 Chart of multi-color gradient rendering for terrain图1 地形多色渐变渲染算法的流程图 |
Fig. 2 Shading effect of three methods without lighting图2 无光照模式下3种方法渲染后的观察效果 |
Fig. 3 Shading effect of three methods with lighting图3 光照模式下3种方法渲染后的观察效果 |
The authors have declared that no competing interests exist.
[1] |
|
[2] |
|
[3] |
|
[4] |
|
[5] |
|
[6] |
|
[7] |
|
[8] |
|
[9] |
|
[10] |
|
[11] |
|
[12] |
|
[13] |
|
[14] |
|
[15] |
|
[16] |
|
[17] |
|
[18] |
|
[19] |
|
[20] |
|
[21] |
|
/
〈 | 〉 |