Orrery Terrain · OrreryTerrainCore module · function
Native::
EffectiveLayerWeights
ExperimentalThe 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("OrreryTerrainCore");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
| Name | Type | Default | Meaning |
|---|---|---|---|
Rules | const FScatter | — | The material's auto rules. |
Posts | const FScatter | — | The chunk. |
LocalXCm | float | — | Position relative to the chunk origin, cm. |
LocalYCm | float | — | — |
SlopeDeg | float | — | Surface slope at the point, degrees (the normal the material reads). |
WorldZCm | float | — | World Z of the surface, cm. |
OutWeights | float | — | kScatterLayers weights, summing to 1. |