Intro

Abstract

Procedurally Generated Antartica using Perlin Noise to create complex heightmap terrain in Unity

Overview

description

Procedural Content Generation

Perlin Noise

Perlin Noise is a type of gradient noise that is useful for PCG.

In Unity, the Mathf.PerlinNoise function takes an x and y coordinate and returns a value between 0 and 1.

If you treat this value as terrain height (after multiplying by a scale factor), you get:

  • low values β†’ valleys
  • high values β†’ hills / mountains

Because the values change smoothly across space, the resulting terrain looks natural instead of random.


Building a PCG Graph

The PCG generator (PCG Terrain component) will be used to segment the terrain into distinct biomes according to boundaries generated by Perlin Noise.

PCG Configuration

PCG Configuration

  • X / Y / Z Offsets – Shifts the sampling position of the noise β†’ moves terrain without changing shape
  • Perlin Scale (zoom) – Controls feature size
  • low frequency β†’ large, smooth regions (biomes)
  • high frequency β†’ small, detailed features (rocks)
    Max Value – Limits amplitude β†’ higher = taller terrain, lower = flatter
    Noise Type – Algorithm used (Perlin, Simplex, etc.) β†’ affects pattern style
    Process Parent Variables – Inherits parent values β†’ enables layering (e.g., biome masks affecting children)

Tip

  • Offset = move the map
  • Scale = zoom in/out
  • Max Value = how tall
  • Noise Type = style of randomness
  • Process Parent = whether layers interact

Creating Biomes

  • See PCG Demo for how to create distinct biomes

Animating

  • You can add time-based offset variables to the Process() call in PCGTerrain.cs

Biome: Mountain

Create Biome

  • See PCG Demo for how to create distinct biomes
description

Texture

description
  • Increase the smoothness to make the snow look better

Lighting

Directional Lighting

  • Make the directional lighting slightly more blue
description description

Skybox

Create skybox material

  • In Project window, Right click β†’ Create β†’ Material β†’ Give it a name
description

Assign HDR file

  • Click the file, then drag in the .hdr file (from Source/cubemap/) into the Spherical (HDR) field

Apply it to scene

  • Go to Window β†’ Rendering β†’ Lighting β†’ Environment β†’ Drag the material file into the Skybox Material field
description description

Biome: Glacier

Texture

description

Biome: Ocean

Create OceanPlane

  • Select GameObject β†’ 3D Object β†’ Plane
  • Scale the plane (x: 200, z: 200)
  • Add water material
  • Add a 2nd blue plane below the OceanPlane to make the water more translucent
description
  • With a different Skybox
description

Initial Attempt

description

Final

description description

Add Player Input

Player Object

  • Create a Player object or import a Prefab
  • Disable FreeLookCameraRig since we will switch to first person POV

Update

  • Change color
  • Replace material with boat object

Install Input System

  • Click Window β†’ Package Manager β†’ Unity Registry β†’ Search Input System β†’ Install

  • PlayerScripts

    • Drag the files InputManager.cs, PlayerLook.cs, PlayerMotor.cs to the Player object
    • Drag the Player’s Main Camera into the cam variable of PlayerLook.cs
  • Input

    • PlayerInput.cs
    • PlayerInput.InputActions

Boat

description description