Introduction

For my Advanced Topics in Computer Graphics class, I collaborated with Nayeong Kim to implement the paper Authoring landscapes by combining ecosystem and terrain erosion simulation (2017). This was implemented as a Maya plugin using the Maya C++ API. It allows users to simulate a large-scale terrain and ecosystem model over time. This simulation process takes into account various biological events such as rain, erosion, fire, and landslides, as well as ecological events such as vegetation growth and death. Our main goals were to design an art-directable simulator that provided user control while also replicating the many complex interactions between terrain and ecology.

Overview

Terrain is represented as a 2D grid, whose cells contain the heights of the terrain material layers (broken rock, sand, humus) and the vegetation layers (trees, shrubs, and dead vegetation). We can calculate total elevation at a cell by summing each of these height values. Layers also contain information about qualities such as soil moisture content and sun exposure. Vegetation layers are represented as the number of plants, the sum of plant heights, and the sum of plant ages. An example layered representation is shown below.

After initializing this grid, we then run the simulation. During each time step, we repeat the following process N times, where N is a large number given by the user. First, select a random cell from the grid based on a uniform probability distribution. Next, choose a random event (e.g. lightning strike, rainstorm, landslide, etc.) from those implemented, based on the user-defined event probabilities. Simulate this event, propagating it over the terrain, then update the terrain based on the results of this simulation.

Ecological Events

The backbone of this model are the various natural phenomena that are simulated over the terrain. These are small scale events that stochastically affect local areas of the terrain over time. This attempts to replicate the stochastic nature of actual real world phenomena like weather. I was responsible for implementing the following events:

Rainfall and Hydraulic Erosion

To simulate erosion, we first Initialize a certain amount of rainfall at a starting cell p0. This water is then propagated randomly to a neighboring cell with less elevation than p0, based on a probability function derived from the slope between the current cell and neighbor cell. The higher the slope from the neighbor to the current cell, the higher chance the water will propagate to that neighbor. This water may deposit a certain amount of sediment from one cell to the next, depending on factors such as slope, soil moisture, and vegetation. If the current cell’s moisture capacity is not exceeded, we then reduce the current water runoff by an amount inversely proportional to slope, and transfer it to local moisture in the cell. We continue this process with the next cell until the water has been absorbed by the terrain or we reach a local minimum elevation.

Gravity

Landslides are simulated by propagating terrain materials (rocks, sand, humus) in a similar fashion to hydraulic erosion. The falling pattern is a function of the local terrain slope, the friction coefficients of the different materials, the curvature of the terrain, and the amount of vegetation in a cell. Landslides will also kill vegetation.

Vegetation

Over each time step, plants may grow or die depending on a vigor value v. This is determined by the contribution of various local climatic conditions such as sunlight exposure, soil moisture, temperature, and the species of plant. We estimate plant density as an average of the encoded values for plant number n, plant height sum h, plant age sum a, ratio of plant radius to height r, over the cell width w, as follows. This density value is useful for simulating competition and self-thinning effects between neighboring plant cells. Dead vegetation also decomposes into the humus layer at a hardcoded rate of 30% per year.

1 year
10 years
3 years
50 years

User Control and Interface

We implemented a simple user interface in Maya that allows users to adjust various environmental parameters through the use of sliders in the attribute editor. Users can edit the initial state of the terrain through either a noise function or height map (implemented by Nayeong). They can also change the initial soil content of the terrain, which allows a wide variety of different ecosystems from fertile marshes to dry mountain ranges. They can then advance the simulation using the Maya timeline.

While most of the simulation is automatic and stochastic, we also allow users direct control of the simulation. I designed an event system that allows users to trigger changes in environmental parameters and natural phenomena, and retain these changes throughout the simulation. Events can be controlled by editing a wide number of environmental parameters through the timeline. Parameters include the amount of rain, the intensity of fires, or the temperature of the terrain. Changes in parameters are saved through the timeline and applied during the simulation. Simulation runtimes can be exported as a string or text file; users can also script their own simulations as an input file.

Rendering

I also handled texturing and rendering of the landscape. Each terrain layer is represented as a separate plane, whose vertices correspond to a cell positions in the layer. The landscape model is assigned UVs to a texture sheet that contains images for the different terrain materials. It is then attached to an Arnold shader network that interpolates textures in order to draw grass, using the color channels to represent plant density.

Results

This tool allows us to create a wide variety of terrain systems depending on different ecological conditions. 

Cold terrain prevents plant growth
Soil erodes to lower altitudes, resulting in more vegetation growth in valleys
Soil erodes from peaks, bedrock erodes into sand
Experiment with noisy terrain