没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
27
Terrain Rendering Using
GPU-Based Geometry Clipmaps
Arul Asirvatham
Microsoft Research
Hugues Hoppe
Microsoft Research
Chapter 2
The geometry clipmap introduced in Losasso and Hoppe 2004 is a new level-of-detail
structure for rendering terrains. It caches terrain geometry in a set of nested regular
grids, which are incrementally shifted as the viewer moves. The grid structure provides
a number of benefits over previous irregular-mesh techniques: simplicity of data struc-
tures, smooth visual transitions, steady rendering rate, graceful degradation, efficient
compression, and runtime detail synthesis. In this chapter, we describe a GPU-based
implementation of geometry clipmaps, enabled by vertex textures. By processing terrain
geometry as a set of images, we can perform nearly all computations on the GPU itself,
thereby reducing CPU load. The technique is easy to implement, and allows interactive
flight over a 20-billion-sample grid of the United States stored in just 355 MB of mem-
ory, at around 90 frames per second.
2.1 Review of Geometry Clipmaps
In large outdoor environments, the geometry of terrain landscapes can require signifi-
cant storage and rendering bandwidth. Numerous level-of-detail techniques have been
developed to adapt the triangulation of the terrain mesh as a function of the view.
However, most such techniques involve runtime creation and modification of mesh
structures (vertex and index buffers), which can prove expensive on current graphics
architectures. Moreover, use of irregular meshes generally requires processing by the
CPU, and many applications such as games are already CPU-limited.
2.1 Review of Geometry Clipmaps
102_gems2_ch02_new.qxp 1/24/2005 12:35 PM Page 27
SECOND PROOFS
28
The geometry clipmap framework (Losasso and Hoppe 2004) treats the terrain as a
2D elevation image, prefiltering it into a mipmap pyramid of L levels as illustrated in
Figure 2-1. For complex terrains, the full pyramid is too large to fit in memory. The
geometry clipmap structure caches a square window of n
×n samples within each level,
much like the texture clipmaps of Tanner et al. 1998. These windows correspond to a
set of nested regular grids centered about the viewer, as shown in Figure 2-2. Note that
the finer-level windows have smaller spatial extent than the coarser ones. The aim is to
maintain triangles that are uniformly sized in screen space. With a clipmap size
n
= 255, the triangles are approximately 5 pixels wide in a 1024×768 window.
Only the finest level is rendered as a complete grid square. In all other levels, we render
a hollow “ring,” which omits the interior region already rendered at finer resolutions.
As the viewer moves, the clipmap windows are shifted and updated with new data. To
permit efficient incremental updates, the clipmap window in each level is accessed
toroidally, that is, with 2D wraparound addressing (see Section 2.4).
One of the challenges with the clipmap structure is to hide the boundaries between suc-
cessive resolution levels, while at the same time maintaining a watertight mesh and
avoiding temporal popping artifacts. The nested grid structure of the geometry clipmap
provides a simple solution. The key idea is to introduce a transition region near the outer
perimeter of each level, whereby the geometry and textures are smoothly morphed to
interpolate the next-coarser level (see Figure 2-3). These transitions are efficiently imple-
mented in the vertex and pixel shaders, respectively.
Chapter 2 Terrain Rendering Using GPU-Based Geometry Clipmaps
Figure 2-1. How Geometry Clipmaps Work
Given a filtered terrain pyramid of L levels, the geometry clipmap caches a square window at each
resolution level. From these windows, we extract a set of L nested “rings” centered about the
viewer. The finest-level ring is filled in.
102_gems2_ch02_new.qxp 1/24/2005 12:36 PM Page 28
SECOND PROOFS
The nested grid structure of the geometry clipmap also enables effective compression
and synthesis. It allows the prediction of the elevation data for each level by upsampling
the data from the coarser level. Thus, one need only store or synthesize the residual
detail added to this predicted signal.
2.1 Review of Geometry Clipmaps
29
Figure 2-2. Terrain Rendering Using a Coarse Geometry Clipmap
Illustration of terrain rendering using a coarse geometry clipmap (size n = 31, L = 10). Each
colored ring is formed from a different clipmap level.
Figure 2-3. Achieving Visual Continuity by Blending Within Transition Regions
(a) Transition regions (in purple). (b) Without blending. (c) With blending.
(a) (b) (c)
102_gems2_ch02_new.qxp 1/24/2005 12:36 PM Page 29
SECOND PROOFS
30
2.2 Overview of GPU Implementation
The original implementation of geometry clipmaps presented in Losasso and Hoppe
2004 represents each clipmap level as a traditional vertex buffer. Because the GPU cur-
rently lacks the ability to modify vertex buffers, that implementation required signifi-
cant intervention by the CPU to both update and render the clipmap (see Table 2-1).
In this chapter, we describe an implementation of geometry clipmaps using vertex tex-
tures. This is advantageous because the 2D grid data of each clipmap window is much
more naturally stored as a 2D texture, rather than being artificially linearized into a 1D
vertex buffer.
Recall that the clipmap has L levels, each containing a grid of n
×n geometric samples.
Our approach is to split the (x, y, z) geometry of the samples into two parts:
●
The (x, y) coordinates are stored as constant vertex data.
●
The z coordinate is stored as a single-channel 2D texture—the elevation map. We
define a separate n
×n elevation map texture for each clipmap level. These textures are
updated as the clipmap levels shift with the viewer’s motion.
Because clipmap levels are uniform 2D grids, their (x, y) coordinates are regular, and
thus constant up to a translation and scale. Therefore, we define a small set of read-only
Chapter 2 Terrain Rendering Using GPU-Based Geometry Clipmaps
Table 2-1. Comparison with Original CPU Implementation
Our implementation of geometry clipmaps using vertex textures moves nearly all operations
to the GPU.
Original Implementation
1
GPU-Based Implementation
Elevation Data In vertex buffer In 2D vertex texture
Vertex Buffer Incrementally updated by CPU Constant!
Index Buffer Generated every frame by CPU Constant!
Upsampling CPU GPU
Decompression CPU CPU
Synthesis CPU GPU
Adding Residuals CPU GPU
Normal-Map Update CPU GPU
Transition Blends GPU GPU
1. Losasso and Hoppe 2004.
102_gems2_ch02_new.qxp 1/24/2005 12:36 PM Page 30
SECOND PROOFS
剩余18页未读,继续阅读
资源评论
Jennnya
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功