Martijn Wobbes

A technically driven developer passionate about creating performant, scalable, and maintainable systems.

Martijn Wobbes

A technically driven developer passionate about creating performant, scalable, and maintainable systems.

04/05/2022-04/05/2023

6min read

CUDA Plate Tectonics Simulator

Procedural terrain generation focuses on creating terrain using computer algorithms and simulation systems. While widely used, many techniques lack geological realism and do not account for the natural processes that shaped Earth's surface.

This project is a CUDA-based, fully GPU-accelerated standalone application that simulates the geological processes behind plate tectonics. It models the movement of tectonic plates as rigid bodies and supports realistic interactions such as subduction, convergence, divergence, plate splitting and merging, as well as mantle-driven motion. These processes deform a planet-scale heightmap in real time, forming large-scale geographic features such as mountain ranges, trenches, oceans, and continents.

How It Works

The simulation operates on a 2D pixel grid, where each pixel represents a 1 km² area with an associated height value. This grid forms the planetary surface, which is continuously deformed by tectonic activity.

The process begins by partitioning the surface into randomly seeded and clustered regions, each of which becomes a tectonic plate. Each plate is assigned motion parameters such as a directional velocity and angular rotation, determining how it moves across the surface.

Plates are treated as rigid bodies. On each simulation step, their velocity and rotation are applied, resulting in translation across the surface. When plates come into contact, collisions are resolved as inelastic interactions, influencing plate velocities and energy transfer.

Once collisions are detected, boundary interactions are classified. The system distinguishes between convergent, divergent, and subduction boundaries. Each interaction type produces a distinct geological effect on the heightmap:


  • Convergent Boundaries: Plates collide, causing compression and uplift, forming mountain ranges.

  • Divergent Boundaries: Plates separate, thinning the crust and forming rifts or mid-ocean ridges.

  • Subduction Zones: One plate moves beneath another, lowering elevation to form trenches while uplifting the overriding plate.

A hydraulic and thermal erosion step is applied to simulate geological smoothing and reduce artifacts over time. Cleanup processes are also executed, such as a connected component labeling step to detect plates that may have naturally split or fractured, reassigning them as independent plates.

The final step of each iteration applies mantle-driven motion, updates plate velocities, and recalculates the heightfield based on the accumulated deformation and erosion from previous stages.

Architecture

The application is structured into three main components: the Core Architecture, the CUDA Simulation Kernels, and the Rendering System. These systems work together to enable real-time, GPU-accelerated tectonic simulation and visualization.

The core architecture provides the framework for managing simulation state, configuration, and communication between systems. It handles textures, settings, initialization logic, and orchestrates execution flow across CPU and GPU. This layer abstracts away low-level details—both for code running on the host and on the device—to keep the simulation pipeline and renderer modular, maintainable, and extendable.

The core computational layer is running entirely within CUDA on the GPU. Dedicated kernels handle plate movement, collision detection, boundary classification, terrain deformation, erosion, and plate splitting/merging. Simulation data remains in GPU memory throughout execution to avoid CPU synchronization bottlenecks, enabling real-time performance even at high resolutions.

The rendering system is responsible for visualizing the simulation output using OpenGL. CUDA-OpenGL interoperability allows the heightmap and debug layers to be written directly into GPU textures, eliminating costly data transfers. Multiple render modes support development and debugging, including heightmap visualization, plate ID overlay, boundary type display, and velocity fields. The rendering system also includes a GUI via ImGui to monitor simulation statistics and adjust settings at runtime.

Results & Takeaways

The simulator achieves interactive, real-time plate interactions that behave coherently with natural geological processes. It produces visually plausible mountain ranges at convergent boundaries, trenches at subduction zones, and rift formations at divergent boundaries. All computations run entirely on the GPU, significantly improving simulation speed. The architecture scales well with both plate count and texture resolution, and the integrated renderer and GUI make experimentation and iteration fast and intuitive.


  • Scientific Plausibility: Modeling convergent, divergent, transform, and subduction interactions results in terrain features that align with expected large-scale geology.

  • Performance & Scalability: A fully GPU-resident pipeline enables real-time iteration at practical resolutions and scales through tunable tile sizes and kernel launch configurations.

  • Worldgen Foundation: The generated heightmaps provide a strong foundation for procedural terrain generation, serving as a high-quality base layer for world-building workflows.

Overall, this project strengthened my ability to design modular, scalable systems and maintain an easily extensible codebase. I gained deep experience leveraging the GPU for highly parallel workloads and applying parallel algorithms to build a smooth and efficient simulation pipeline.

See More

Github - Insert link here when project is published

LET'S GET IN
TOUCH