public static class TerrainSculptThe sculpt kernels: what a stamp does to the ground under it.
Remarks
Every one of these reads the composite and writes a layer, and that pairing is [docs/plan/31 § D4]'s warning made structural. Eroding a mountain on a layer above the base has to read what the world is, so the flow is right, and write what this layer adds, so the base survives. Reading the layer instead gives erosion that erases everything below it; writing the composite instead gives an edit the next invalidation discards.
Pure functions over a terrain and a stamp. No document, no undo, no dirty tracking — the caller owns those, because it is the caller that knows whether this stamp is one of four hundred in a drag.
Fields and properties (1)
public const int NeighbourMarginHow far a smoothing or erosion kernel reads beyond what it writes.
Methods (10)
public static TerrainRect AffectedRect(in TerrainDescription description, in TerrainBrush brush, in BrushStamp stamp)Which samples a stamp of this brush can reach.
public static TerrainRect Sculpt(Terrain terrain, TerrainEditLayer layer, in TerrainBrush brush, in BrushStamp stamp, float metres, IBrushMask? mask = null)Raises or lowers the ground under a stamp.
public static TerrainRect Flatten(Terrain terrain, TerrainEditLayer layer, in TerrainBrush brush, in BrushStamp stamp, float target, IBrushMask? mask = null, FlattenDirection direction = Both)Pulls the ground under a stamp towards a height.
public static TerrainRect Smooth(Terrain terrain, TerrainEditLayer layer, in TerrainBrush brush, in BrushStamp stamp, IBrushMask? mask = null)Averages the ground under a stamp with its neighbours.
public static TerrainRect Noise(Terrain terrain, TerrainEditLayer layer, in TerrainBrush brush, in BrushStamp stamp, float amplitude, in TerrainNoise settings, IBrushMask? mask = null)Adds fractal noise to the ground under a stamp.
public static TerrainRect Erode(Terrain terrain, TerrainEditLayer layer, in TerrainBrush brush, in BrushStamp stamp, float talus, float rate, IBrushMask? mask = null)Slides material downhill wherever the slope exceeds the talus angle.
public static TerrainRect Hydro(Terrain terrain, TerrainEditLayer layer, in TerrainBrush brush, in BrushStamp stamp, float rate, IBrushMask? mask = null)Dissolves high ground and deposits it in the low ground beside it.
public static TerrainRect Ramp(Terrain terrain, TerrainEditLayer layer, Vector2 from, Vector2 to, float fromHeight, float toHeight, float halfWidth, float sideFalloff = 0.5)Raises or lowers a straight ramp between two points.
public static TerrainRect PaintHoles(Terrain terrain, in TerrainBrush brush, in BrushStamp stamp, bool hole, float threshold = 0.5)Punches or fills holes under a stamp.
public static TerrainRect Paint(Terrain terrain, int paintLayer, in TerrainBrush brush, in BrushStamp stamp, int amount, IBrushMask? mask = null)Paints a weight layer under a stamp.
Used by (13)
- TerrainHeightmapPngTestsVixen.Terrain.Tests
- TerrainHeightmapTestsVixen.Terrain.Tests
- TerrainLayerTestsVixen.Terrain.Tests
- TerrainPaintVixen.Terrain
- TerrainRendererTestsVixen.Rendering.Terrain.Tests
- TerrainSculptTestsVixen.Terrain.Tests
- TerrainStoreTestsVixen.Terrain.Tests
- TerrainStrokeVixen.Terrain
- TerrainStrokeTestsVixen.Terrain.Tests
- TerrainWeightStrokeVixen.Terrain
- TerrainWeightTestsVixen.Terrain.Tests
- TerrainEditVixen.Editor.Terrain
- TerrainHoleStrokeVixen.Editor.Terrain