WSCG 2007 Hardware Independent Clipmapping A. Seoane, J. Taibo, L. Hernández, R. López, A. Jaspe VideaLAB – University of A Coruña (Spain)
WSCG 2007 Summary Introduction Previous aproaches Hardware independent clipmapping –Structure overview –Updating –Rendering Example of application Results Conclusions
WSCG 2007 Introduction Texture mapping is a common technique to add realism to geometry models In terrain visualization we need to apply textures to add realism and show several kind of information over the digital elevation model of the terrain Problems: –Real-time high quality render: aerial imagery up to 0.25 m/pixel resolution –Limited storage capacity (system and video memory) –Management of huge amount of texture data (over a terabyte)
WSCG 2007 Previous aproaches Terrain rendering: –Database paging algorithms –A lot of geometry management algorithms but few texture management ones Texture management techniques: –Most of them have a strong dependency between geometry and texture databases generation
WSCG 2007 Previous aproaches Clipmapping [Tanner’98]: allows to manage huge textures without dependency of the geometry database Idea: cache a subset of the whole texture mipmap pyramid in video memory Problems: –Very expensive hardware required (SGI’s InfiniteReality architecture): hardware dependency –Do not support more than one clipmap simultaneously
WSCG 2007 Hardware independent clipmapping Based on clipmap idea We suggest different data structures and rendering algorithm to implement this idea on PCs Features: –Huge texture management (2 20 x2 20 texels) –Not specific hardware required: it can be implemented using OpenGL 1.2 fixed function pipeline –Independence between geometry and texture databases generation: Allows the use of diferent geometry algorithms without changing the texture database Allows to change the texture database without rebuilding the geometry database –High resolution rendering (0.25 meters/pixel resolution) –Multiple clipmap textures can be applied simultaneously
WSCG 2007 Structure overview Disk –Same that OpenGL Performer clipmap disk format –Mipmap pyramidal scheme: virtual texture –Every level stored being divided in square small fragments (tiles) –One file per tile –Space requirement example: 256x256 km area 0.25 meters resolution 2 20 x2 20 texels virtual texture About 4 Terabytes of texture database
WSCG 2007 Structure overview System memory –Disk tiles cached in a set of memory buffers One buffer per tile –Tile cache: The number of memory buffers are specified by user Asynchronous loading LRU algorithm used to choose the next buffer to store a disk tile
WSCG 2007 Structure overview Video memory –Subset of virtual texture cached in video memory
WSCG 2007 Structure overview Video memory –Stack of texture levels (texture stack): one hardware texture per level –All the stack levels have the same size: clipsize –Each stack level has his own mipmap levels clipsize
WSCG 2007 Structure overview Video memory –Each finest level covers half the area and has double resolution of the previous level –Space requirements example: 2 20 x2 20 texels virtual texture 2048 clipsize Mb of video memory required 1024 clipsize - 44 Mb of video memory required clipsize
WSCG 2007 Updating Center of detail: –Point where we need the best texture quality: normally close to the viewer –The application must update the center of detail on each frame –When the center of detail changes, the texture stack must be updated
WSCG 2007 Updating Texture stack updating: –Each stack texture is divided in small blocks called subtiles –When the center of detail changes, some subtiles must be updated –For each stack level: Find the invalid subtiles Request the necesary tiles from tile cache to update the invalid subtiles If the requested tiles are in cache, the related subtiles will be updated –Toroidal updating due to efficiency reasons virtual texture level texture level from the stack (toroidal update) clipsize subtile
WSCG 2007 Updating Load control –We limit the subtiles updated per frame to avoid frame drop –Priority loading: coarser tiles are loaded before finest ones Concentric rings update –Maximize the contiguous texture coverage
WSCG 2007 Rendering Apply the virtual texture over the geometry. Two approaches: –For each texture level, apply it, select the geometry covered by the level and draw that geometry –For each geometry patch, find and apply the finest texture level that covers it and draw the geometry patch
WSCG 2007 Rendering In both cases: –Virtual texture coordinates are bound to each vertex –We compute the correct texture coordinates for selected texture level scaling the virtual texture coordinates: scale factor = 2 stack level We don’t need to recompute the texture coordinates for each vertex. The scale factor can be applied using the texture matrix
WSCG 2007 Rendering Due to toroidal updating texture wrap mode must be setted to REPEAT virtual texture level texture level from the stack (toroidal update) clipsize wrap around (scale factor = 2)
WSCG 2007 Rendering Automatic texture coordinates generation –We can compute the texture coordinates dinamically using programable hardware Don’t need to precompute the texture coordinates for the geometry Can change the geometry dinamically preserving the correct mapping
WSCG 2007 Rendering Multitexturing –We can apply several simultaneous virtual textures. Allows to show several types of information over the terrain We need one stack for each virtual texture
WSCG 2007 Rendering: multitexturing
WSCG 2007 Rendering: multitexturing
WSCG 2007 Rendering: multitexturing
WSCG 2007 Example of application SANTI: Advanced interactive terrain navegation system –Developed since 1998 to display Galicia region ( northwest of Spain ) 200x250 km –Initially developed on SGI Infinite Reality arquitecture using clipmapping –At present we use an OpenGL implementation of our technique on PC –Uses an own geometry technique to manage a regular grid of 50 m resolution –Shows multiple textures over the terrain: Virtual texture of 0.25 m/pixel resolution from aerial data (2 20 x2 20 texels) Virtual texture to show geographic information (2 16 x2 16 texels)
WSCG 2007 SANTI
WSCG 2007 SANTI
WSCG 2007 SANTI
WSCG 2007 Results System –Pentium Ghz, 512 Mb RAM –Geforce 4 Ti4800SE, 128Mb –SATA disk with about 53 Mb/s bandwith Tested with SANTI –Navigation speed: 900 km/h –Two virtual textures mapped simultaneously Results –Framerate allways over 90 fps –Texture quality (% of texture stack updated) over 85%
WSCG 2007 Conclusions/future work We introduced a new tecnique for managing huge amounts of data based on clipmap idea –Allows independence between geometry and texture databases generation –Can be implemented without specific or programmable hardware (only if we want to compute texture coords dinamically we need to use programmable hardware) PCs, notebooks, PDAs, etc. –We add the feature of using multiple cliptextures simultaneously Future work –Procedural texture generation to show GIS information from vector data –New texture formats: compression
WSCG 2007 Thank you!
WSCG 2007 Hardware Independent Clipmapping A. Seoane, J. Taibo, L. Hernández, R. López, A. Jaspe VideaLAB – University of A Coruña (Spain)