55
Deformable Terrain Generation for Real-Time Simulation With Atmospheric and Geomorphological Processes By Peter Sbarski (92570968) Supervisors: Jon McCormack & Alan Dorin

Deformable Terrain Generation for Real-Time Simulation With Atmospheric and Geomorphological Processes By Peter Sbarski (92570968) Supervisors: Jon McCormack

Embed Size (px)

Citation preview

Deformable Terrain Generation for Real-Time Simulation

With Atmospheric and Geomorphological Processes

By Peter Sbarski (92570968)Supervisors: Jon McCormack & Alan Dorin

Aims

To develop a fully interactive system for automatic generation and visualization of synthetic terrain.

To model natural meteorological events.To combine the above two elements to

create a “living”, “breathing” world.

Why…?

Flight SimulatorsHigh Quality Visualization of Weather

and Environment TopologiesWeather SimulationMassively Multiplayer Networked WorldsVirtual TourismGames

Codename: TerraSim

TerraSim developed for terrain generation, visualization and weather simulation.

Created in C++ with OpenGL and SDL (Simple DirectMedia Layer).

Save/Load OptionsMulti-Platform

TerraSim: Input Parameters

Algorithm to be used for terrain generation: Perlin Noise, Ridged Multifractal, Hybrid Multifractal, Heterogeneous Multifractal, Procedural Multifractal, Procedural fBm (fractal Brownian motion), Fluid Simulation, Terrain Fault Formation.

TerraSim: Input Parameters

Terrain Size:128x128,256x256,512x512,1024x1024,2048x2048,4096x4096.

TerraSim: Input Parameters

Preferable Terrain Type:Very Flat,Flat,Average,Mountainous,Very Mountainous,Random.

TerraSim: Input Parameters

Roughness of the Terrain:Smooth,Average,Rough,Random.

TerraSim: Input Parameters

Hemisphere:Southern,Northern.

TerraSim: Input Parameters

Latitude of the terrain:0-10,10-30,30-40,40-50,50-70.

TerraSim: Input Parameters

Current Season,Summer,Winter.

TerraSim: Input Parameters

Terrain Type:Forest,Desert/Steppe.

HeightMap

Terrain data is stored as a series of height values.

Usually called a heightmap.TerraSim saves the heightmap as a

targa image file.Possible to import it into other

applications upon generation.

Heighmap: example

Perlin Noise Algorithm

Perlin Noise

Takes a number of different smooth noise functions with different amplitudes and different frequencies and adds them together.

Multifractals

Usually used to modify the heightmap after it has been generated.

For example, hybrid and rigid multifractals make low areas (valleys) smooth and high (mountain peaks) areas rough.

Multifractal: Example

Default Heightmap Rigid Multifractal

Terrain Fault

Heightmap is divided into two parts. One part is displaced (up or down).

A smoothing function is applied because the end result is still usually a bit too rough.

Terrain Fault: Example

What does it look like (wireframe)?

What does it look like (wireframe)?

What does it look like (rendered)?

What does it look like (rendered)?

What does it look like (rendered)?

What does it look like (rendered)?

What does it look like (rendered)?

What does it look like (rendered with shadows)?

What does it look like (rendered with a sky)?

What does it look like (rendered with a sky)?

What does it look like (rendered with a sky)?

What does it look like (rendered with a sky)?

Level of Detail

It is hard for a processor and the GPU to display the whole terrain each and every frame.

It makes sense to display the chunk of the terrain closest to the user in full detail and the rest in less detail.

LOD Algorithm: ROAM

Uses two priority queues to drive split and merge operations that maintain continuous triangulations built from pre-processed bintree triangles

ROAM in more detail

To achieve the first level of tessellation the root triangle is split into two triangles.

To do this a line needs to be drawn from any of the triangle’s three vertex points to bisect the line opposite the vertex.

ROAM: Popping

Popping occurs when a triangle changes its level of detail.

Can be solved by intelligently figuring out when a LOD change is needed and where the camera is located.

Procedural Texturing

A terrain doesn’t all have the same colour. There are green spots (grass), brown spots

(dirt), grey spots (rocks), white spots (snow), etc….

It is possible to take a number of different textures and put them together to produce one master texture.

This texture can be used for the whole of the terrain.

Procedural Texturing: Example

Procedural Texturing: Example

Result

Other Effects

Moving SunDay/Night CyclesParticle Effects (rain, snow, etc…)Water

Why simulate weather effects?

Makes a game more interesting.Allows the terrain to be modified over

time without any user input.Can be used for weather predictions

(well, on a very small scale).

So, what does TerraSim do in regards to weather?

Simulates trade winds and slope winds,Temperature at ground level up to 8km

up,Evaporation and Condensation,Dew Point (at which vapor condenses

and turn into water particles),Moisture content located in various parts

of the world.

How does it work?

The world is separated into a number of regions (3D cubes).

Each region has its own:Temperature,Wind Vector,Moisture amount

The more regions the better however there are performance penalties

Regions

Winds

The overall strength and direction of wind is composed of trade wind and slope wind.

The wind orients according to specified latitude and hemisphere.

A Gaussian distribution is used to determine the exact direction of trade wind.

Winds, continued…

Slope winds are calculated in the regions where there is terrain.

The value of the slope wind is proportional to the distance between the highest point and the lowest point.

The overall wind is the sum of two vectors representing trade and slope winds.

Wind, continued…

Temperature

Temperature is allocated at the start of the simulation to each region.

The initial temperature depends on hemisphere, latitude, season and distance above ground.

Evaporation/Condensation

The soil has an initial amount of water which evaporates according to Hamon’s equation.

Vapor moves from region to region (going up) and possibly across depending on the wind.

At dew point (e.g. 0 degrees Celsius) the movement stops and the vapor condenses.

Evaporation/Condensation

When a critical amount of water has been reached in block it falls down back to earth as rain.

The system is semi-closed, i.e. there is an invisible ceiling but there aren’t any walls.

How it all affects the terrain

The water falling back on earth and winds can be used to model erosion,

Changing weather effects can bring on typhoons, hurricanes, tornadoes and other meteorological effects.

Summary

Terrain generation algorithms, CLOD algorithms, Procedural Textures, Various effects, Meteorology

Temperature Winds Hydrological Cycle

Some more images

Professional terrain modeling application: GeoScape 3D

Some more images

Some more images

Some more images