Table of Contents

Class MapTextureManager

Namespace
Map.Rendering
Assembly
MapAssembly.dll

Facade coordinator for all map textures Delegates to specialized texture set managers Provides unified API for external consumers

public class MapTextureManager : MonoBehaviour
Inheritance
object
MapTextureManager

Properties

DetailIndexTexture

public RenderTexture DetailIndexTexture { get; }

Property Value

RenderTexture

DetailMaskTexture

public RenderTexture DetailMaskTexture { get; }

Property Value

RenderTexture

DistanceFieldBorderTexture

public RenderTexture DistanceFieldBorderTexture { get; }

Property Value

RenderTexture

DistanceFieldTexture

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

Property Value

RenderTexture

DualBorderTexture

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

Property Value

RenderTexture

DynamicTextures

public DynamicTextureSet DynamicTextures { get; }

Property Value

DynamicTextureSet

FogOfWarTexture

public RenderTexture FogOfWarTexture { get; }

Property Value

RenderTexture

HeightmapTexture

public Texture2D HeightmapTexture { get; }

Property Value

Texture2D

HighlightTexture

public RenderTexture HighlightTexture { get; }

Property Value

RenderTexture

MapHeight

public int MapHeight { get; }

Property Value

int

MapWidth

public int MapWidth { get; }

Property Value

int

NormalMapTexture

public Texture2D NormalMapTexture { get; }

Property Value

Texture2D

PixelPerfectBorderTexture

public RenderTexture PixelPerfectBorderTexture { get; }

Property Value

RenderTexture

ProvinceColorPalette

public Texture2D ProvinceColorPalette { get; }

Property Value

Texture2D

ProvinceColorTexture

public Texture2D ProvinceColorTexture { get; }

Property Value

Texture2D

ProvinceDevelopmentTexture

public RenderTexture ProvinceDevelopmentTexture { get; }

Property Value

RenderTexture

ProvinceIDTexture

public RenderTexture ProvinceIDTexture { get; }

Property Value

RenderTexture

ProvinceOwnerTexture

public RenderTexture ProvinceOwnerTexture { get; }

Property Value

RenderTexture

ProvinceTerrainTexture

public Texture2D ProvinceTerrainTexture { get; }

Property Value

Texture2D

TerrainTypeTexture

public Texture2D TerrainTypeTexture { get; }

Property Value

Texture2D

Methods

ApplyPaletteChanges()

Apply only palette changes (more efficient)

public void ApplyPaletteChanges()

ApplyTextureChanges()

Apply all texture changes after batch updates

public void ApplyTextureChanges()

BindTexturesToMaterial(Material)

Bind all textures to material

public void BindTexturesToMaterial(Material material)

Parameters

material Material

GenerateNormalMapFromHeightmap(float, bool)

Generate normal map from heightmap using GPU compute shader Must be called AFTER heightmap is loaded

public void GenerateNormalMapFromHeightmap(float heightScale = 10, bool logProgress = false)

Parameters

heightScale float
logProgress bool

GenerateTerrainTypeTexture()

Generate terrain type texture from terrain color texture Must be called AFTER terrain.bmp is loaded

public void GenerateTerrainTypeTexture()

GetProvinceID(int, int)

Get province ID at specific coordinates using GPU readback NOTE: Slow (GPU→CPU readback) - use sparingly for mouse picking only Y coordinate is in OpenGL convention (0 = bottom), RenderTexture uses GPU convention (0 = top)

public ushort GetProvinceID(int x, int y)

Parameters

x int
y int

Returns

ushort

Initialize()

Initialize texture manager. Called by ArchonEngine after GameSettings is registered.

public void Initialize()

ResizeTextures(int, int)

Update map dimensions and recreate textures

public void ResizeTextures(int newWidth, int newHeight)

Parameters

newWidth int
newHeight int

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

Set border visual style (delegate to dynamic textures)

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

Parameters

material Material
countryBorderColor Color
countryBorderStrength float
provinceBorderColor Color
provinceBorderStrength float

SetPaletteColor(byte, Color32)

NOTE: SetProvinceDevelopment removed - ProvinceDevelopmentTexture is now a RenderTexture updated by GPU compute shaders. Use GradientMapMode for gradient-based colorization.

public void SetPaletteColor(byte paletteIndex, Color32 color)

Parameters

paletteIndex byte
color Color32

SetPaletteColors(Color32[])

Update all palette colors (delegate to palette manager)

public void SetPaletteColors(Color32[] colors)

Parameters

colors Color32[]

SetProvinceColor(int, int, Color32)

Update province color at coordinates (delegate to core textures)

public void SetProvinceColor(int x, int y, Color32 color)

Parameters

x int
y int
color Color32

SetProvinceTerrainLookup(RenderTexture)

Set province terrain lookup texture (hybrid terrain system)

public void SetProvinceTerrainLookup(RenderTexture lookupTexture)

Parameters

lookupTexture RenderTexture

SetTerrainBlendMaps(RenderTexture, RenderTexture)

Set terrain blend map textures (Imperator Rome-style blending)

public void SetTerrainBlendMaps(RenderTexture indexTexture, RenderTexture maskTexture)

Parameters

indexTexture RenderTexture
maskTexture RenderTexture