interactive editing of complex terrains on parallel graphics architectures

52
INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES Ufuk Gün

Upload: quanda

Post on 24-Feb-2016

44 views

Category:

Documents


0 download

DESCRIPTION

INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES. Ufuk Gün. Terrain Editing. What is terrain editing? Implementation Editing on paged data. Terrain Editing – What is it?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS

ARCHITECTURES

Ufuk Gün

Page 2: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Terrain Editing

• What is terrain editing?• Implementation• Editing on paged data

Page 3: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Terrain Editing – What is it?

• Terrain editing is the manipulation of terrain mesh which is controlled by the user of the application.

• There are several brushes like: – Raise, Lower, Flat, Smooth, Noise– Paint Color– Paint Texture

Page 4: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Implementation (1)Changing the primitive set data

• Advantages– Easy to implement

• Disadvantages– Slow because it needs to be recompiled.

Page 5: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Implementation (2) Sending height data as texture to the shaders.

• Advantages– Easy to implement– No recompilation

• Disadvantages– Unefficient data transfer to GPU– Culling mechanism fails

Page 6: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Implementation (3)Editing vertices using Vertex Buffer Object (VBO)

• What is VBO?– A vertex buffer object is a feature that allows the program

to store data in application memory.

Page 7: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Implementation (3)Editing vertices using Vertex Buffer Object (VBO)

• Why it is chosen?– This method enables accessing and changing the vertex

data from the application side– Decreases the amount of unnecesarily changing data– Faster because does not need to recompile

Page 8: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Terrain Editing on Paged Data• Terrain Paging

– Number of All Pages : 6x6– Number of Viewing Pages : 3x3– Number of Active Page : 1x1

Page 9: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Terrain Editing on Paged Data• Terrain Paging on Borders

– Number of All Pages : 6x6– Number of Viewing Pages : 2x2– Number of Active Page : 1x1

Page 10: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Terrain Editing on Paged Data• Moving the active page

– Number of All Pages : 6x6– Number of Common Pages : 1x3

Page 11: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Terrain Texturing

• Texture Painting• Slope Based Texturing• Procedural Texturing• Texturing with Satellite Image• Lightmap• Other Colorings

Page 12: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Texture Painting – Brute Force Approach

• Brute force aproach is texturing all the terrain with a very large image– Terrain size = 1024m x 1024m– Texture Resolution = 256 x 256 per meter^2

=>– Texture Size = 262144 x 262144– Size on Disk ~= 95GB

Page 13: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Texture Painting – Alphamap Approach

• Alphamaps are textures that shows the placement of detail textures

• Each channel of alphamap image represents one detail texture placement

Page 14: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Texture Painting – Alphamap Approach

Result Image• Red : Grass.jpg• Green : Sand.jpg• Blue : Water.jpg

Page 15: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Texture Painting – Base Texture

• Color terrain roughly• Decrease the effect of repeating detail textures

Before After

Page 16: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Texture Painting – Base Texture

Alphamap

Detail Textures

Base Texture

Result

Page 17: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Slope Based Texturing• Slope Texture is used on terrain regions where slope is close

to perpendicular to ground• Applied on shader with the normal value of vertices

Page 18: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Precedural Texturing• Terrain texturing with the height values

– Top : Snow.jpg– Middle : Sand.jpg– Bottom : Grass.jpg

• Applied on CPU side

Page 19: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Texturing with Satellite Images

• Tiling texture with a satellite image• Satellite image can be retrieved by GIS tool

Page 20: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Lightmaps• Problem:

– Light calculation is an expensive process especially when there are more than 8 lights

• Solution:– Using a lightmap for static lights– Lightmap is a precalculated image that shows the illumination of the

terrain

Page 21: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Lightmaps

Day

Sunset

Night

Lightmap Texture

Page 22: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Other Colorings

• Coloring by Height• Terrain Grids• Contour Lines• Editing Circle&Square

Page 23: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Coloring by Height

• Terrain coloring by height values• It is used for analysis

Height Values Colors Values (Red, Green, Blue) Color

0 0, 0, 255

33 85, 170, 255

66 85, 255, 0

99 255, 170, 0

132 85, 0, 0

200 255, 170, 127

Page 24: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Other Colorings

Terrain Grid Contour Lines

Page 25: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD

• Simplification Algorithm• Tiled Block Methods

– Paged Tiled Blocks– Merged Paged Tiled Blocks

• Threaded Loading Simplified Pages

Page 26: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD - Simplification• What is simplified terrain?

– It is a good representation of the original terrain which is produced by eliminating of vertices whose absence is not recognized.

• Advantages– Loss is not recognized

