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
-
objectShaderCompositorBase
- 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
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
mapMaterialMaterialconfigCompositorConfig
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
mapMaterialMaterial
DisableKeyword(Material, string)
Disable a shader keyword.
protected void DisableKeyword(Material material, string keyword)
Parameters
materialMaterialkeywordstring
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
materialMaterialkeywordstring
GetConfig()
Get the compositing configuration for this compositor. Used by shader to determine layer order and blend modes.
public abstract CompositorConfig GetConfig()
Returns
GetCustomShader()
Optional: Provide a custom shader for compositing. Return null to use the default map shader.
public virtual Shader GetCustomShader()
Returns
Initialize(CompositorContext)
Initialize the compositor with the map material. Called once when compositor is activated.
public void Initialize(CompositorContext ctx)
Parameters
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
SetMaterialFloat(Material, int, float)
Safely set material float property.
protected void SetMaterialFloat(Material material, int propertyId, float value)
Parameters
materialMaterialpropertyIdintvaluefloat
SetMaterialInt(Material, int, int)
Safely set material int property.
protected void SetMaterialInt(Material material, int propertyId, int value)
Parameters
materialMaterialpropertyIdintvalueint