Class VisualTextureSet
Manages visual enhancement textures Terrain, Heightmap, and Normal Map textures for visual fidelity Extracted from MapTextureManager for single responsibility
public class VisualTextureSet
- Inheritance
-
objectVisualTextureSet
Constructors
VisualTextureSet(int, int, int, int, bool)
public VisualTextureSet(int width, int height, int normalWidth, int normalHeight, bool logCreation = true)
Parameters
widthintheightintnormalWidthintnormalHeightintlogCreationbool
Properties
DetailIndexTexture
public RenderTexture DetailIndexTexture { get; }
Property Value
DetailMaskTexture
public RenderTexture DetailMaskTexture { get; }
Property Value
HeightmapTexture
public Texture2D HeightmapTexture { get; }
Property Value
NormalMapTexture
public Texture2D NormalMapTexture { get; }
Property Value
ProvinceTerrainTexture
public Texture2D ProvinceTerrainTexture { get; }
Property Value
TerrainDetailArray
public Texture2DArray TerrainDetailArray { get; }
Property Value
TerrainTypeTexture
public Texture2D TerrainTypeTexture { get; }
Property Value
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
materialMaterial
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
heightScalefloatlogProgressbool
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
lookupTextureRenderTexture
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
indexTextureRenderTexturemaskTextureRenderTexture