Table of Contents

Class DynamicTextureSet

Namespace
Map.Rendering
Assembly
MapAssembly.dll

Manages runtime-generated dynamic textures Border, Highlight, and Fog of War RenderTextures for effects Extracted from MapTextureManager for single responsibility

BORDER TEXTURE ARCHITECTURE (Clean Separation):

  • DistanceFieldBorderTexture: Used by ShaderDistanceField mode (smooth JFA borders)
  • PixelPerfectBorderTexture: Used by ShaderPixelPerfect mode (sharp 1px borders) Each mode has its own dedicated texture - no sharing/reusing between modes.
public class DynamicTextureSet
Inheritance
object
DynamicTextureSet

Constructors

DynamicTextureSet(int, int, bool)

public DynamicTextureSet(int width, int height, bool logCreation = true)

Parameters

width int
height int
logCreation bool

Properties

DistanceFieldBorderTexture

public RenderTexture DistanceFieldBorderTexture { get; }

Property Value

RenderTexture

DistanceFieldTexture

[Obsolete("Use DistanceFieldBorderTexture or PixelPerfectBorderTexture instead")]
public RenderTexture DistanceFieldTexture { get; }

Property Value

RenderTexture

DualBorderTexture

[Obsolete("Use PixelPerfectBorderTexture instead")]
public RenderTexture DualBorderTexture { get; }

Property Value

RenderTexture

FogOfWarTexture

public RenderTexture FogOfWarTexture { get; }

Property Value

RenderTexture

HighlightTexture

public RenderTexture HighlightTexture { get; }

Property Value

RenderTexture

PixelPerfectBorderTexture

public RenderTexture PixelPerfectBorderTexture { get; }

Property Value

RenderTexture

Methods

BindDistanceFieldTextures(Material)

Bind distance field border texture to material (Mode 1: ShaderDistanceField)

public void BindDistanceFieldTextures(Material material)

Parameters

material Material

BindPixelPerfectTextures(Material)

Bind pixel perfect border texture to material (Mode 2: ShaderPixelPerfect)

public void BindPixelPerfectTextures(Material material)

Parameters

material Material

BindToMaterial(Material)

Bind all dynamic textures to material Both border textures are always bound - shader selects which to use based on _BorderRenderingMode

public void BindToMaterial(Material material)

Parameters

material Material

CreateTextures()

Create all dynamic textures

public void CreateTextures()

Release()

Release all textures

public void Release()

SetBorderStyle(Material, Color, float, Color, float)

Set border visual style on material (colors and strengths)

public void SetBorderStyle(Material material, Color countryBorderColor, float countryBorderStrength, Color provinceBorderColor, float provinceBorderStrength)

Parameters

material Material
countryBorderColor Color
countryBorderStrength float
provinceBorderColor Color
provinceBorderStrength float

SetDistanceFieldBorderParams(Material, float, float, float, float, float, float, float, float)

Set AAA distance field border parameters on material Controls edge sharpness, gradient falloff, and color darkening

public void SetDistanceFieldBorderParams(Material material, float edgeWidth, float gradientWidth, float edgeSmoothness, float edgeColorMul, float gradientColorMul, float edgeAlpha, float gradientAlphaInside, float gradientAlphaOutside)

Parameters

material Material
edgeWidth float
gradientWidth float
edgeSmoothness float
edgeColorMul float
gradientColorMul float
edgeAlpha float
gradientAlphaInside float
gradientAlphaOutside float