Table of Contents

Class GradientComputeDispatcher

Namespace
Map.MapModes
Assembly
MapAssembly.dll

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
object
GradientComputeDispatcher

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

provinceIDTexture RenderTexture

Input: Province ID texture (RG16 encoded)

outputTexture RenderTexture

Output: Colorized RGBA texture

provinceValues float[]

Province values (normalized 0-1)

gradient ColorGradient
oceanColor Color

Color for ocean provinces

Dispose()

Release compute buffers

public void Dispose()