EffectModifier
Base class for modifiers that append duplicate glyph geometry behind or in front of the face (outline, shadow, extrude, glow, custom effects).
Remarks
LayerSequence) and calls OnEmitQuad so the subclass can fill colour, UV2, offsets. Multi-layer effects override OnFlush to flush per-layer buffers. Painter order is the single layer axis: every quad — face and duplicates — records its LayerSequence, and the generator sorts the index buffer by it, so stacking follows the order layers appear in Styles. The base class deliberately knows nothing about colour, dilate, softness, offsets, gradients, or any effect-specific parameter. Those live entirely inside the subclass. Common write patterns (solid colour + UV2, per-vertex gradient, offset, expand) are exposed via the static CoverageQuadOps helpers so subclasses share the implementation without sharing the data layout.Derived Types(3)
Types that inherit from EffectModifier.
public ColorGlyphPolicy ColorGlyphs{ get; set }Whether the effect decorates colour glyphs — emoji and inline sprites — through their silhouette; Inherit uses the effect's own default (DefaultColorGlyphPolicy). The final parameter slot of every effect, so any parameter added later must follow it.
protected ColorGlyphPolicy DefaultColorGlyphPolicy{ get }The colour-glyph policy an unresolved ColorGlyphPolicy.Inherit chain resolves to: skip, unless the effect reads naturally on a silhouette (a shadow, a glow).
Called once per glyph during mesh generation. The subclass decides whether the current glyph (UniTextMeshGenerator.currentCluster) needs an effect quad and invokes EnqueueDuplicate if so. A colour glyph (font.IsColor) may be decorated only when UniTextMeshGenerator.HasColorFaceField holds and the range's colour-glyph policy is ColorGlyphPolicy.Apply; its duplicates then sample the silhouette field instead of the bitmap.
protected LayerBlend ResolveBlend(ref ParameterReader reader, in RangeApplyContext context, LayerBlend inherited = LayerBlend.Normal)Resolves this effect's range blend override against its inherited mode.
protected LayerBlend ResolveBlend(in RangeApplyContext context, LayerBlend inherited = LayerBlend.Normal)Resolves this effect's range blend override against its inherited mode by the parameter's own slot — for effects that read no other parameter through a reader.
protected PaintSpread ResolveSpread(ref ParameterReader reader, in RangeApplyContext context, PaintSpread inherited = PaintSpread.Clamp)Resolves this effect's range spread override against its inherited value. Reads the slot before the colour-glyph policy, so call it after every other paint parameter the effect reads.
protected ColorGlyphPolicy ResolveColorGlyphs(ref ParameterReader reader, in RangeApplyContext context)Resolves the range's colour-glyph policy — Inherit falls through to DefaultColorGlyphPolicy. Reads the final parameter slot, so call it last.
protected ColorGlyphPolicy ResolveColorGlyphs(in RangeApplyContext context)Resolves the range's colour-glyph policy by the parameter's own slot — for effects that read no other parameter through a reader.
Asks the atlas pipeline for the silhouette fields of the colour glyphs in [start, end) (codepoint indices), reserving at least reachEm of rim beyond the glyph edge. Call from BaseModifier.OnApply for every range whose policy is ColorGlyphPolicy.Apply; the fields exist by the time the mesh is built.
Writes the actual per-vertex data into a reserved effect-quad slot. The base has already copied geometry (positions, UV0, UV1) from the source face quad and queued the triangle indices; destBaseIdx points at the first of the four duplicate vertices. The subclass writes UniTextMeshGenerator.Colors, UniTextMeshGenerator.Uvs2, and (if needed) re-positions UniTextMeshGenerator.Vertices through CoverageQuadOps helpers.
protected void EnqueueDuplicate(int sourceBaseIdx, int payload = 0, LayerBlend blend = LayerBlend.Normal)Queues a duplicate of the given face quad for emission at onMainPassFinalize, recorded at this modifier's LayerSequence — raised by the generator's current UniTextMeshGenerator.sequenceBias, captured here — so it stacks at its layer position inside whichever band the glyph is emitted into.
Flushes the pending emit queue. Default implementation processes emits in the order they were enqueued — correct for single-layer effects. Multi-layer effects (e.g. extrude) override and iterate their own per-layer buffers in layer-major order, calling ReserveQuad + OnEmitQuad directly.
protected static int ReserveQuad(UniTextMeshGenerator gen, int sourceBaseIdx, int sequence, LayerBlend blend = LayerBlend.Normal)Reserves a 4-vertex effect-quad slot: copies positions, UV0 and UV1 from the source quad — or, for a colour face that carries a silhouette field, builds the SDF quad over that field — records the quad at sequence with blend, and advances UniTextMeshGenerator.vertexCount.
