Class DynamicTextureSet
Manages runtime-generated dynamic textures Border, Highlight, and Fog of War RenderTextures for effects Extracted from MapTextureManager for single responsibility
BORDER TEXTURE ARCHITECTURE (Clean Separation):
- DistanceFieldBorderTexture: Used by ShaderDistanceField mode (smooth JFA borders)
- PixelPerfectBorderTexture: Used by ShaderPixelPerfect mode (sharp 1px borders) Each mode has its own dedicated texture - no sharing/reusing between modes.
public class DynamicTextureSet
- Inheritance
-
objectDynamicTextureSet
Constructors
DynamicTextureSet(int, int, bool)
public DynamicTextureSet(int width, int height, bool logCreation = true)
Parameters
widthintheightintlogCreationbool
Properties
DistanceFieldBorderTexture
public RenderTexture DistanceFieldBorderTexture { get; }
Property Value
DistanceFieldTexture
[Obsolete("Use DistanceFieldBorderTexture or PixelPerfectBorderTexture instead")]
public RenderTexture DistanceFieldTexture { get; }
Property Value
DualBorderTexture
[Obsolete("Use PixelPerfectBorderTexture instead")]
public RenderTexture DualBorderTexture { get; }
Property Value
FogOfWarTexture
public RenderTexture FogOfWarTexture { get; }
Property Value
HighlightTexture
public RenderTexture HighlightTexture { get; }
Property Value
PixelPerfectBorderTexture
public RenderTexture PixelPerfectBorderTexture { get; }
Property Value
Methods
BindDistanceFieldTextures(Material)
Bind distance field border texture to material (Mode 1: ShaderDistanceField)
public void BindDistanceFieldTextures(Material material)
Parameters
materialMaterial
BindPixelPerfectTextures(Material)
Bind pixel perfect border texture to material (Mode 2: ShaderPixelPerfect)
public void BindPixelPerfectTextures(Material material)
Parameters
materialMaterial
BindToMaterial(Material)
Bind all dynamic textures to material Both border textures are always bound - shader selects which to use based on _BorderRenderingMode
public void BindToMaterial(Material material)
Parameters
materialMaterial
CreateTextures()
Create all dynamic textures
public void CreateTextures()
Release()
Release all textures
public void Release()
SetBorderStyle(Material, Color, float, Color, float)
Set border visual style on material (colors and strengths)
public void SetBorderStyle(Material material, Color countryBorderColor, float countryBorderStrength, Color provinceBorderColor, float provinceBorderStrength)
Parameters
materialMaterialcountryBorderColorColorcountryBorderStrengthfloatprovinceBorderColorColorprovinceBorderStrengthfloat
SetDistanceFieldBorderParams(Material, float, float, float, float, float, float, float, float)
Set AAA distance field border parameters on material Controls edge sharpness, gradient falloff, and color darkening
public void SetDistanceFieldBorderParams(Material material, float edgeWidth, float gradientWidth, float edgeSmoothness, float edgeColorMul, float gradientColorMul, float edgeAlpha, float gradientAlphaInside, float gradientAlphaOutside)
Parameters
materialMaterialedgeWidthfloatgradientWidthfloatedgeSmoothnessfloatedgeColorMulfloatgradientColorMulfloatedgeAlphafloatgradientAlphaInsidefloatgradientAlphaOutsidefloat