Virtual Texture Mapping

本文介绍了VirtualTextureMapping(VTM)技术,这是一种减少纹理所需的显存的方法,只依赖于屏幕分辨率。VTM通过自动缓存和加载当前视角需要的纹理部分来工作,防止渲染中的空洞。文章详细讨论了VTM的实现,包括分块管理、页缓存、页故障生成、渲染过程以及压缩和过滤等挑战,强调了如何处理边缘过滤和确保无缝渲染。
摘要由CSDN通过智能技术生成

Virtual Texture Mapping (VTM ) is a technique to reduce the amount of graphics memory required for textures to a point where it is only dependent on the screen resolution: for a given viewpoint we onlu keep the visible parts of the textures in graphics memory, at hte appropriate MIP map level.

while early texture management schemes were design for a single large texture. recent VTM system are more flexible and mimic the virtual memory management of the OS: texture are divided into small tiles, or pages. Those are automatically cached and loaded onto the GPU as required for rendering the current viewpoint, However,it is necessary to redirect access to missing data to a fallback texture. This prevent "holes" from appearing in the rendering or blocking and waiting until the load request finishes.

in Figure “@Wang”, we begin each frame by determining which tiles are visible.we identify the ones not cached and request them form disk . After the tiles have been uploaded into the tile cache on the GPU we update an indirection texture or page table.. Eventtually, we render the scene ,performing an initial lookup into the indirection texture to determine where to sample in the tile cache.

图片中 蓝色方块为不可见的像素(IDs) 红色方块为新增的可见的像素,绿色为在一定帧数类可见的像素块

The indirection texture is a scaled down version of the complete virtual texture.. where each texel points to a tile in the tile cache.

Title from different MIP map levels cover differently sized areas of the virtual texture, but simplifies the management if the tile cache considerably.

Page Fault Generation

For each frame we determine the visible tiles. identify the ones not yet loaded onto the GPU, and request them frome disk. Future hardware might simplify this native page faults but we still need to determine visible tiles, substitute data and redirect memory access..

A simple approach is to render the complete scene with a special shader thattranslates the virtual texture coordinates into a tile ID. By rendering the actualgeometry of the scene, we trivially handle occlusion. The framebuffer is then readback and processed on the CPU along with other management tasks. As tilestypically cover several pixels, it is possible to render tile IDs at a lower resolutionto reduce bandwidth and processing costs. Also, in order to pre-fetch tiles that willbe visible “soon,” the field of view can be slightly increased.

Page Handler

The page handler loads requested tiles from disk, uploads them onto the GPU, andupdates the indirection texture. Depending on disk latency and camera movement,loading the tiles might become a bottleneck.

Rendering

When texturing the surface we perform a fast unfiltered lookup into the indirection texture, using the uv-coordinate of the fragment in virtual texture space. This provides the position of the target tile in the cache and the actual resolution of its MIP map level in the pyramid of the indirection texture. The latter mightbe different from the resolution computed from the fragment’s MIP map leveldue to our tile upload limit. We add the offset inside the tile to the tile positionand sample from the tile cache. The offset is simply the fractional part of theuv-coordinate scaled by the actual resolution:

Implementation Details

In this section we will investigate various implementation issues with a strongemphasis on texture filtering. Again we will follow the processing of one frame,from page fault generation over page handling to rendering.

Page Fault Generation

MIP map level. To compute the tile ID in the tile shader we need the virtualtexture coordinates and the current MIP map level. The former are directly theinterpolated uvs used for texturing, but on DX 9 and 10 hardware, we have tocompute the latter manually using gradient instructions [Ewins et al. 98,Wu 98]:let

and

be the uv gradients in x- and y-direction.Using their maximal length we compute the MIP map level as

Compressed tiles.

For efficient rendering it is desirable to have a DXTC compressedtile cache. It requires less memory on the GPU and reduces the upload and Rendering Techniquesrendering bandwidth. However, as the compression ratio of DXTC is fixed andquite low, we store the tiles using JPEG and transcode them to DXTC before weupload them. This also allows us to reduce quality selectively and e.g., compresstiles of inaccessible areas stronger.

Disk I/O.

For our tutorial implementation we store tiles as individual JPEG filesfor the sake of simplicity. However, reading many small files requires slow seeksand wastes bandwidth. Packing the tiles into a single file is thus very important,especially for slow devices with large sectors like DVDs.It is possible to cut down the storage requirements by storing only every secondMIP map level and computing two additional MIP maps for each tile: if anintermediate level is requested, we load the corresponding four pages from thefiner level instead.

Cache saturation.

Unused tiles are overwritten with newly requested tiles using anLRU policy. However, the current working set might still not fit into the cache.In this case we remove tiles that promise low impact on visual quality. We replacethe tiles with the finest resolution with their lower-resolution ancestors. This playsnicely with our progressive update strategy and quickly frees the tile cache. Othergood candidates for removal are tiles with low variance or small screen space area.

Tile upload.

Uploading the tiles to the GPU should be fast, with minimum stalling.Using DX 9, we create a managed texture and let the driver handle the uploadto the GPU. Other approaches for DX 9 are described in detail by [Mittring 08].For DX 10 and 11, we create a set of intermediate textures and update thesein turn. The textures are copied individually into the tile cache [Thibieroz 08].DX 11 adds the possibility to update the tiles concurrently, which further increasesperformance.

Indirection texture update.

After the tiles have been uploaded, we update the indirection texture by recreating it from scratch. We start by initializing the top

此图为游戏中Camera 所看见的条目 从刚进入游戏初始化-》细节细化的GPU中间层纹理

of its MIP map pyramid with an entry for the tile with the lowest resolution, soeach fragment has a valid fallback. For each finer level we copy the entries of theparent texels, but replace the copy with entries for tiles from that level, shouldthey reside in the cache. We continue this process until the complete indirectiontexture pyramid is filled (see Figure).

If tiles are usually seen at a single resolution, we can upload only the finest levelto the GPU. This reduces the required upload bandwidth, simplifies the lookup,and improves performance. This is sufficient when every object uses an uniquetexture, in particular for terrain rendering.

Rendering

While rendering with a virtual texture is straight forward, correct filtering, especially at tile edges, is less obvious. Neighboring tiles in texture space are verylikely not adjacent to each other in the tile cache. Filtering is especially challenging if the hardware filtering units should be used, as those rely on having MIPmaps and correct gradients available. The following paragraphs describe how touse HW filtering with an anisotropy of up to 4:1 as shown in Figure "@1" Thecorresponding shader code can be found in Section 4.5.3.

Texture gradients. When two adjacent tiles in texture space are not adjacent inthe tile cache, as shown in Figure “@2”, the uv-coordinates for the final texturelookup will vary a great deal between neighboring fragments. This results inlarge texture gradients and the graphics hardware will use a very wide filter forsampling, producing blurry seams. To address this, we manually compute the

此图为MipMap 各向异性以 4:1方式显示的纹理 “@1”

此图左下角为表面虽然是连续像素但是在cache也是不连续的 “@2”

gradients from the original virtual texture coordinates, scale them depending onthe MIP map level of the tile and pass them on to the texture sampler.

Tile borders.

Even with correct texture gradients, we still have to filter into neighboring pages, which very likely contain a completely different part of the virtualtexture. To avoid the resulting color bleeding we need to add borders. Dependingon what constraints we want to place on the size of the tile, we can use inner orouter borders.

We use the latter and surround our

tiles with a four-pixel border, makingthem

. This keeps the resolution a multiple of four, allowing us to compressthem using DXTC and perform 4:1 anisotropic filtering in hardware.

DXTC border blocks.

As Figure “@3” illustrates, adding a border to tiles might leadto different DXTC blocks at the edges of tiles. As the different blocks will becompressed differently, texels that represent the same points in virtual texturespace will not have the same values in both tiles. This leads to color bleedingacross tile edges, despite the border. By using a four-pixel outer border, thesecompression related artifacts vanish

Conclusion:

本文出自GPU Pro 1,本文主要讲述了一个基本的虚拟纹理映射系统,从游戏画面中看到的纹理贴图 -》转换为 visible titleIDs ->

更新Tile Cache -》 产生新的一个间接纹理-》渲染显示

Shader Code

Tile ID Shader

Quadtree Displacement Mapping with Height Blending Michal Drobot Overview Introduction Overview of Ray-Tracing Algorithms Quadtree Displacement Mapping Self-Shadowing Ambient Occlusion Surface Blending General Advice Conclusion Bibliography NPR Effects Using the Geometry Shader Pedro Hermosilla and Pere-Pau Vazquez Introduction Previous Work Silhouette Rendering Pencil Rendering Acknowledgments Bibliography Alpha Blending as a Post-Process Benjamin Hathaway Introduction The Alternatives The Source Artwork Initial Attempts The Screen-Space Alpha Mask 3.6 3.7 3.8 3.9 3.10 3.11 4 4.1 4.3 4.4 4.5 4.6 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6 6.1 6.2 6.3 6.4 6.5 6.6 Alpha Reference Issues Rendering Pipeline Integration Conclusion Demo Acknowledgments Source Code Bibliography Virtual Texture Mapping 101 Matth¨aus G. Chajdas, Christian Eisenacher, Marc Stamminger and Sylvain Lefebvre Introduction Implementation Details Conclusion Shader Code Acknowledgments Bibliography Pre-Integrated Skin Shading Eric Penner and George Borshukov Introduction Background and Previous Work Pre-Integrating the Effects of Scattering Scattering and Diffuse Light Scattering and Normal Maps Shadow Scattering Conclusion and Future Work Appendix A: Lookup Textures Appendix B: Simplified Skin Shader Bibliography Implementing Fur Using Deferred Shading Donald Revie Deferred Rendering Fur Techniques Fur Implementation Details Conclusion Acknowledgments 7 7.1 7.4 7.5 7.6 7.7 7.8 8 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 9 9.1 9.2 9.3 10 10.1 10.2 10.3 10.4 10.5 Bibliography Large-Scale Terrain Rendering for Outdoor Games Ferenc Pint´er Introduction Content Creation and Editing Runtime Shading Performance Possible Extensions Acknowledgments Bibliography Practical Morphological Antialiasing Jorge Jimenez, Belen Masia, Jose I. Echevarria, Fernando Navarro and Diego Gutierrez Overview Detecting Edges Obtaining Blending Weights Blending with the Four-Neighborhood Results Discussion Conclusion Acknowledgments Bibliography Volume Decals Emil Persson Introduction Decals as Volumes Conclusions Bibliography Practical Elliptical Texture Filtering on the GPU Pavlos Mavridis and Georgios Papaioannou Introduction Elliptical Filtering Elliptical Footprint Approximation Results Conclusions 10.6 11 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 12 12.1 12.2 12.3 12.4 12.5 13 13.1 13.2 13.3 13.4 13.5 13.6 14 14.1 14.2 Acknowledgments Bibliography An Approximation to the Chapman Grazing-Incidence Function for Atmospheric Scattering Christian Schuler Introduction Atmospheric Scattering The Chapman Function Towards a Real-Time Approximation Implementation Putting the Chapman Function to Use Conclusion Appendix Bibliography Volumetric Real-Time Water and Foam Rendering Daniel Scherzer, Florian Bagar and Oliver Mattausch Introduction Simulation Rendering Artist Control Conclusion Bibliography Inexpensive Antialiasing of Simple Objects Mikkel Gj0l and Mark Gj0l Introduction Antialiasing via Smoothed Lines Rendering Lines Discussion Conclusion Acknowledgments Bibliography Practical Planar Reflections Using Cubemaps and Image Proxies Sebastien Lagarde and Antoine Zanuttini Introduction Generating Reflection Textures 14.3 14.4 14.5 15 15.1 15.2 15.3 15.4 15.5 15.6 15.7 15.8 15.9 16 16.1 16.2 16.3 16.4 16.5 16.6 17 17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.8 Using Reflection Textures Conclusion and Future Work Acknowledgments Bibliography Real-Time Ptex and Vector Displacement Karl Hillesland Introduction Packed Ptex Runtime Implementation Adding Displacement Performance Costs Memory Costs Alternatives and Future Work Conclusion Acknowledgments Bibliography Decoupled Deferred Shading on the GPU Gabor Liktor and Carsten Dachsbacher Introduction Decoupled Sampling in a Rasterization Pipeline Shading Reuse for Deferred Shading Implementation Results Acknowledgments Bibliography Tiled Forward Shading Markus Billeter, Ola Olsson and Ulf Assarsson Introduction Recap: Forward, Deferred, and Tiled Shading Tiled Forward Shading: Why? Basic Tiled Forward Shading Supporting Transparency Support for MSAA Supporting Different Shaders Conclusion and Further Improvements Bibliography 18 18.1 18.2 18.3 18.4 18.5 18.6 18.7 18.8 19 19.1 19.1 19.3 19.5 19.6 19.7 19.8 20 20.1 20.2 20.3 20.4 20.5 20.6 21 21.1 21.2 21.4 21.5 Forward+: A Step Toward Film-Style Shading in Real Time Takahiro Harada, Jay McKee and Jason C. Yang Introduction Forward+ Implementation and Optimization Results Forward+ in the AMD Leo Demo Extensions Conclusion Acknowledgments Bibliography Progressive Screen-Space Multichannel Surface Voxelization Athanasios Gaitatzes and Georgios Papaioannou Introduction Overview of Voxelization Method Progressive Voxelization for Lighting Performance and Evaluation Limitations Conclusion Acknowledgments Bibliography Rasterized Voxel-Based Dynamic Global Illumination Hawar Doghramachi Introduction Overview Implementation Handling Large Environments Results Conclusion Bibliography Per-Pixel Lists for Single Pass A-Buffer Sylvain Lefebvre, Samuel Hornus and Anass Lasram Introduction Linked Lists with Pointers (Lin-alloc) Post-sort and Pre-sort Memory Management 21.6 21.7 21.8 21.9 22 22.1 22.2 22.3 22.4 22.5 23 23.1 23.2 23.3 23.4 23.5 23.6 24 24.1 24.2 24.3 24.4 24.5 24.6 24.7 24.8 24.9 25 Implementation Experimental Comparisons Conclusion Acknowledgments Bibliography Reducing Texture Memory Usage by 2-Channel Color Encoding Krzysztof Kluczek Introduction Texture Encoding Algorithm Decoding Algorithm Encoded Image Quality Conclusion Bibliography Particle-Based Simulation of Material Aging Tobias Gunther, Kai Rohmer and Thorsten Grosch Introduction Overview Simulation Preview Rendering Results Conclusions Bibliography Simple Rasterization-Based Liquids Martin Guay Overview Introduction Simple Liquid Model Splatting Grid Pass Particle Update Rigid Obstacles Examples Conclusion Bibliography Next-Generation Rendering in Thief 25.1 25.2 25.3 25.4 25.5 25.5.3 25.6 25.7 26 26.1 26.2 26.3 26.4 27 27.1 27.2 27.3 27.4 27.5 27.6 27.7 27.8 27.9 27.10 28 28.1 28.2 Peter Sikachev, Samuel Delmont, Uriel Doyon and Jean-Normand Bucci Introduction Reflections Contact-Hardening Shadows Lit Particles Compute-Shader-Based Postprocessing Results Conclusion Acknowledgments Bibliography Grass Rendering and Simulation with LOD Dongsoo Han and Hongwei Li Introduction Render Grass Blades Simulation Conclusion Bibliography Hybrid Reconstruction Antialiasing Michal Drobot Introduction Overview Related Work Hybrid Antialiasing Overview Temporally Stable Edge Antialiasing Temporal Super-Sampling Temporal Antialiasing (TAA) Final Implementation Results Discussion Conclusion Bibliography Real-Time Rendering of Physically Based Clouds Using Precomputed Scattering Egor Yusov Introduction Light Transport Theory 28.3 28.4 28.5 28.6 28.7 29 29.1 29.2 29.3 29.4 29.5 29.6 30 30.1 30.2 30.3 30.4 30.5 31 31.1 31.2 31.3 31.4 31.5 32 32.1 Precomputed Solutions Volume-Aware Blending Implementation Results and Discussion Conclusion Bibliography Sparse Procedural Volume Rendering Doug McNabb Introduction Overview of Current Techniques Overview Metavoxels Algorithm Conclusion Bibliography Adaptive Virtual Textures Ka Chen Introduction Procedural Virtual Textures Basics Adaptive Virtual Textures Virtual Texture Best Practices Conclusion Bibliography Deferred Coarse Pixel Shading Rahul P. Sathe and Tomasz Janczak Overview Introduction and Background Algorithm Performance Conclusion Bibliography Progressive Rendering Using Multi-frame Sampling Daniel Limberger, Karsten Tausche, Johannes Linke and Jürgen Döllner Introduction 32.2 32.3 32.4 32.5 Approach Multi-frame Rendering Techniques Conclusion and Future Work Bibliography
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值