class

FTerrainRetopo

Module
Game
Header
#include "Terrain/TerrainRetopo.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
voidSamplePositionWhere texel (x,y) actually sits, in terrain-local meters.
floatSampleDisplacedHeightThe height the DISPLACED sample renders at: the unchanged field, sampled at the displaced position.
FTerrainTexelRegionRelaxRelaxes the whole field toward uniform 3D spacing.
FTerrainTexelRegionRelaxStampBrush form: the same relaxation weighted by the dab's radial falloff, so an artist retopologizes the one cliff they are looking at instead of the whole landscape.
doubleSpacingUniformityMean 3D distance between horizontally adjacent samples divided by its own standard deviation's complement — the uniformity probe the tests measure against.

Function details

SamplePosition

C++
static void SamplePosition(const FTerrainOffsetField& offsets, uint32_t x, uint32_t y, uint32_t width, uint32_t height, float worldSize, float& outX, float& outZ)

Where texel (x,y) actually sits, in terrain-local meters.

SampleDisplacedHeight

C++
static float SampleDisplacedHeight(const FEditableHeightfield& field, const FTerrainOffsetField& offsets, uint32_t x, uint32_t y, float worldSize)

The height the DISPLACED sample renders at: the unchanged field, sampled at the displaced position. This is the function the "heights are preserved" test measures — the surface must be the same surface.

Relax

C++
static FTerrainTexelRegion Relax(const FEditableHeightfield& field, FTerrainOffsetField& offsets, const FTerrainRetopoParams& params)

Relaxes the whole field toward uniform 3D spacing. Returns the touched window (the whole grid) so the caller uploads once.

RelaxStamp

C++
static FTerrainTexelRegion RelaxStamp(const FEditableHeightfield& field, FTerrainOffsetField& offsets, const FTerrainBrushStamp& stamp, const FTerrainRetopoParams& params)

Brush form: the same relaxation weighted by the dab's radial falloff, so an artist retopologizes the one cliff they are looking at instead of the whole landscape. Returns the touched texel window.

SpacingUniformity

C++
static double SpacingUniformity(const FEditableHeightfield& field, const FTerrainOffsetField& offsets, float worldSize)

Mean 3D distance between horizontally adjacent samples divided by its own standard deviation's complement — the uniformity probe the tests measure against. Higher is more uniform; a retopologize pass that works raises it.

Generated from Terrain/TerrainRetopo.h via game.json · Nov 5, 2026Version 1.0.0