terrain rendering using gpu-based geometry clipmaps

20
Terrain Rendering using Terrain Rendering using GPU-Based Geometry Clipmaps GPU-Based Geometry Clipmaps Arul Prakash Arul Prakash Hugues Hoppe Hugues Hoppe University of Utah University of Utah Microsoft Research Microsoft Research

Upload: sybil

Post on 25-Feb-2016

74 views

Category:

Documents


1 download

DESCRIPTION

Terrain Rendering using GPU-Based Geometry Clipmaps. Arul Prakash Hugues Hoppe University of Utah Microsoft Research. Terrain Rendering Challenges. Regular grid (image) of height values Concise storage  No paging hiccups Real-Time frame rates  60 fps - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Terrain Rendering using GPU-Based Geometry Clipmaps

Terrain Rendering usingTerrain Rendering usingGPU-Based Geometry ClipmapsGPU-Based Geometry Clipmaps

Arul PrakashArul Prakash Hugues Hoppe Hugues HoppeUniversity of Utah Microsoft University of Utah Microsoft

ResearchResearch

Page 2: Terrain Rendering using GPU-Based Geometry Clipmaps

Terrain Rendering ChallengesTerrain Rendering Challenges• Regular grid (image) of height Regular grid (image) of height

valuesvalues

• Concise storage Concise storage No paging hiccups No paging hiccups• Real-Time frame rates Real-Time frame rates 60 fps 60 fps• Visual continuity Visual continuity No temporal No temporal

popspops

Page 3: Terrain Rendering using GPU-Based Geometry Clipmaps

A Change of FocusA Change of Focus

• Hoppe 1998 – Hoppe 1998 – Highly irregular Highly irregular ConnectivityConnectivity

• Lindstrom 1996 – Lindstrom 1996 – Semi-regular Semi-regular ConnectivityConnectivity

• Losasso & Hoppe Losasso & Hoppe 2004 – Totally 2004 – Totally regular regular ConnectivityConnectivity

Page 4: Terrain Rendering using GPU-Based Geometry Clipmaps

Geometry Geometry ClipmapsClipmaps

Coarsest Level

Finest Level

• Terrain as mipmap pyramidTerrain as mipmap pyramid• LOD using nested gridsLOD using nested grids

Page 5: Terrain Rendering using GPU-Based Geometry Clipmaps

Why GPU?Why GPU?

• Much less CPU utilization Much less CPU utilization • Very little AGP/PCIe bus Very little AGP/PCIe bus

utilizationutilization• Small system memory Small system memory

requirement requirement • Small video memory requirement Small video memory requirement • Significant rendering speedupSignificant rendering speedup

Page 6: Terrain Rendering using GPU-Based Geometry Clipmaps

GPU Implementation OverviewGPU Implementation Overview• DirectX 9.0c – support for Shader Model DirectX 9.0c – support for Shader Model

3.03.0• HLSL code on book’s CDHLSL code on book’s CD

• Store data as textures (in video memory)Store data as textures (in video memory)– Elevation data – 32-bit 1-channel textureElevation data – 32-bit 1-channel texture– Normal data – 8-bit 4-channel texture Normal data – 8-bit 4-channel texture

• Update parts of texture that changeUpdate parts of texture that change

Page 7: Terrain Rendering using GPU-Based Geometry Clipmaps

Rendering

System DesignSystem DesignUpdate

-Use (x, y) to lookup z Use (x, y) to lookup z value in elevation texturevalue in elevation texture-Compute Compute αα - Blend GeometryBlend Geometry

- Blend normals- Does the shading- Texture lookup

Vertex Shader

Pixel Shader

•Predict fine level data from coarse level data

•Add residuals

•Update normal map texture

Vertex Textures

Supported in DirectX 9.0c & Shader Model

3.0 on NVIDIAGeForce 6800

Page 8: Terrain Rendering using GPU-Based Geometry Clipmaps

Clipmap UpdateClipmap Update

• Shift clipmap levels as user movesShift clipmap levels as user moves

finestfinestlevellevel

