Table of Contents

Class HorizonFogUniforms

Namespace
LansMap.Map.Rendering
Assembly
LansMap.Runtime.dll

Shared _FogParams/_FogColor uniform shape for every screen-space overlay shader: tiles, polylines, bulk markers, marker labels, and polygon fills all sample it through the exact same TileQuad.shader-style ApplyHorizonFog term (saturate((viewDist - start) * invRange), lerp rgb toward the fog color). One packing implementation so a map with horizon fade on fogs every flat-view layer identically instead of each layer's renderer carrying its own copy of the (start, 1/range) math to drift out of sync.

public static class HorizonFogUniforms
Inheritance
object
HorizonFogUniforms

Remarks

World-space draws (a SurfaceMapView table's RenderWorld path on PolylineLayer/PolygonLayer, and MarkerLabelSdf.shader's LANSMAP_WORLD_GLYPH/LANSMAP_WORLD_PLATE variants) never call Bind(Material, Vector4, Color), so their materials keep Unity's default zero vector for both properties - the same "off unless a caller wires it" invariant SetFog(float, float, Color) already relies on for SurfaceMapView.

Fields

ColorPropertyId

public static readonly int ColorPropertyId

Field Value

int

ParamsPropertyId

public static readonly int ParamsPropertyId

Field Value

int

Methods

Bind(Material, Vector4, Color)

Binds packed fog uniforms onto one material's flat-view draw.

public static void Bind(Material material, Vector4 fogParams, Color fogColor)

Parameters

material Material

Material to bind onto.

fogParams Vector4

Value from PackParams(float, float).

fogColor Color

Color distant geometry fades toward.

PackParams(float, float)

Packs a horizon fade band into the shader's _FogParams shape: x = start view distance, y = 1 / (end - start), in the same units as clip w. A non-positive or non-finite range packs to UnityEngine.Vector4.zero, which switches the shader's fade term off (its saturate hits 0 for every finite viewDist when y = 0).

public static Vector4 PackParams(float startViewDistance, float endViewDistance)

Parameters

startViewDistance float

View distance where the fade begins, in multiples of the camera distance.

endViewDistance float

View distance where the fade is complete. At or below startViewDistance the fade packs off.

Returns

Vector4