TerrainToolkit.WindErosion

Method


function WindErosion(iterations : int, direction : float, force : float, lift : float, gravity : float, capacity : float, entropy : float, smoothing : float) : void

Description

Performs wind erosion on the terrain object over a number of iterations.

The direction and strength of the wind are defined by the direction and force values.

Each iteration an amount of material proportional to lift and the velocity at that point is removed by wind up to a maximum of capacity. Velocity is added at each point inversely proportional to the impedance of the terrain at that point realtive to the wind direction. Velocity is transferred into neighbouring cells in the direction of the wind flow, carrying any suspended material with it.

At the end of each iteration, an amount of suspended material proportional to gravity is dropped due to the effects of gravity. Also, an amount of velocity defined by entropy is removed from the system.

Additionally, in each iteration areas facing the wind direction are smoothed due to the effects of wind erosion and particulate abrasion by an amount proportional to smoothing.

Returns

Nothing.

Example

var go : GameObject = GameObject.Find("Terrain");
go.GetComponent("TerrainToolkit").WindErosion(25, 60, 0.5, 0.01, 0.5, 0.05, 0.0, 0.75);

Texturing

Terrain Toolkit