Table of Contents

Class BorderComputeDispatcher

Namespace
Map.Rendering
Assembly
MapAssembly.dll

Coordinator for border rendering systems Orchestrates multiple rendering modes: distance field, mesh geometry, and pixel-perfect

REFACTORED: Now uses specialized helper classes for single responsibility

  • BorderShaderManager: Compute shader loading and kernel management
  • BorderParameterBinder: Rendering parameters and shader binding
  • BorderStyleUpdater: Border style classification and updates
  • BorderDebugUtility: Debug utilities and benchmarking

Architecture: Facade pattern - provides unified interface to border rendering subsystems

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()

Detect and update borders (called per-frame or on-demand)

public void DetectBorders()

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 from registry.

public IBorderRenderer GetActiveBorderRenderer()

Returns

IBorderRenderer

Initialize()

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

public void Initialize()

InitializeSmoothBorders(AdjacencySystem, ProvinceSystem, CountrySystem, ProvinceMapping, Transform)

Initialize smooth curve-based border rendering system MUST be called after AdjacencySystem, ProvinceSystem, and CountrySystem are ready

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

Parameters

adjacencySystem AdjacencySystem
provinceSystem ProvinceSystem
countrySystem CountrySystem
provinceMapping ProvinceMapping
mapPlaneTransform Transform

SetActiveBorderRenderer(string, ProvinceQueries)

Set the active border renderer by ID. Used by VisualStyleManager to switch renderers.

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

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()