FTerrainOffsetField
Per-texel XZ displacement of the render grid, in meters — UE5's landscape XY-offset map. The heightfield stays a regular grid; this says where each of its samples actually SITS in the world, which is the whole trick behind Retopologize: a cliff sampled on a regular XZ lattice spends almost all its triangles on the flat ground above and below it and almost none on the face, because uniform XZ spacing is non-uniform 3D spacing the moment the surface tilts. Sliding samples toward the steep parts spends the same triangle budget where the silhouette is.
- Module
- Game
- Header
#include "Terrain/TerrainRetopo.h"- Namespace
Mowo
Heights are never rewritten. A displaced sample's height is the field sampled AT the displaced position, so the surface is unchanged and only the tessellation moves along it — that is what makes the tool non-destructive and what the tests measure.
Public functions
| Returns | Name | Description |
|---|---|---|
void | Init | |
void | Clear | |
bool | IsValid | |
uint32_t | GetWidth | |
uint32_t | GetHeight | |
float | GetOffsetX | Zero for any out-of-range texel, so a caller never has to bounds-check before asking where a sample went. |
float | GetOffsetZ | |
void | SetOffset | |
float | MaxMagnitude | Largest |offset| in the field, in meters. |
const std::vector<float>& | Data | |
std::vector<float>& | Data |
Function details
Init
void Init(uint32_t width, uint32_t height)Clear
void Clear()IsValid
bool IsValid() constGetWidth
uint32_t GetWidth() constGetHeight
uint32_t GetHeight() constGetOffsetX
float GetOffsetX(uint32_t x, uint32_t y) constZero for any out-of-range texel, so a caller never has to bounds-check before asking where a sample went.
GetOffsetZ
float GetOffsetZ(uint32_t x, uint32_t y) constSetOffset
void SetOffset(uint32_t x, uint32_t y, float offsetX, float offsetZ)MaxMagnitude
float MaxMagnitude() constLargest |offset| in the field, in meters. Zero means the grid is still regular and nothing downstream has to consider offsets at all.
Data
const std::vector<float>& Data() constData
std::vector<float>& Data()