GeoGen Script reference
marshlands.ggs
metadata
{
Height: Finite,
Width: Infinite,
Name: "Marshlands",
Description: "River flowing through a massive marshland with small lagoons and countless cutoffs.",
Author: "Matěj Zábský"
}
var bankShiftNoiseLayers = CreateNoiseLayers(512);
var topBankProfile = HeightProfile.FromArray({
@0.05: 1,
@0.15: -1
var topBank = HeightMap.Projection(topBankProfile, Direction.Horizontal)
.Shift(HeightProfile.Noise(bankShiftNoiseLayers, 1), @0.15, Direction.Vertical);
var bottomBankProfile = HeightProfile.FromArray({
@0.85: -1,
@0.95: 1
var bottomBank = HeightMap.Projection(bottomBankProfile, Direction.Horizontal)
.Shift(HeightProfile.Noise(bankShiftNoiseLayers, 2), @0.15, Direction.Vertical);
var banks = topBank
.Unify(bottomBank)
.Blur(100);
var profile = HeightProfile.FromArray({
@0.95: 0.001,
@0.515: 0,
@0.5: -0.6,
@0.485: 0,
@0.05: 0.001
var main =
.Shift(HeightProfile.Noise({350: 1}, 3), @0.1, Direction.Vertical)
.Blur(50);
var noise1 = HeightMap.Noise(CreateNoiseLayers(64), 4).Abs();
var noise2 = HeightMap.Noise(CreateNoiseLayers(64), 5).Abs();
var canalNoise = noise1
.Intersect(noise2)
.Multiply(0.25)
.Add(-0.015);
main.Add(canalNoise);
main.Add(HeightMap.Noise().Multiply(0.5).Add(0.25), banks);
yield main;