Table of Contents

Class BorderComputeDispatcher

Namespace
Map.Rendering
Assembly
MapAssembly.dll

Coordinator for border rendering systems. Delegates to registry-based renderers (IBorderRenderer implementations).

Available renderers: None, DistanceField, PixelPerfect, MeshGeometry Rendering mode is set via VisualStyleConfiguration.

public class BorderComputeDispatcher : MonoBehaviour
Inheritance
object
BorderComputeDispatcher

Properties

CurrentBorderMode

public BorderMode CurrentBorderMode { get; }

Property Value

BorderMode

Methods

ClearBorders()

Clear all borders

public void ClearBorders()

DebugFillBordersWhite()

Fill borders with white for debugging

public void DebugFillBordersWhite()

DetectBorders()

Regenerate borders using the active renderer.

public void DetectBorders()

DetectBordersIndexed(ushort[], CommandBuffer)

Indexed border update: queues compute shader dispatch into a CommandBuffer for only pixels of changed provinces + neighbors. Non-blocking. Falls back to full DetectBorders if indexed support not available.

public void DetectBordersIndexed(ushort[] changedProvinces, CommandBuffer cmd)

Parameters

changedProvinces ushort[]
cmd CommandBuffer

ForceProvinceMode()

Force border mode to province for testing

[ContextMenu("Force Province Mode")]
public void ForceProvinceMode()

GenerateCurveDebugTexture()

Generate debug texture showing curve points

public Texture2D GenerateCurveDebugTexture()

Returns

Texture2D

GeneratePixelPerfectBorders()

Generate pixel-perfect borders using DetectDualBorders kernel Writes to PixelPerfectBorderTexture (R=country, G=province)

public void GeneratePixelPerfectBorders()

GetActiveBorderRenderer()

Get the currently active border renderer.

public IBorderRenderer GetActiveBorderRenderer()

Returns

IBorderRenderer

Initialize()

Initialize the border system. Called by ArchonEngine during controlled initialization.

public void Initialize()

InitializeBorders(BorderRenderingMode, AdjacencySystem, ProvinceSystem, CountrySystem, ProvinceMapping, Transform)

Initialize border rendering system with specific mode. Only creates the renderer needed for the selected mode. MUST be called after AdjacencySystem, ProvinceSystem, and CountrySystem are ready.

public void InitializeBorders(BorderRenderingMode mode, AdjacencySystem adjacencySystem, ProvinceSystem provinceSystem, CountrySystem countrySystem, ProvinceMapping provinceMapping, Transform mapPlaneTransform = null)

Parameters

mode BorderRenderingMode
adjacencySystem AdjacencySystem
provinceSystem ProvinceSystem
countrySystem CountrySystem
provinceMapping ProvinceMapping
mapPlaneTransform Transform

SetActiveBorderRenderer(string, ProvinceQueries)

Set the active border renderer by ID.

public void SetActiveBorderRenderer(string rendererId, ProvinceQueries provinceQueries = null)

Parameters

rendererId string
provinceQueries ProvinceQueries

SetBorderMode(BorderMode)

Set border mode

public void SetBorderMode(BorderMode mode)

Parameters

mode BorderMode

SetBorderRenderingMode(BorderRenderingMode)

Set border rendering mode and regenerate borders.

public void SetBorderRenderingMode(BorderRenderingMode mode)

Parameters

mode BorderRenderingMode

SetPixelIndex(uint[], uint[], uint[])

Set pixel index for indexed border updates. Called once at load time. Shares the same pixel index data as OwnerTextureDispatcher.

public void SetPixelIndex(uint[] pixelCoords, uint[] offsets, uint[] counts)

Parameters

pixelCoords uint[]
offsets uint[]
counts uint[]

SetPixelPerfectParameters(int, int, float)

Set pixel-perfect mode parameters (called from VisualStyleManager)

public void SetPixelPerfectParameters(int countryThickness, int provinceThickness, float antiAliasing)

Parameters

countryThickness int

Country border thickness in pixels (0 = 1px thin)

provinceThickness int

Province border thickness in pixels (0 = 1px thin)

antiAliasing float

Anti-aliasing gradient width (0 = sharp, 1-2 = smooth)

SetTextureManager(MapTextureManager)

Set the texture manager reference

public void SetTextureManager(MapTextureManager manager)

Parameters

manager MapTextureManager

ToggleBorderMode()

Toggle border mode for testing

[ContextMenu("Toggle Border Mode")]
public void ToggleBorderMode()

UpdateBorders()

Update borders when provinces change

public void UpdateBorders()