Table of Contents

Class ShaderCompositorBase

Namespace
Map.Rendering.Compositing
Assembly
MapAssembly.dll

ENGINE: Abstract base class for shader compositors. Provides common utilities for configuring material properties.

Subclasses implement:

  • CompositorId, DisplayName - identification
  • GetConfig() - return compositing configuration
  • ConfigureCompositor() - custom material setup
public abstract class ShaderCompositorBase : IShaderCompositor
Inheritance
object
ShaderCompositorBase
Implements
Derived

Fields

BorderBlendModeId

protected static readonly int BorderBlendModeId

Field Value

int

EnableBaseColorId

protected static readonly int EnableBaseColorId

Field Value

int

EnableBordersId

protected static readonly int EnableBordersId

Field Value

int

EnableFogOfWarId

protected static readonly int EnableFogOfWarId

Field Value

int

EnableHighlightsId

protected static readonly int EnableHighlightsId

Field Value

int

EnableLightingId

protected static readonly int EnableLightingId

Field Value

int

EnableOverlayId

protected static readonly int EnableOverlayId

Field Value

int

FogBlendModeId

protected static readonly int FogBlendModeId

Field Value

int

HighlightBlendModeId

protected static readonly int HighlightBlendModeId

Field Value

int

OverlayBlendModeId

protected static readonly int OverlayBlendModeId

Field Value

int

context

protected CompositorContext context

Field Value

CompositorContext

isInitialized

protected bool isInitialized

Field Value

bool

Properties

CompositorId

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

public abstract string CompositorId { get; }

Property Value

string

DisplayName

Human-readable name for UI/debugging

public abstract string DisplayName { get; }

Property Value

string

Methods

ConfigureCompositor(Material, CompositorConfig)

Subclass material configuration hook.

protected virtual void ConfigureCompositor(Material mapMaterial, CompositorConfig config)

Parameters

mapMaterial Material
config CompositorConfig

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.

public void ConfigureMaterial(Material mapMaterial)

Parameters

mapMaterial Material

DisableKeyword(Material, string)

Disable a shader keyword.

protected void DisableKeyword(Material material, string keyword)

Parameters

material Material
keyword string

Dispose()

Release resources.

public void Dispose()

DisposeCompositor()

Subclass disposal hook.

protected virtual void DisposeCompositor()

EnableKeyword(Material, string)

Enable a shader keyword.

protected void EnableKeyword(Material material, string keyword)

Parameters

material Material
keyword string

GetConfig()

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

public abstract CompositorConfig GetConfig()

Returns

CompositorConfig

GetCustomShader()

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

public virtual Shader GetCustomShader()

Returns

Shader

Initialize(CompositorContext)

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

public void Initialize(CompositorContext ctx)

Parameters

ctx CompositorContext

InitializeCompositor()

Subclass initialization hook.

protected virtual void InitializeCompositor()

OnPreRender()

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

public virtual void OnPreRender()

SetMaterialColor(Material, int, Color)

Safely set material color property.

protected void SetMaterialColor(Material material, int propertyId, Color value)

Parameters

material Material
propertyId int
value Color

SetMaterialFloat(Material, int, float)

Safely set material float property.

protected void SetMaterialFloat(Material material, int propertyId, float value)

Parameters

material Material
propertyId int
value float

SetMaterialInt(Material, int, int)

Safely set material int property.

protected void SetMaterialInt(Material material, int propertyId, int value)

Parameters

material Material
propertyId int
value int