How Apple Maps Renders 3D Globe Terrain on iOS 15

Apple Maps on iOS 15 introduced a photorealistic, interactive 3D globe that replaced the traditional flat Mercator projection with a geocentric spherical model. This article explores the technical mechanics behind this feature, detailing how Apple utilizes the low-level Metal graphics framework, digital elevation models (DEM), dynamic level-of-detail (LOD) systems, and real-time atmospheric shaders to render continuous, accurate geographic terrain across various zoom levels.

Spherical Base Geometry and Coordinate Systems

Rather than distorting landmasses on a 2D planar map, the interactive globe models the Earth as an ellipsoid using an Earth-Centered, Earth-Fixed (ECEF) coordinate space. The foundational geometry begins as a tessellated sphere (often derived from a normalized cube or icosahedron) that subdivides dynamically.

To eliminate floating-point precision jitter when zooming from a global view down to street-level details, the rendering engine switches coordinate systems on the fly. Global viewing relies on spherical coordinates, while close-up camera angles transition to local tangent plane coordinates (East-North-Up), ensuring smooth vertex calculations and rock-solid camera stability.

Elevation Data and Vertex Displacement

The 3D topography visible in mountain ranges, trenches, and valleys is generated using Digital Elevation Models (DEM). Apple Maps streams compressed raster heightmaps alongside conventional map tile data:

  • GPU Vertex Displacement: Heightmap textures store elevation values as normalized scalar data. In the vertex stage of the rendering pipeline, vertex shaders sample these heightmaps and displace the sphere's mesh vertices along their normal vectors.
  • Normal Map Reconstruction: To create crisp shadows and natural lighting on rugged surfaces without requiring an excessively dense polygon mesh, the engine computes surface normals dynamically from the elevation gradients. This allows details like cliffs and peaks to cast realistic shadows under varying light angles.

Dynamic Level of Detail (LOD) and Chunking

Rendering the entire planet at high resolution simultaneously would overwhelm mobile hardware. The globe utilizes a spherical quadtree data structure to manage Level of Detail (LOD):

  1. Hierarchical Tile Streaming: The Earth is partitioned into hierarchical tiles. As the camera approaches a specific region, parent tiles subdivide into higher-resolution child tiles.
  2. Mesh Stitching: Neighboring tiles with mismatched LOD levels can create visible gaps or cracks. The rendering engine resolves this using skirts—downward vertical geometry around tile edges—or dynamic vertex stitching, preserving a seamless surface.
  3. Memory Management: Distant continents display low-polygon geometries and reduced-resolution textures, keeping the GPU memory footprint low and sustaining a consistent 60 or 120 frames per second (on ProMotion displays).

Real-Time Shading, Atmosphere, and Lighting

To achieve photorealism, the interactive globe employs multi-pass fragment shaders powered by Apple's Metal framework:

  • Atmospheric Scattering: A multi-layered raymarching or analytical scattering shader simulates how sunlight passes through Earth's atmosphere. This creates the characteristic blue haze around the globe's horizon that fades into deep space.
  • Day/Night Terminator: The engine calculates real-world solar positions relative to current coordinates and time zones, casting realistic daylight, dusk, and nighttime gradients across the terrain.
  • Water and Specular Mapping: Water bodies use specular maps and custom PBR (Physically Based Rendering) materials to reflect sunlight off oceans and lakes, contrasting the matte finish of dry land and dense vegetation.