FTerrainRetopo
- Module
- Game
- Header
#include "Terrain/TerrainRetopo.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
void | SamplePosition | Where texel (x,y) actually sits, in terrain-local meters. |
float | SampleDisplacedHeight | The height the DISPLACED sample renders at: the unchanged field, sampled at the displaced position. |
FTerrainTexelRegion | Relax | Relaxes the whole field toward uniform 3D spacing. |
FTerrainTexelRegion | RelaxStamp | 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. |
double | SpacingUniformity | Mean 3D distance between horizontally adjacent samples divided by its own standard deviation's complement — the uniformity probe the tests measure against. |
Function details
SamplePosition
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
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
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
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
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.