Table of Contents

Class VisualTextureSet

Namespace
Map.Rendering
Assembly
MapAssembly.dll

Manages visual enhancement textures Terrain, Heightmap, and Normal Map textures for visual fidelity Extracted from MapTextureManager for single responsibility

public class VisualTextureSet
Inheritance
object
VisualTextureSet

Constructors

VisualTextureSet(int, int, int, int, bool)

public VisualTextureSet(int width, int height, int normalWidth, int normalHeight, bool logCreation = true)

Parameters

width int
height int
normalWidth int
normalHeight int
logCreation bool

Properties

DetailIndexTexture

public RenderTexture DetailIndexTexture { get; }

Property Value

RenderTexture

DetailMaskTexture

public RenderTexture DetailMaskTexture { get; }

Property Value

RenderTexture

HeightmapTexture

public Texture2D HeightmapTexture { get; }

Property Value

Texture2D

NormalMapTexture

public Texture2D NormalMapTexture { get; }

Property Value

Texture2D

ProvinceTerrainTexture

public Texture2D ProvinceTerrainTexture { get; }

Property Value

Texture2D

TerrainDetailArray

public Texture2DArray TerrainDetailArray { get; }

Property Value

Texture2DArray

TerrainTypeTexture

public Texture2D TerrainTypeTexture { get; }

Property Value

Texture2D

Methods

ApplyChanges()

Apply texture changes (call after batch updates)

public void ApplyChanges()

BindToMaterial(Material)

Bind visual textures to material

public void BindToMaterial(Material material)

Parameters

material Material

CreateTextures()

Create all visual textures

public void CreateTextures()

GenerateNormalMapFromHeightmap(float, bool)

Generate normal map from heightmap using GPU compute shader Should be called after heightmap is populated

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 into provinceTerrainTexture

public void GenerateTerrainTypeTexture()

Release()

Release all textures

public void Release()

SetProvinceTerrainLookup(RenderTexture)

Set province terrain lookup texture (created by ProvinceTerrainAnalyzer)

public void SetProvinceTerrainLookup(RenderTexture lookupTexture)

Parameters

lookupTexture RenderTexture

SetTerrainBlendMaps(RenderTexture, RenderTexture)

Set terrain blend map textures (created by TerrainBlendMapGenerator) Imperator Rome-style 4-channel material blending system

public void SetTerrainBlendMaps(RenderTexture indexTexture, RenderTexture maskTexture)

Parameters

indexTexture RenderTexture
maskTexture RenderTexture