Table of Contents

Class BorderMeshRenderer

Namespace
Map.Rendering
Assembly
MapAssembly.dll

Renders border meshes using Unity's Graphics.DrawMesh API Handles province and country borders as separate mesh objects Uses unlit vertex color material for simple flat-shaded borders

public class BorderMeshRenderer
Inheritance
object
BorderMeshRenderer

Constructors

BorderMeshRenderer(Transform)

public BorderMeshRenderer(Transform mapPlane = null)

Parameters

mapPlane Transform

Methods

Dispose()

Clean up resources

public void Dispose()

RenderBorders()

Render borders for current frame Called every frame by MapRenderingCoordinator

public void RenderBorders()

SetBorderTexture(Texture2D)

Set a custom border texture on the material

public void SetBorderTexture(Texture2D texture)

Parameters

texture Texture2D

SetHeightmapParams(Texture, float, float)

Set heightmap for terrain-following displacement. Must match the same heightmap and scale used by the terrain shader.

public void SetHeightmapParams(Texture heightmap, float heightScale, float heightOffset = 0.15)

Parameters

heightmap Texture
heightScale float
heightOffset float

SetMapWorldBounds(Vector3, Vector3)

Set the world-space map bounds so the shader can derive heightmap UVs.

public void SetMapWorldBounds(Vector3 worldMin, Vector3 worldSize)

Parameters

worldMin Vector3
worldSize Vector3

SetMeshes(List<Mesh>, List<Mesh>)

Set the meshes to render (may be multiple meshes due to 65k vertex limit)

public void SetMeshes(List<Mesh> provinceMeshes, List<Mesh> countryMeshes)

Parameters

provinceMeshes List<Mesh>
countryMeshes List<Mesh>

SetTessellationParams(Material)

Copy tessellation parameters from the terrain material so borders match terrain curvature.

public void SetTessellationParams(Material terrainMaterial)

Parameters

terrainMaterial Material