• Disadvantages– Simplification is an expensive process– All the detail levels should be calculated before the rendering process– Simplified terrains should be stored on disk (need memory)

Page 27: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD - Simplification• An example of simplification

Page 28: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD – Tile Blocks

• What is Tile Blocks– Aims to render square patches with different resolutions– The resolution decreases by the distance to the view point– Around the viewer, there are nested grids– Grid resolutions differ by a factor of two

Page 29: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD – Tile Blocks

• Advantages– Data structure is simple– Smooth transitions– Efficient compression

• Disadvantages– Cracks may occur on the borders– Pages should be merged to use this algoritm

• Long preprocess• Paging cannot be applied as it should be

Page 30: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD Threaded Simplified Paged LOD

• What is it?– A mechanism that loads terrain data in different

details on another thread– All the terrain simplification and generation

process is done on another thread without decreasing the frame rates

Page 31: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD Threaded Simplified Paged LOD

• How does it work?– Send camera position to pages– Each page creates a thread that calculates new resolution

• If resolution should be increased– Read data from disk

• If resolution should be decreased– Simplify old page

• Generate new terrain– If new terrain is generated

• Load new terrain

Page 32: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD Threaded Simplified Paged LOD

• Simplification– Elimination of vertices by discarding half of them

• Advantages– Fast– Easy to handle

Page 33: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD Threaded Simplified Paged LOD

• An example of LOD

LOD = 0 LOD = 1 LOD = 2

Page 34: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Paged Terrain LOD Threaded Simplified Paged LOD

No LOD LOD

Page 35: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Texture LOD

• What is Texture LOD?– Using high resolution textures on regions that are

close to the viewpoint and using low resolution textures that are farther from the camera.

256x256 128x128 64x64 32x32 1x1

Page 36: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Texture LOD

• Advantages– Reduces memory consumption of the

application– Increases rendering performance– Decreases the loading time

Page 37: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Texture LOD

No LOD LOD

Page 38: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Performance of LODTerrain Size Number of Pages No LOD (FPS) LOD (FPS)

1024 x 1024 4 x 4 232 352

2048 x 2048 8 x 8 105 305

4096 x 4096 16 x 16 51 150

6144 x 6144 24 x 24 28 68

6400 x 6400 25 x 25 16 58

6656 x 6656 26 x 26 N/A 57

7168 x 7768 28 x 28 N/A 53

8192 x 8192 32 x 32 N/A 48

Page 39: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Parallel Rendering• Why Parallel Rendering?

• Increase visual quality• Inrease screen size• Create Dom or Cube display systems

• Equalizer• OpenSceneGraph (OSG)• Configuration• Advantages• Results

Page 40: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Equalizer• A toolkit for scalable parallel rendering based on

OpenGL which provides an API to develop scalable graphics applications for wide range of systems.

• Enables multiple graphic cards, processors or computers to scale rendering performance, visual quality and display size.

• Scalable, flexible and compatible with less implementation overhead

• Configurable

Page 41: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

OpenSceneGraph - OSG• An open source, cross-platform graphics toolkit for developing

graphics applications. • Based on “Scene Graph” and Object Oriented Framework• Performance abilities:

– View-Frustum Culling– Occlusion Culling – Small feature Culling– Level of Detail nodes– OpenGL state sorting– Vertex arrays– Vertex Buffer Objects– OpenGL Shader Language– Display lists

Page 42: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Parallel Rendering

• Configuration– Multiple graphic cards– Multiple computers

• Our configuration– 1 PC x 3 GPU x 2 Output = 6 Display

Page 43: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Application

• Terrain Editor• Multi-Screen Terrain Viewer

Page 44: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Terrain Editor - Abilities• Heightmap manipulation• Texture manipulation• Object Management

– Model– Road– River– Water– Vegetation

• GIS integration• Creating and editing of large area terrains

Page 45: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Terrain Editor - Demo

Page 46: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Multi-Screen Terrain Viewer

• Multi-Screen display• Rendering large area terrains• Paged LOD• Configurable setup• View-Frustum Culling

Page 47: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Multi-Screen Terrain Viewer - Demo

Page 48: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Achievements

• Large Area Terrain Editor• GIS integration• Paged LOD Mechanism• Multi-Screen Display Viewing and Parallel

Rendering of a Terrain

Page 49: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Limitations

• Number of pages viewing at the same time• Camera speed• Area of the terrain

Page 50: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Future Work

• Multi-Resolution Terrain Editing• Crack Avoidance Mechanism• Editing on LOD• Real-Time Terrain Deformation• Number of Threads

Page 51: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Thanks

Page 52: INTERACTIVE EDITING OF COMPLEX TERRAINS ON PARALLEL GRAPHICS ARCHITECTURES

Questions?