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):
- Base Color - Map mode (political/terrain/development)
- Lighting - Normal map lighting
- Borders - From IBorderRenderer
- Highlights - From IHighlightRenderer
- Fog of War - From IFogOfWarRenderer
- 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
mapMaterialMaterial
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
GetCustomShader()
Optional: Provide a custom shader for compositing. Return null to use the default map shader.
Shader GetCustomShader()
Returns
Initialize(CompositorContext)
Initialize the compositor with the map material. Called once when compositor is activated.
void Initialize(CompositorContext context)
Parameters
contextCompositorContext
OnPreRender()
Called before rendering each frame. Use for animated effects or dynamic adjustments.
void OnPreRender()