Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Quill/llms.txt
Use this file to discover all available pages before exploring further.
Vertex is the fundamental unit of geometry in Prowl.Quill. Every filled shape, stroke, and image rectangle is ultimately decomposed into Vertex instances that live in the Canvas.Vertices list. The struct is decorated with [StructLayout(LayoutKind.Sequential, Pack = 1)], which guarantees a predictable 20-byte layout with no padding. This makes the list safe to upload directly to a GPU vertex buffer via a fixed-pointer cast or Marshal.Copy.
Memory Layout
FramebufferScale) and any active Transform2D before writing x and y.
UV coordinates are not normalised texture UVs for the brush texture; they
carry a special meaning for the built-in anti-aliasing shader described below.
Static Member
Always
20. Use this constant when computing vertex-buffer byte sizes:Core Fields
The horizontal position of the vertex in physical pixel space. The canvas
multiplies the logical-unit position by
FramebufferScale (and applies the
current Transform2D) before storing this value.The vertical position of the vertex in physical pixel space.
Anti-aliasing U coordinate. See the UV Conventions section
for the exact semantics — this is not a texture atlas coordinate.
Anti-aliasing V coordinate. See UV Conventions.
Red colour component. Stored as premultiplied alpha;
Canvas.AddVertex
performs the premultiplication and global-alpha scaling automatically.Green colour component (premultiplied).
Blue colour component (premultiplied).
Alpha component. The canvas multiplies this by
Canvas.GlobalAlpha before
premultiplying RGB.Computed Properties
Returns
new Float2(x, y) — the vertex position as a vector.Returns
new Float2(u, v) — the anti-aliasing UV pair as a vector.Returns
Color32.FromArgb(a, r, g, b) — the vertex colour reconstructed from
the four raw byte components.Constructor
Screen-space position in physical pixels. Pass the result of
Canvas.TransformPoint to apply the current canvas transform and scale.Anti-aliasing UV. Use
(0.5f, 0.5f) for interior/opaque vertices and
(0f, 0f) for edge vertices that should be anti-aliased to transparent. See
the UV Conventions section below.The base vertex colour before premultiplication.
Canvas.AddVertex applies
GlobalAlpha and premultiplies; pass straight (non-premultiplied) values
here.UV Conventions
Prowl.Quill uses the UV channel as an anti-aliasing signal rather than as texture mapping coordinates. The fragment shader interprets UV as a coverage mask:| UV value | Meaning |
|---|---|
(0.5, 0.5) | Interior / fully opaque — the fragment is well inside the shape boundary. The shader outputs full coverage. |
(0, 0) | Edge / anti-aliased — the vertex sits on or beyond the shape silhouette. The shader smoothly fades this fragment toward transparent, producing sub-pixel soft edges. |
UV = (0, 0) to the expanded ring vertices
and UV = (0.5, 0.5) to the interior fan centre. The shader computes coverage
from the UV magnitude and outputs an alpha that is proportional to how far the
UV is from zero.
Example: reading UV from the vertex buffer
Constructing a custom shape
Unsafe Upload Pattern
BecauseVertex is Sequential, Pack = 1, the vertex list can be pinned and
uploaded to a native GPU buffer without any marshalling: