High-quality rendering of 3D virtual environments typically depends on high-quality 3D models with significant geometric complexity and texture data. One major bottleneck for real-time image-synthesis represents the number of state changes, which a specific rendering API has to perform. To improve performance, batching can be used to group and sort geometric primitives into batches to reduce the number of required state changes, whereas the size of the batches determines the number of required draw-calls, and therefore, is critical for rendering performance. For example, in the case of texture atlases, which provide an approach for efficient texture management, the batch size is limited by the efficiency of the texture-packing algorithm and the texture resolution itself. This paper presents a pre-processing approach and rendering technique that overcomes these limitations by further grouping textures or texture atlases and thus enables the creation of larger geometry batches. It is based on texture arrays in combination with an additional indexing schema that is evaluated at run-time using shader programs. This type of texture management is especially suitable for real-time rendering of large-scale texture-rich 3D virtual environments, such as virtual city and landscape models.
3. Context: Rendering of Complex 3D Virtual Environments
Virtual 3D City Model of Boston: 5,680,317 Vertices + 864 Light Texture Maps
4. Context: Rendering of Complex 3D Virtual Environments
Colonia 3D: 1,768,374 Vertices + 204 Diffuse Texture Maps
5. What is Geometry Batching?
Forward Rendering:
GPU is SIMD processor: pipelined operations on primitive streams
High number of draw calls can stall pipeline and yield less efficiency [Wloka, 2003]
Geometry batching = Group rendering primitives to large primitive batches
N0
T0
N1
G0
T1
G1
N2
T2
G2
N3
T3
G3
N0
G0…G3
T0
T1 T2
T3
Original 3D Scene Batched 3D Scene
6. 3D Virtual Environments and Textures
Observations on 3D Virtual Environments:
Usually high geometric complexity
High amount of textures (e.g., facade texture or light maps)
Texture-Atlas Examples:
Light Map Texture Atlas Diffuse Texture Atlas Facade Texture Atlas
7. Causes of Batch-Size Limitations
Space vs. Quality Trade-off depends on:
Batch size b = number of primitives grouped within a geometry batch
Texture-atlas segmentation algorithm = how many primitive are covered by a texture atlas
Number of primitives limited by maximal texture resolution supported by hardware
Basic Idea of Texture-Array Batching:
1. Bin meshes and textures according to its type, resolution, and format
2. Combine binned texture to respective texture-arrays and store indirection mapping
3. Combine binned 3D meshes/batches to larger geometry batches
Single Textures Texture Atlas Texture Array
8. Batching using Texture-Arrays
Problem Statement:
1. Binning: How to pre-process 3D scene to create texture-array batches?
2. Storage: How to represent required data structures on GPU?
3. Rendering: How to resolve indirection during rending of texture-array batches?
Texture Atlases 2D Texture Array Final Rendering
12. GPU-based Data Structures
Texture-array representation (TAi):
OpenGL and Direct3D: 2D texture arrays
Texture-array mapping representation (TAEi):
Constant uniform arrays / uniform buffers exceeds limits
Texture buffer objects to encode texture array entries
Space complexity:
Alternatives for representation of index mapping (TAM):
1. Indices for each texture unit as additional per-vertex attribute
2. Modification of UV texture coordinates by adding a component
16. Conclusions
Limitations:
Same as texture atlases: wrapping of texture coordinates (e.g., repeat or mirror)
Future Work:
Combine approach with sparse textures (OpenGL: GL_ARB_sparse_texture)
Summary:
Pre-processing algorithm for textures and texture arrays
Counterbalance hardware limitations texture resolutions for batching
Easy to implement (rapid prototyping and static scenes)
17. Questions & Comments ?
Contact:
Matthias Trapp / matthias.trapp@hpi.de
Jürgen Döllner / juergen.doellner@hpi.de
Publications: www.4dndvis.de/publikationen.html
This work was funded by the Federal Ministry of Education and Research (BMBF),
Germany within the InnoProfile Transfer research group "4DnD-Vis".
18. Geometry Batching Using Texture-Arrays
Matthias Trapp, Jürgen Döllner
Hasso Plattner Institute, University of Potsdam, Germany