Skip to content
Orbdale

Orbdale Terrain · OrbdaleTerrainCore module · function

Native::

EffectiveLayerWeights

Experimental

The layer weights the material shows at one point (the material's MF_TerrainLayers formula, ported).

Declaration

void EffectiveLayerWeights(const FScatterLayerRules& Rules, const FScatterPosts& Posts, float LocalXCm, float LocalYCm,
                           float SlopeDeg, float WorldZCm, float OutWeights[kScatterLayers]);
Header
#include "Native/TerrainScatter.h"
Module
PublicDependencyModuleNames.Add("OrbdaleTerrainCore"); in your module’s Build.cs.
Stability
Experimental: supported, may change in a minor version, with a changelog line.
Thread
Tier 1: plain C++, no allocation, deterministic in canonical order (ascending candidate index), any thread. (the header’s rule)

Description

Painted weights are the bilinear of the four nearest posts' pairs (each layer at its weight / 255, the pairs read from the planes); layer 0's share W0 is then split by the auto rules, as the material does. The noise uses the full-detail octaves (the material's distance fade is 1 inside grass range). Float maths in the material's order for the auto rules (kScatterLayersFormulaHash names the source; the painted part follows the pairs, which the material reads). These are the weights before the material's four-slot merge, which drops the lightest of five or more layers and renormalises: grass follows the exact weights, the look the merged ones.

Parameters

NameTypeDefaultMeaning
Rulesconst FScatterLayerRules&—

The material's auto rules.

Postsconst FScatterPosts&—

The chunk.

LocalXCmfloat—

Position relative to the chunk origin, cm.

LocalYCmfloat——
SlopeDegfloat—

Surface slope at the point, degrees (the normal the material reads).

WorldZCmfloat—

World Z of the surface, cm.

OutWeightsfloat—

kScatterLayers weights, summing to 1.