Table of Contents

Namespace Map.Loading

Classes

DetailTextureArrayLoader

Loads terrain detail textures into Texture2DArray for GPU splatting Scans Assets/Data/textures/terrain_detail/ for {index}_{name}.png files

Architecture:

  • File naming: {index}_{name}.png (e.g., "0_grasslands.png", "3_desert.png")
  • Index range: 0-255 (matches TerrainColorMapper terrain type indices)
  • Format: RGBA32 sRGB with mipmaps for performance
  • Missing indices: Filled with neutral gray (128,128,128,255) for multiply blend

Moddability:

  • Drop PNG files in folder to add/replace detail textures
  • File names must match terrain type indices from TerrainColorMapper
  • Supports hot-reload (rebuild array when files change)
MapDataLoader

Handles loading of province map data from files or simulation systems. Plain C# class - dependencies passed via constructor/Initialize.

NoiseTextureGenerator

Generates tileable noise textures for anti-tiling effects Used by terrain detail mapping to break up texture repetition

Architecture:

  • Output: Tileable noise texture (R8_UNorm grayscale)
  • Method: Simple value noise with tiling support
  • Purpose: Input for Inigo Quilez anti-tiling technique
ProvinceMapLoader

Compatibility layer for legacy Map.Loading namespace Bridges old ProvinceMapLoader API to new ProvinceMapProcessor system

ProvinceMapProcessor

Wraps ProvinceMapParser to provide async loading interface for Map layer Bridges between ParadoxParser.Bitmap and Map layer expectations Supports both BMP and PNG image formats via auto-detection

TerrainTypeTextureGenerator

Generates terrain type texture (R8) from terrain color texture (RGBA32) Maps terrain colors back to terrain type indices using TerrainColorMapper Purpose: Enables terrain splatting for detail texture selection

Architecture:

  • Input: ProvinceTerrainTexture (RGBA32) with terrain colors
  • Output: TerrainTypeTexture (R8) with terrain type indices (0-255)
  • Method: Reverse color lookup via TerrainColorMapper

Structs

ProvinceMapLoader.LoadResult

Legacy LoadResult structure - now bridges to new system

ProvinceMapLoader.ProvincePixel

Legacy ProvincePixel structure

ProvinceMapProcessor.BMPData

Image data wrapper (supports both BMP and PNG) Named BMPData for backward compatibility

ProvinceMapProcessor.BMPPixelDataWrapper

Wrapper for pixel data access (supports both BMP and PNG)

ProvinceMapProcessor.ProcessingProgress

Processing progress event data

ProvinceMapProcessor.ProvinceDefinition
ProvinceMapProcessor.ProvinceDefinitions

Province definitions from CSV

ProvinceMapProcessor.ProvinceMapResult

Province map processing result for Map layer

ProvinceMapProcessor.ProvinceMappings

Province color-to-ID mappings

Interfaces

IMapDataProvider

Interface for providing map data to the presentation layer Abstracts data source (files vs simulation) for clean separation of concerns