Table of Contents

Interface IShaderCompositor

Namespace
Map.Rendering.Compositing
Assembly
MapAssembly.dll

ENGINE: Interface for pluggable shader compositing strategies.

Pattern 20: Pluggable Implementation Pattern

  • ENGINE provides interface + default implementation
  • GAME registers custom implementations via MapRendererRegistry
  • Controls HOW render layers are combined in the final output

Compositing Layers (each from pluggable IRenderer):

  1. Base Color - Map mode (political/terrain/development)
  2. Lighting - Normal map lighting
  3. Borders - From IBorderRenderer
  4. Highlights - From IHighlightRenderer
  5. Fog of War - From IFogOfWarRenderer
  6. Overlay - Paper/parchment effects

Default: Standard layer-by-layer compositing with lerp blending Custom examples: Stylized (multiply borders), Minimal (skip fog), Cinematic (custom post)

public interface IShaderCompositor

Properties

CompositorId

Unique identifier for this compositor (e.g., "Default", "Stylized", "Minimal")

string CompositorId { get; }

Property Value

string

DisplayName

Human-readable name for UI/debugging

string DisplayName { get; }

Property Value

string

Methods

ConfigureMaterial(Material)

Configure the material for this compositing strategy. Sets shader keywords, blend modes, layer visibility, etc. Called when compositor is activated or settings change.

void ConfigureMaterial(Material mapMaterial)

Parameters

mapMaterial Material

Dispose()

Release resources.

void Dispose()

GetConfig()

Get the compositing configuration for this compositor. Used by shader to determine layer order and blend modes.

CompositorConfig GetConfig()

Returns

CompositorConfig

GetCustomShader()

Optional: Provide a custom shader for compositing. Return null to use the default map shader.

Shader GetCustomShader()

Returns

Shader

Initialize(CompositorContext)

Initialize the compositor with the map material. Called once when compositor is activated.

void Initialize(CompositorContext context)

Parameters

context CompositorContext

OnPreRender()

Called before rendering each frame. Use for animated effects or dynamic adjustments.

void OnPreRender()