Investigating the Viability of Erosion via Rainfall

Investigating the Viability of Erosion via Rainfall

Introduction

Abstract

Erosion is a natural process that shapes the Earth's surface. It is caused by the movement of water, wind, and ice. Rainfall is one of the most common causes of erosion. As realism in video games becomes increasingly important, simulating the aging of terrain can enhance the immersion of virtual worlds. This thesis investigates the viability of simulating erosion via rainfall in real-time using DirectX 11.

Flowchart: Rainfall Particles → Terrain Impact → Sediment Pickup → Transport → Deposition → Modified Terrain

Figure 1: Overview of the erosion simulation process flow

Why I chose this topic

Inspiration and Motivation

My inspiration came from reading an Nvidia white paper on GPU rainfall simulation. Fascinated by the realistic and immersive environments in video games, I decided to explore the topic of erosion and investigate the possibility of simulating it in real-time using DirectX.

I chose DirectX 11 over OpenGL or Vulkan due to my lack of experience with the latter two. DirectX 11 is more widely used in the industry, with support for Xbox in addition to Windows, and it often receives the latest features before OpenGL. While Vulkan is more low-level and requires more boilerplate code, DirectX 11 offers a higher-level API that is easier to use, allowing me to focus on the erosion simulation rather than the performance of the renderer.

I decided against using a pre-built engine to ensure the code remained modular and independent. This approach allows for seamless integration of the simulation into any platform of choice. DirectX 11 offered the perfect balance between leveraging a low-level API and avoiding the constraints of middleware.

Background

Graphics programming was always a topic I was interested in and having recently (at the time) completed a module on physics simulation, I wanted to delve deeper into the topic. I found that there was a gap in the field of real-time erosion simulation using DirectX 11. There were no editor tools or plugins that could simulate erosion in real-time with customizable parameters. This led me to choose this topic for my bachelor's thesis.

Theoretical and Technical Introduction

Erosion is the long-term process of wearing away material from the Earth's surface. It is caused by the movement of water, wind, and ice. Rainfall is one of the most common causes of erosion. Rainfall particles hit the terrain and transport fragments of the terrain, referred to as sediment, to another location creating an uneven surface. This process is repeated over time which creates the weathered look of the terrain.

Mathematical Formula: Sediment Transport and Deposition Equations


C = Kc|v|sin(α) and Δh = -Ks(C-c)Δt

Figure 3: Mathematical model for erosion simulation

Scientific model of rainfall erosion used in the project - The project uses a simplified version of the scientific model of rainfall erosion. The model is based on the principles of sediment transport, deposition, and gravity. The model is not 100% accurate but it is a good approximation of the real-world process and was made with scalability in mind to account for large terrains.

struct Particle 
{
    // todo: fill this in
};

Technical Section

Artifact Proposal

I proposed to build a windows-only standalone application with a user interface that exposed parameters for the erosion simulation.

The technologies used to build the artefact were:

  • C++ - for the core logic of the application
  • DirectX 11 - for rendering the terrain and particles
  • HLSL - for writing shaders for the GPU
  • ImGui - for creating the user interface

Class Diagram: Showing relationships between ParticleSystem, TerrainManager, and ErosionSimulator components

Figure 2: System architecture and component relationships

Results and Findings

The simulation proved to be viable, producing realistic results where the erosion was visibly apparent, and the terrain aged over time. The customizable parameters allowed users to adjust rainfall intensity, sediment capacity, deposition rate, and the speed of time, providing a flexible and interactive experience.

Through this project, I learned a great deal about DirectX 11, HLSL, ImGui, particle systems, terrain generation, and erosion simulation. These technologies and techniques were crucial in achieving the desired outcomes and enhancing my understanding of graphics programming.

If I had more time, I would have added more features and optimized the code further. Potential improvements include adding more parameters, implementing GPU-based simulation for better performance, and enabling real-time mesh deformation instead of relying on heightmap textures. These enhancements would have made the simulation even more robust and realistic.

Comments