Class BorderRendererBase
ENGINE: Abstract base class for border renderers with common functionality. Handles both GPU compute and CPU-based implementations. Extend this class to create custom border renderers.
public abstract class BorderRendererBase : IBorderRenderer
- Inheritance
-
objectBorderRendererBase
- Implements
- Derived
Fields
THREAD_GROUP_SIZE
protected const int THREAD_GROUP_SIZE = 8
Field Value
- int
context
protected BorderRendererContext context
Field Value
isInitialized
protected bool isInitialized
Field Value
- bool
textureManager
protected MapTextureManager textureManager
Field Value
Properties
DisplayName
Display name for UI/debugging
public abstract string DisplayName { get; }
Property Value
- string
RendererId
Unique identifier for this renderer (e.g., "DistanceField", "PixelPerfect", "MyCustom")
public abstract string RendererId { get; }
Property Value
- string
RequiresPerFrameUpdate
Whether this renderer requires per-frame updates (e.g., MeshGeometry needs OnRenderFrame)
public virtual bool RequiresPerFrameUpdate { get; }
Property Value
- bool
Methods
ApplyCommonStyleParams(Material, BorderStyleParams)
Utility: Apply common border style parameters to material.
protected void ApplyCommonStyleParams(Material material, BorderStyleParams styleParams)
Parameters
materialMaterialstyleParamsBorderStyleParams
ApplyToMaterial(Material, BorderStyleParams)
Apply visual parameters to the material (colors, widths, etc.) Called when visual style parameters change.
public abstract void ApplyToMaterial(Material material, BorderStyleParams styleParams)
Parameters
materialMaterialstyleParamsBorderStyleParams
CalculateThreadGroups(int, int)
Utility: Calculate thread groups for compute shader dispatch.
protected (int x, int y) CalculateThreadGroups(int width, int height)
Parameters
widthintheightint
Returns
- (int x, int y)
Dispose()
Cleanup resources when renderer is deactivated or destroyed.
public abstract void Dispose()
GenerateBorders(BorderGenerationParams)
Generate/update borders. Called when borders are dirty or ownership changes.
public abstract void GenerateBorders(BorderGenerationParams parameters)
Parameters
parametersBorderGenerationParams
GetShaderModeValue(string)
Utility: Get shader mode integer value for material.
protected int GetShaderModeValue(string rendererId)
Parameters
rendererIdstring
Returns
- int
Initialize(MapTextureManager, BorderRendererContext)
Initialize the renderer with required resources. Called once when renderer is first activated.
public virtual void Initialize(MapTextureManager texManager, BorderRendererContext ctx)
Parameters
texManagerMapTextureManagerctxBorderRendererContext
OnInitialize()
Override for custom initialization logic. Called after textureManager and context are set.
protected abstract void OnInitialize()
OnRenderFrame()
Called per-frame for renderers that need continuous updates. Only called if RequiresPerFrameUpdate is true.
public virtual void OnRenderFrame()