Class GradientComputeDispatcher
ENGINE LAYER - Manages GPU compute shader for gradient map mode colorization Processes province values into colored textures entirely on GPU for maximum performance
Performance: ~1ms for 11.5M pixels vs 105ms CPU-side processing Architecture: CPU simulation data → GPU colorization → Output texture (dual-layer)
public class GradientComputeDispatcher
- Inheritance
-
objectGradientComputeDispatcher
Constructors
GradientComputeDispatcher()
public GradientComputeDispatcher()
Properties
IsInitialized
public bool IsInitialized { get; }
Property Value
- bool
Methods
Dispatch(RenderTexture, RenderTexture, float[], ColorGradient, Color)
Dispatch gradient colorization on GPU
public void Dispatch(RenderTexture provinceIDTexture, RenderTexture outputTexture, float[] provinceValues, ColorGradient gradient, Color oceanColor)
Parameters
provinceIDTextureRenderTextureInput: Province ID texture (RG16 encoded)
outputTextureRenderTextureOutput: Colorized RGBA texture
provinceValuesfloat[]Province values (normalized 0-1)
gradientColorGradientoceanColorColorColor for ocean provinces
Dispose()
Release compute buffers
public void Dispose()