Class BorderMeshRenderer
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
-
objectBorderMeshRenderer
Constructors
BorderMeshRenderer(Transform)
public BorderMeshRenderer(Transform mapPlane = null)
Parameters
mapPlaneTransform
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
textureTexture2D
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
heightmapTextureheightScalefloatheightOffsetfloat
SetMapWorldBounds(Vector3, Vector3)
Set the world-space map bounds so the shader can derive heightmap UVs.
public void SetMapWorldBounds(Vector3 worldMin, Vector3 worldSize)
Parameters
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
SetTessellationParams(Material)
Copy tessellation parameters from the terrain material so borders match terrain curvature.
public void SetTessellationParams(Material terrainMaterial)
Parameters
terrainMaterialMaterial