Skip to main content

Terrain Generation

Use the Frontier model to generate large-scale Unity Terrain from AI-generated grayscale heightmaps, and automatically apply it to the current scene. Output a Unity Terrain GameObject + TerrainData asset + processed heightmap PNG, saved to Assets/TJGenerators/History/.

When to use terrain instead of 3D models: Valleys, mountain ranges, hills, plains, plateaus, islands, volcanoes, sand dunes, coastal cliffs and other large-scale landscapes use this feature; independent objects (rocks, trees, buildings) please use 3D Model Generation.

Getting Started

Start from GUI

Refer to the beginning section of Generate 3D Models (trigger by describing terrain through dialogue).

Start from CLI

Use generate_terrain to generate heightmaps, then use apply_terrain_heightmap to apply as Terrain. After generation is complete, the Terrain GameObject automatically appears in the scene.

Input Modes (provide at least one):

ModeParametersDescription
Text-to-TerrainpromptTerrain description
Image-Guided Terrainimage_pathReference image guides terrain shape

Models

Frontier (Only Model)

  • Only supported terrain model, no generator_id parameter; aspect ratio fixed to 1:1 (square heightmap), not configurable
  • generate_terrain Key Parameters:
    • prompt: Terrain description (optional when image_path is provided)
    • image_path: Reference image path (Assets/...), guides terrain shape
    • resolution: "1K" / "2K" (default) / "4K"

Post-Processing Options (apply_terrain_heightmap)

use_default_options: true (default) will apply recommended post-processing (median filter + bilateral filter + thermal erosion + percentile normalization). Set to false to manually adjust parameters, common items:

ParameterDefaultDescription
height_gamma1.0< 1.0 more mountainous; > 1.0 flatter
remap_output_min0.02Raising can elevate "sea level"/base height
remap_output_max0.98Lowering can flatten peak heights
thermal_erosiontrueSimulate natural erosion
thermal_erosion_iterations25More iterations = smoother
bilateral_filtertrueEdge-preserving smoothing (preferred over Gaussian)
terrain_go_name"TJGenerators Terrain"Generated GameObject name

Optimization

Prompt Optimization

Terrain TypeRecommended Prompts
Mountain Range"rugged mountain range with steep peaks and deep valleys, gradual foothills"
Hills"gently rolling grassy plains with subtle elevation changes"
Island"tropical island with central mountain peak, flat coastal area"
Canyon"deep canyon with layered rock formations, narrow river valley at bottom"
Volcano"dormant volcano with central caldera, smooth sloped sides"
Sand Dunes"sand dunes with smooth flowing curves, gradual ridges, no sharp edges"

Tips:

  • Avoid describing vegetation, buildings, trees—they will produce unexpected height protrusions
  • Add "smooth", "gradual", "gentle" for more natural transitions
  • You can add "top-down orthographic view" to hint the model to output a heightmap style
  • Providing image_path can significantly improve terrain shape precision

Post-Processing Selection

  • General scenes: use_default_options=true
  • More dramatic mountains: height_gamma=0.8; flatter: height_gamma=1.2
  • Preserve sharp ridges: bilateral_filter=false + thermal_erosion=false

Parallel Generation

  • Maximum 5 concurrent generation tasks

Notes

  • ⚠️ Two-step process: generate_terrainapply_terrain_heightmap, automatically completed by default
  • ⚠️ Post-processing time: 2K post-processing requires 60–180 seconds, do not resubmit repeatedly
  • ⚠️ Aspect ratio fixed to 1:1, no generator_id parameter
  • ⚠️ Output path: Default Assets/TJGenerators/History/; after generation, Terrain will be automatically selected, and will automatically add a directional light if none exists
  • ⚠️ Domain Reload: Do not write .cs files to disk during generation, use execute_csharp_script instead