TerrainForge — Your Blender Terrain as a Real Unity Terrain: Heights, Holes and Layers in the Same Place, Measured in Millimetres

Skava in Import & Export


TerrainForge — documentation

Your Blender terrain mesh as a real Unity Terrain: heights, holes and material layers, standing where Unity puts the rest of your Blender scene, and measured against Blender's surface in millimetres.

Requirements

Blender 4.2 or newer. Unity 6 (Built-in, URP or HDRP: a Unity Terrain is the same in all of them). No Python packages, no cloud, no account, no AI model.

Install

  1. Keep the archive zipped. In Blender open Edit > Preferences > Add-ons.
  2. Press the arrow in the top right corner, choose Install from Disk, pick the archive, tick TerrainForge.
  3. Press N in the 3D Viewport: a TerrainForge tab appears in the sidebar.

In Blender

  1. Pick your terrain in Terrain (or leave it empty and highlight the terrain meshes in the viewport). The mesh is read as the viewport shows it, with its modifiers, in world space: moved, turned, scaled or made of several objects is fine.
  2. Set Budget (mm): how far Unity's terrain may lie from Blender's surface at any point. Resolution Auto picks the smallest Unity heightmap that keeps every proof point within the budget; or choose a size yourself.
  3. Press Scan. The panel shows the grid TerrainForge chose, the worst proof point Blender expects, Unity's height step, the layers, and what a heightmap cannot hold.
  4. Choose a folder (inside your Unity project's Assets is easiest) and press Export for Unity. It writes NAME.terrainforge.json (the passport), the heights (16-bit, one file per tile), the holes and layer masks, the layers' textures, NAME_markers.fbx (four markers one metre apart that tie Blender's space to Unity's) and the TerrainForge folder with the Unity script. Your scene is not changed.

Export your other models as usual with Blender's FBX exporter at its defaults: the terrain lands where they land.

In Unity

  1. Let Unity import the files. In the Project window click the .terrainforge.json (or its folder).
  2. Tools > TerrainForge > Set Up Terrain makes the terrain: one Unity Terrain per tile under "NAME (TerrainForge)", its TerrainData and TerrainLayer assets in the Terrain folder next to the passport. Run it again after a new export: it writes the new heights, holes and layer masks into the same assets, so your scene keeps its references and the trees and details you painted stay in the TerrainData. Layer painting you did in Unity is replaced by Blender's materials, and tiles the new export no longer has are removed. Set Up cannot be undone with Ctrl+Z for the terrain data: commit or copy your project first. Objects you put under a removed tile move to "NAME (TerrainForge)" in the same place. A tile placed in a scene that is not open loses its data when Set Up removes it: open those scenes first.
  3. Tools > TerrainForge > Check Terrain measures the terrain in your open scene and writes NAME.terrainforge-check.txt next to the passport: - every height of every tile against the one Blender exported (to Unity's own height step); - each tile's place and size against where the markers say your Blender models arrive; - Unity's surface against Blender's own surface at about 5000 proof points (random points and the mesh's sharpest vertices: peaks, ridges, cliff edges), against your budget; - the holes, and the layer Unity paints at each proof point against Blender's material there; - each layer's texture: the right image on every tile, and its place against Blender's UVs (the map the material draws with, and a Mapping node on it), in millimetres; UVs that are not a flat projection from above, UVs turned against the ground, and images placed by other coordinates fail here, since a terrain layer can only tile a texture straight along the ground; - that enough proof points (at least 100) lie on solid ground to judge at all, and no other tile of this export stands in the scene. Check is OK only when all of them pass.

How the terrain is carried

  • Unity stores a terrain's heights at the corners of its cells: N x N heights for N-1 x N-1 cells. TerrainForge takes Blender's height exactly at those points, from the triangles of your mesh. Baking a height image with a camera samples the middles of the pixels instead: half a cell off, which on our test terrain put cliffs up to half a metre off (see the card).
  • Unity keeps a terrain height as one of 32766 steps of the terrain's height range: the step is the range / 32766 (2.4 mm on a 77 m range, 31 mm on 1000 m), and a point can be up to half a step off. Scan and Check name the step.
  • Long terrains are cut into tiles of the same size, as close to square as whole tiles allow (250 x 100 m gives two tiles of 125 x 100 m), joined as neighbours. Each tile has its own copies of the layers, so textures run on across the seams.
  • Holes: where no face lies under a grid point, the Unity cells around it become holes. Unity cuts holes by whole cells, so a hole's edge follows the grid, not your mesh's edge.
  • Layers: each material on the top surface becomes a TerrainLayer (objects sharing a material share its layer), with the image that gives its Base Color its colour (followed through Mix and colour nodes, never through a Factor) and its normal map. Where a face shows that material, its layer is painted. A blend of two images, or a tint on the way, is named: the layer shows the image as it is. A material without an image gives a flat colour. The texture's size and offset come from the UV map the material draws with (its UV Map node, else the map marked for rendering) and a Mapping node (Point) on it: a flat projection from above is carried exactly, also when each face is unwrapped onto 0..1 of it (the layer repeats once per face). UVs in pieces that do not line up, UVs turned against the ground, Box projection, Clip extension, images placed by Generated, Object or other coordinates, and image files Unity does not import (WebP, movies, UDIM tiles) cannot be held by a terrain layer: Scan names them in the panel and Check fails on them.

Limits

  • A heightmap holds one height per point: overhangs, caves, arches and the underside of a thick terrain are named by Scan; model them as separate meshes.
  • One material per face becomes one layer; blends between textures inside a material (painted masks, noise) are not carried. Shader effects (tint, roughness, displacement) stay in Blender.
  • A Unity terrain cannot turn: Blender's ground plane must arrive flat (Blender's FBX defaults do this).
  • Up to 4097 x 4097 heights in total, over all tiles, and at most 64 tiles (a strip much longer than it is wide is better carried as a mesh).
  • Trees, grass and scattered objects on the terrain are not part of the terrain: carry them with your usual export (or with PrefabForge, which places them as prefabs).

Uninstall

In Blender: Edit > Preferences > Add-ons, TerrainForge, Remove. In Unity: delete the TerrainForge script folder and, if you no longer need them, the exported folders.

Licenses

The Blender add-on is GPL (LICENSE.txt). The Unity script (Editor/TerrainForgeSetup.cs) is MIT (LICENSE-TerrainForge-Unity.txt): you may ship it in your games, closed source or not. It contains no Blender source code.

$19.99

Have questions about this product?
Login to message

Details
Published about 4 hours ago
Blender Version 4.2 - 5.2
Extension Type N/A
License GPL