Docsv2.12.12
Back to API Reference
Class

EffectQuadOps

static

Static helpers for writing per-vertex effect data into a reserved effect-quad slot. Used from OnEmitQuad implementations; covers the common solid-colour + UV2 path and the per-vertex gradient path. Modifiers with bespoke requirements can skip these helpers and write the vertex arrays directly.

public static Color32 ModulateAlpha()

Modulates an effect colour's alpha by the source face vertex alpha — the canonical formula keeping outline / shadow / extrude fades synchronised with face fades (Graphic.color.a, per-character <alpha>, ColorModifier alpha).

public static void WriteSolidEffect()

Writes a single effect colour (per-vertex alpha-modulated by the source face vertex alpha) into the four destination vertex colours and stamps UV2 with the effect-mode flag plus dilate / softness. Covers outline / shadow / extrude-layer "solid colour" use cases.

public static void WriteGradientEffect()

Evaluates a gradient at each of the four destination vertex positions and writes the per-vertex colours (alpha-modulated by the corresponding source face vertex alpha) plus the effect-mode UV2 stamp. Vertex positions are read from Vertices at destBaseIdx, so the caller controls whether the gradient sees pre-offset positions (write before ApplyOffset) or post-offset positions (write after).

public static void WriteEffectUV2()

Stamps the effect-mode UV2 layout into all four destination vertices: x = dilate, y = 1 (per-quad effect-mode flag the shader branches on), z = 0 (reserved), w = softness.

public static void ApplyOffset()

Displaces all four destination vertices in the X/Y plane. Z is left untouched.