coarsestcoarsestlevellevel

Page 9: Terrain Rendering using GPU-Based Geometry Clipmaps

UpsampleUpsample

GPU

Page 10: Terrain Rendering using GPU-Based Geometry Clipmaps

Add residualsAdd residuals

+GPU

Compressed residuals (350MB

for US)

System Memory

ROI decompression (CPU)

Residual Image in video memory

Page 11: Terrain Rendering using GPU-Based Geometry Clipmaps

Incremental updateIncremental update

Before update

Update region

After update

Page 12: Terrain Rendering using GPU-Based Geometry Clipmaps

Individual Clipmap LevelsIndividual Clipmap Levels

n=15 verticesn=15 vertices

ExampleExample: n=15, m=4: n=15, m=4

mmm blockm block

(2m+1)(2m+1)2 interior trim2 interior trim

mm3 ring fix-up3 ring fix-up

outer degenerate tri.outer degenerate tri.

viewpointviewpoint

• See Section 2.3.2 in bookSee Section 2.3.2 in book

Page 13: Terrain Rendering using GPU-Based Geometry Clipmaps

View-frustum cullingView-frustum culling

• Culling done at block level on CPUCulling done at block level on CPU• 2-3x speedup2-3x speedup

Page 14: Terrain Rendering using GPU-Based Geometry Clipmaps

Timing ResultsTiming ResultsPrevious Previous

ImplementatImplementationion

Current Current ImplementatImplementat

ionionUpsamplingUpsampling 3 ms3 ms 1.3ms1.3ms

DecompressiDecompressionon

8 ms8 ms 8 ms8 ms

Normal Map Normal Map ComputationComputation

11 ms11 ms 0.6 ms0.6 ms

Page 15: Terrain Rendering using GPU-Based Geometry Clipmaps

PerformancePerformance• Synthesized terrainSynthesized terrain

– 130 frames/second (render-bound)130 frames/second (render-bound)– 120 frames/second (synthesized)120 frames/second (synthesized)– 60 million triangles per second60 million triangles per second– CPU utilization: ~0 CPU utilization: ~0 – AGP bus utilization: ~0AGP bus utilization: ~0

• Decompressed terrainDecompressed terrain– 87 frames/second during viewer motion87 frames/second during viewer motion– Decompression on CPU bottleneckDecompression on CPU bottleneck

Page 17: Terrain Rendering using GPU-Based Geometry Clipmaps

SummarySummary• SimplicitySimplicity• Optimal rendering throughputOptimal rendering throughput• Visual continuityVisual continuity• Steady renderingSteady rendering• Graceful degradationGraceful degradation

• CompressionCompression• SynthesisSynthesis

Page 18: Terrain Rendering using GPU-Based Geometry Clipmaps

Questions?Questions?

• See GPU Gems 2, Chapter 2See GPU Gems 2, Chapter 2

• http://developer.nvidia.comhttp://developer.nvidia.comThe Source for GPU ProgrammingThe Source for GPU Programming

[email protected]@cs.utah.edu

• Slides available onlineSlides available online

Page 19: Terrain Rendering using GPU-Based Geometry Clipmaps

GPU Gems 2GPU Gems 2 Programming Techniques for High-PerformanceProgramming Techniques for High-PerformanceGraphics and General-Purpose ComputationGraphics and General-Purpose Computation

• 880 full-color pages, 330 figures, hard cover880 full-color pages, 330 figures, hard cover• $59.99$59.99• Experts from universities and industryExperts from universities and industry

“The topics covered in GPU Gems 2 are critical to the next generation of game engines.”— Gary McTaggart, Software Engineer at Valve, Creators of Half-Life and Counter-Strike

“GPU Gems 2 isn’t meant to simply adorn your bookshelf—it’s required reading for anyone trying to keep pace with the rapid evolution of programmable graphics. If you’re serious about graphics, this book will take you to the edge of what the GPU can do.”—Rémi Arnaud, Graphics Architect at Sony Computer Entertainment

Page 20: Terrain Rendering using GPU-Based Geometry Clipmaps