Back to API Reference
Class
EffectModifier
abstract
Base class for modifiers that render an additional effect pass behind the face (outline, shadow, glow).
Remarks
Lifecycle per frame: onGlyph — subclass
OnGlyphEffect calls EnqueueEffectQuad to record a per-glyph request into its own instance buffer. The current value of currentEffectPass is captured into the request, deciding whether the duplicate eventually lands before or after the face. No mesh is written yet. onMainPassFinalize — each EffectModifier applies its queued requests in registration order, appending duplicate quads to the mesh generator's vertex buffer and queueing their triangle indices into the generator's shared pre- or post-face buffer (QueueEffectTriangle) according to the captured pass. After onMainPassFinalize — the generator flushes both shared buffers in one shot: pre-face tris are prepended, post-face tris are inserted at postFaceInsertPoint, producing the final order [pre-face 1..N, face, post-face 1..N, line]. Grouping per modifier (not per glyph) is what gives a consistent painter order when multiple effects overlap across glyph boundaries — outline of glyph N+1 never covers shadow of glyph N, because all outline tris precede all shadow tris.protected void EnqueueEffectQuad(int sourceBaseIdx, Vector4 effectUv, float offsetX, float offsetY, float expandDelta)Queues an effect duplicate for the current glyph. The actual quad append happens later in onMainPassFinalize, grouped per modifier so that all duplicates of this effect are contiguous in the final index buffer. The current value of currentEffectPass is captured into the request and determines whether the duplicate eventually lands before or after the face.
