Class PixelPerfectBorderRenderer
ENGINE: Pixel-perfect border renderer implementation. Uses compute shader for crisp, aliased 1-pixel border detection.
Best for retro/pixel art aesthetics where sharp borders are desired. Supports configurable thickness and optional anti-aliasing.
public class PixelPerfectBorderRenderer : BorderRendererBase, IBorderRenderer
- Inheritance
-
objectPixelPerfectBorderRenderer
- Implements
- Inherited Members
Constructors
PixelPerfectBorderRenderer(ComputeShader)
public PixelPerfectBorderRenderer(ComputeShader computeShader = null)
Parameters
computeShaderComputeShader
Properties
DisplayName
Display name for UI/debugging
public override string DisplayName { get; }
Property Value
- string
RendererId
Unique identifier for this renderer (e.g., "DistanceField", "PixelPerfect", "MyCustom")
public override string RendererId { get; }
Property Value
- string
RequiresPerFrameUpdate
Whether this renderer requires per-frame updates (e.g., MeshGeometry needs OnRenderFrame)
public override bool RequiresPerFrameUpdate { get; }
Property Value
- bool
Methods
ApplyToMaterial(Material, BorderStyleParams)
Apply visual parameters to the material (colors, widths, etc.) Called when visual style parameters change.
public override void ApplyToMaterial(Material material, BorderStyleParams styleParams)
Parameters
materialMaterialstyleParamsBorderStyleParams
Dispose()
Cleanup resources when renderer is deactivated or destroyed.
public override void Dispose()
GenerateBorders(BorderGenerationParams)
Generate/update borders. Called when borders are dirty or ownership changes.
public override void GenerateBorders(BorderGenerationParams parameters)
Parameters
parametersBorderGenerationParams
OnInitialize()
Override for custom initialization logic. Called after textureManager and context are set.
protected override void OnInitialize()
SetParameters(int, int, float)
Set pixel-perfect rendering parameters.
public void SetParameters(int countryThickness, int provinceThickness, float aa)
Parameters
countryThicknessintCountry border thickness in pixels
provinceThicknessintProvince border thickness in pixels
aafloatAnti-aliasing gradient width (0 = sharp)