Table of Contents

Class TerrainSnowHoleFade

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

How much of its deep-snow lift each heightmap vertex of a terrain tile keeps near a hole in the terrain: none at a hole's edge, all of it FadeMetres away, eased between. One byte a vertex in an R8 map the array terrain shader loads at the vertex (FishTerrainSnowHoles.hlsl), handed to each tile by TerrainArrayBinder.

public static class TerrainSnowHoleFade
Inheritance
TerrainSnowHoleFade
Inherited Members

Remarks

Why. A hole is cut where rock is the ground (a cave's mouth, a canyon wall), and that rock meets the hole's edge flush. The terrain's vertices rise under deep snow and the rock does not, so lifted to the snow's full depth the terrain's edge stood that far over the rock with nothing under it. The rock stays where it is; the snow comes down onto it over the last metres.

Why a map. Scanning the holes from the vertex (2026-10-19) reached three cells and was read only at the vertices drawn: a far patch's vertices stand several cells apart, so its fade collapsed into a flat square plate that moved with the level of detail. Here every vertex's own value is the exact distance to the nearest hole quad, its own tile's or a neighbour's, so a vertex shared by two patches or two tiles is lifted alike whichever draws it.

Fields

FadeMetres

How far from a hole's edge the snow is back to its full depth, metres.

public const float FadeMetres = 8

Field Value

float

Properties

Blank

A 1×1 map of full lift: what a tile with no hole near it is given.

public static Texture2D Blank { get; }

Property Value

Texture2D

Methods

Build(IReadOnlyList<Terrain>)

Each tile's map, for the tiles that have a hole within FadeMetres (their own or a neighbour's); the others are not in it and take Blank.

public static Dictionary<Terrain, Texture2D> Build(IReadOnlyList<Terrain> tiles)

Parameters

tiles IReadOnlyList<Terrain>

Returns

Dictionary<Terrain, Texture2D>

Fade(float)

The share of the lift kept metres from the nearest hole: 0 at its edge, 1 from FadeMetres.

public static float Fade(float metres)

Parameters

metres float

Returns

float

Release(Dictionary<Terrain, Texture2D>)

Frees maps made by Build(IReadOnlyList<Terrain>).

public static void Release(Dictionary<Terrain, Texture2D> maps)

Parameters

maps Dictionary<Terrain, Texture2D>