Class MapTextureManager
Facade coordinator for all map textures Delegates to specialized texture set managers Provides unified API for external consumers
public class MapTextureManager : MonoBehaviour
- Inheritance
-
objectMapTextureManager
Properties
DetailIndexTexture
public RenderTexture DetailIndexTexture { get; }
Property Value
DetailMaskTexture
public RenderTexture DetailMaskTexture { get; }
Property Value
DistanceFieldBorderTexture
public RenderTexture DistanceFieldBorderTexture { get; }
Property Value
DistanceFieldTexture
[Obsolete("Use DistanceFieldBorderTexture instead")]
public RenderTexture DistanceFieldTexture { get; }
Property Value
DualBorderTexture
[Obsolete("Use PixelPerfectBorderTexture instead")]
public RenderTexture DualBorderTexture { get; }
Property Value
DynamicTextures
public DynamicTextureSet DynamicTextures { get; }
Property Value
FogOfWarTexture
public RenderTexture FogOfWarTexture { get; }
Property Value
HeightmapTexture
public Texture2D HeightmapTexture { get; }
Property Value
HighlightTexture
public RenderTexture HighlightTexture { get; }
Property Value
MapHeight
public int MapHeight { get; }
Property Value
- int
MapWidth
public int MapWidth { get; }
Property Value
- int
NormalMapTexture
public Texture2D NormalMapTexture { get; }
Property Value
PixelPerfectBorderTexture
public RenderTexture PixelPerfectBorderTexture { get; }
Property Value
ProvinceColorPalette
public Texture2D ProvinceColorPalette { get; }
Property Value
ProvinceColorTexture
public Texture2D ProvinceColorTexture { get; }
Property Value
ProvinceDevelopmentTexture
public RenderTexture ProvinceDevelopmentTexture { get; }
Property Value
ProvinceIDTexture
public RenderTexture ProvinceIDTexture { get; }
Property Value
ProvinceOwnerTexture
public RenderTexture ProvinceOwnerTexture { get; }
Property Value
ProvinceTerrainTexture
public Texture2D ProvinceTerrainTexture { get; }
Property Value
TerrainTypeTexture
public Texture2D TerrainTypeTexture { get; }
Property Value
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
materialMaterial
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
heightScalefloatlogProgressbool
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
xintyint
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
newWidthintnewHeightint
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
materialMaterialcountryBorderColorColorcountryBorderStrengthfloatprovinceBorderColorColorprovinceBorderStrengthfloat
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
paletteIndexbytecolorColor32
SetPaletteColors(Color32[])
Update all palette colors (delegate to palette manager)
public void SetPaletteColors(Color32[] colors)
Parameters
colorsColor32[]
SetProvinceColor(int, int, Color32)
Update province color at coordinates (delegate to core textures)
public void SetProvinceColor(int x, int y, Color32 color)
Parameters
xintyintcolorColor32
SetProvinceTerrainLookup(RenderTexture)
Set province terrain lookup texture (hybrid terrain system)
public void SetProvinceTerrainLookup(RenderTexture lookupTexture)
Parameters
lookupTextureRenderTexture
SetTerrainBlendMaps(RenderTexture, RenderTexture)
Set terrain blend map textures (Imperator Rome-style blending)
public void SetTerrainBlendMaps(RenderTexture indexTexture, RenderTexture maskTexture)
Parameters
indexTextureRenderTexturemaskTextureRenderTexture