Topographical Engineering • UE5 Virtual Texturing

Map Extraction & Virtual Texture Pipeline

Standard image extraction tools fail on large-scale terrain maps because Unreal Engine 5 streams high-resolution terrain using Runtime Virtual Texturing (RVT). Rather than storing a monolithic texture, the engine partitions maps into thousands of compressed blocks stored inside .pak and streaming .ubulk packages.

1. Unreal Engine 5 Runtime Virtual Texturing (RVT) Architecture

To construct the topographical maps for Bakurani, Ozeti, and Zestafona, a custom reverse-engineering extraction pipeline was built. High-resolution terrain textures are not authored as individual flat images; they are stored in virtual texture page caches designed for streaming directly into GPU memory caches.

Streaming Texture Characteristics:
  • Package Format: Unreal Engine streaming .ubulk files.
  • Raw Streaming Tile Dimensions: 136 × 136 pixels.
  • Filtering Border Padding: 4-pixel border on all four edges for bilinear interpolation.
  • Net Payload per Tile: 128 × 128 active terrain pixels.
  • Full Master Canvas: 64 × 64 tile grid = 4,096 total tiles → 8,192 × 8,192 pixel master canvas.

2. Morton Z-Order Space-Filling Curve & DXT1/BC1 Decompression

Tiles inside the .ubulk stream are not ordered row-by-row. They are sequenced along a Morton Z-order space-filling curve to maximize spatial 2D GPU cache locality. The pipeline reconstructs coordinates via bit interleaving:

TileIndex→bit interleaving(xtile,ytile)\text{TileIndex} \xrightarrow{\text{bit interleaving}} (x_{\text{tile}}, y_{\text{tile}})
// Morton 2D Coordinate Decoder
function morton2D_decode(d) {
  let x = 0, y = 0;
  for (let b = 0; b < 16; b++) {
    x |= ((d >> (2 * b)) & 1) << b;
    y |= ((d >> (2 * b + 1)) & 1) << b;
  }
  return { x, y };
}

Each tile payload is compressed in DXT1 (BC1) format. The extraction engine decodes the 16-color 4x4 blocks, strips the 4-pixel border overlap, and stitches the decoded RGB buffers into a continuous master PNG image.

3. High-Performance Deep-Zoom Tile Pyramid Slicing

Serving an uncompressed 8192×8192 RGBA canvas (256 MB in raw memory) directly to mobile web browsers causes tab memory crashes. To enable instant, fluid map navigation, the reconstructed master canvas is sliced into a multi-resolution WebP quadtree:

Zoom LevelGrid SizeTile CountEquivalent Resolution
Zoom 01 × 11 tile256 × 256 px
Zoom 12 × 24 tiles512 × 512 px
Zoom 24 × 416 tiles1024 × 1024 px
Zoom 38 × 864 tiles2048 × 2048 px
Zoom 416 × 16256 tiles4096 × 4096 px
Zoom 532 × 321,024 tiles8192 × 8192 px (Native Full Resolution)

Tiles are formatted in lightweight WebP with 85% compression quality, achieving an average tile weight of approximately 18 KB. This enables sub-50ms panning and zooming response even under constrained 4G mobile conditions.

4. Elevation Heightmap Mesh & Sub-Pixel Bilinear Sampling

From the game's height virtual textures, single-channel 8-bit grayscale elevation matrices downsampled to 1024×1024 were extracted. Each pixel value V∈[0,255]V \in [0, 255] maps linearly to world vertical bounds:

Zworld=Zmin+(V255)×(Zmax−Zmin)Z_{\text{world}} = Z_{\text{min}} + \left(\frac{V}{255}\right) \times (Z_{\text{max}} - Z_{\text{min}})
ASLmeters=Zworld100+DatumOffset\text{ASL}_{\text{meters}} = \frac{Z_{\text{world}}}{100} + \text{DatumOffset}

During live map interaction, the artillery fire-control solver runs bilinear sub-pixel interpolation across the four surrounding texels, yielding elevation sampling accurate to within ±0.2 meters\pm 0.2\text{ meters} anywhere on the battlefield.

Interact with the Extracted Maps

Explore full-resolution maps with real-time elevation sampling

Pan, zoom, and calculate firing arcs across Bakurani, Ozeti, and Zestafona in the interactive artillery solver.