二维矢量线符号在三维地形表面的贴合渲染方法
作者简介:谈心(1990-),男,江苏南京人,硕士生,研究方向为三维GIS及其应用。E-mail:MG1327054@smail.nju.edu.cn
收稿日期: 2015-10-10
要求修回日期: 2015-11-09
网络出版日期: 2015-12-20
基金资助
国家自然科学基金项目(41371365)
A New Method of Rendering 2D Vector Line Symbols on 3D Terrain Surface
Received date: 2015-10-10
Request revised date: 2015-11-09
Online published: 2015-12-20
Copyright
二维矢量符号是二维地图的重要组成部分。如何将二维矢量符号准确地贴合渲染在三维地形模型表面是地理信息科学的研究热点之一。针对线状矢量要素(简单线和周期线)中现有方法存在的周期线周期分布不均、渲染精度低、性能受地形模型复杂度影响大、矢量要素与地表贴合不紧密等问题,本文提出了一种基于屏幕像素进行投影反算的渲染方法,以及基于地表延伸长度的周期判断方法。该方法通过预处理计算线要素贴合在地表的真实长度,并将线要素按其实际宽度进行面域化处理;实时计算每个屏幕像素在二维矢量平面内的覆盖范围,通过该范围与矢量面域的位置关系筛选位于其内部的像素;进一步通过线的实际长度进行周期判断以确定像素色彩值。整个过程通过CPU-GPU并行异构计算模型实现,提高了场景交互性能。实验表明,本方法具有周期分布均匀、渲染精度高、贴合结果真实准确和性能不受地形模型影响等优点。
谈心 , 佘江峰 . 二维矢量线符号在三维地形表面的贴合渲染方法[J]. 地球信息科学学报, 2015 , 17(12) : 1483 -1489 . DOI: 10.3724/SP.J.1047.2015.01483
Two-dimensional (2D) vector symbols are important components on 2D maps. How to accurately overlay the symbols on the three-dimensional (3D) terrain surface becomes one of the research hotspots in geoscience at present. This paper proposes a method for mapping the 2D vector lines (simple lines and periodically changed lines) onto the 3D terrain model based on the inverse projection of screen coordinates, with an additional period judgment based on the spread lengths of lines on terrain surface. The method solves some problems that might occur within other existing methods, for example: the poor rendering accuracy, being sensitive to terrain model complexity, not fitting in the terrain surface tightly, and so on. The key steps of the method include: calculating the spread length of the overlaid lines on terrain surface and extending them into polygons during pre-processing; projecting every screen pixel to the 3D world space and then to the 2D vector plane, and ruling out the pixels that are out of the range of the polygons; setting the color for each of the remaining pixels in terms of the result of period judgment based on the spread lengths of lines on terrain surface. Attribute to a CPU-GPU heterogeneous parallel model, the running performance is improved evidently. The lines can be authentically overlaid on the terrain model and with its running performance independent to the complexity of terrain model. The final rendering effect shows that the periodically changed symbols can be evenly distributed over the line with a high rendering accuracy on screen.
Key words: GIS; 3D cartography; vector data; computer graphics; parallel computing
Fig. 1 Technique route图1 技术路线图 |
Fig. 2 Different cycle distributions of the cyclical-changed line symbol图2 周期变化线的不同周期性分布示意图 |
Fig. 3 Width optimization of line图3 线宽优化效果图 |
Fig. 4 Diagram of period judgment图4 周期判断方法示意图 |
Fig. 5 Paralleled rendering of vectors on terrain surface图5 二维矢量在地表的并行渲染效果 |
Tab. 1 Hardware and software environment associated with algorithm developing and running表1 算法开发与运行平台软硬件环境 |
项目 | 参数 |
---|---|
中央处理器 (CPU) | Inter® Xeon® CPU E5-2609 0 @2.4 Ghz |
图形处理单元 (GPU) | NVIDIA® Quadro® 4000 2GB RAM |
三维开发引擎 | OpenSceneGraph (OSG) |
GPU并行工具包 | NVIDIA® CUDA™ v5.5 |
地形与矢量数据处理工具包 | Geospatial Data Abstraction Library (GDAL) |
Tab. 2 Experiments on real-time performance表2 实时性能测试 |
序号 | 矢量数据量 (顶点数) | 地形数据量 (三角形数) | 地形 LOD层 | 窗口大小 (宽×高,像素) | 并行块数量 | 并行块大小 (宽×高,像素) | 仅渲染地形时帧速(fps) | 渲染地形与矢量时帧速 | |
---|---|---|---|---|---|---|---|---|---|
仅CPU(fps) | CPU+GPU(fps) | ||||||||
1 | 2134 | 3048 | 3 | 600 × 400 | 4800 | 10 × 20 | 75.9 | 1.1 | 29.8 |
2 | 2134 | 3048 | 3 | 1024 × 768 | 4800 | 10 × 20 | 68.3 | 1.1 | 22.1 |
3 | 2134 | 3048 | 3 | 1200 × 800 | 4800 | 10 × 20 | 60.8 | <1.0 | 20.2 |
4 | 2134 | 3048 | 3 | 1200 × 800 | 1600 | 20 × 30 | - | - | 12.6 |
5 | 2134 | 3048 | 3 | 1200 × 800 | 2400 | 20 × 20 | - | - | 19.5 |
6 | 2134 | 3048 | 3 | 1200 × 800 | 9600 | 10 × 10 | - | - | 20.2 |
7 | 1640 | 3048 | 3 | 1200 × 800 | 4800 | 10 × 20 | - | - | 23.3 |
8 | 4101 | 3048 | 3 | 1200 × 800 | 4800 | 10 × 20 | - | - | 15.5 |
9 | 10 171 | 3048 | 3 | 1200 × 800 | 4800 | 10 × 20 | - | - | 5.8 |
10 | 2134 | 1468 | 1 | 1200 × 800 | 4800 | 10 × 20 | - | - | 20.1 |
11 | 2134 | 10 475 | 5 | 1200 × 800 | 4800 | 10 × 20 | - | - | 20.1 |
12 | 2134 | 22 530 | 9 | 1200 × 800 | 4800 | 10 × 20 | - | - | 20.0 |
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] |
|
/
〈 | 〉 |