Generator node
Circle 2D
Draws a mathematically perfect circle, ellipse, arc, or pie slice as a GPU texture. Fill and border are rendered from a signed distance field, so edges stay crisp at any output resolution, and arcs can get rounded end caps for gauge- and spinner-style graphics. Reach for it whenever you need discs, rings, progress arcs, or radial UI elements — then composite the result with a Canvas node.
Inputs
| Port | Type | Default |
|---|---|---|
| EnableOff clears this shape's texture, so nothing reaches the canvas. | bool | true |
| XHorizontal centre in Grafit units, 0 being the middle of the view. Any value works; past about 1 it leaves the short edge. | float | 0 |
| YVertical centre in Grafit units, 0 being the middle of the view. | float | 0 |
| RadiusCircle radius in Grafit units — 1 reaches the short edge of the view. Not clamped; 0 or less leaves nothing to fill. | float | 0.1 |
| Scale XStretches the circle into an ellipse along its own horizontal axis. 1 keeps it round, 0 flattens it away. | float | 1.0 |
| Scale YStretches the circle into an ellipse along its own vertical axis. 1 keeps it round, 0 flattens it away. | float | 1.0 |
| RotationTurns the ellipse and the arc ends, in degrees, positive clockwise. Any value works; it just keeps rotating. | float | 0 |
| Start AngleWhere the arc begins, in degrees. Any value works — what matters is the span between start and end. | float | 0 |
| End AngleWhere the arc ends, in degrees. A full 360° span from the start draws a closed circle; anything less leaves a wedge open. | float | 360 |
| FillFills the interior with Fill Color. | bool | true |
| Fill ColorColour of the filled interior; its alpha sets how transparent the fill is. | color | — |
| BorderDraws an outline along the circle or arc edge. | bool | false |
| Border ColorColour of the outline; its alpha sets how transparent the outline is. | color | — |
| Border WidthOutline thickness in Grafit units. Not clamped; once it passes the radius the ring closes over the centre. | float | 0.01 |
| Border ModeWhere the outline sits relative to the edge — inside, centred on it, or outside. Anything outside the list is drawn centred. | int | 0 |
| Rounded EndsRounds the two cut ends of a partial arc into caps. Does nothing on a full circle. | bool | false |
| AntialiasingSmooths the edge using the global anti-aliasing amount. Off gives a hard, pixel-crisp edge. | bool | true |
| ShadowTurns on a soft drop shadow — a blurred copy of the shape drawn behind it. | bool | false |
| Shadow ColorColour of the drop shadow; its alpha sets how heavy the shadow reads. | color | — |
| Shadow Offset XHow far the shadow is pushed sideways, in Grafit units. Not clamped; around ±0.05 reads as a natural drop. | float | 0.02 |
| Shadow Offset YHow far the shadow is pushed vertically, in Grafit units. Negative drops it below the shape. | float | -0.02 |
| Shadow BlurSoftness of the shadow edge, in Grafit units. 0 gives a hard copy of the shape; larger values spread it wider and fainter. | float | 0.02 |
| Shadow SizeMeant to grow the shadow past the shape, but this shape's shadow currently ignores it — use Shadow Blur to spread the shadow instead. | float | 0 |
Outputs
| Port | Type |
|---|---|
| Image | image |
| Width | float |
| Height | float |
Live Preview
How It Works
Every frame, Circle 2D renders a fullscreen pass into its own offscreen Metal texture. The fragment shader evaluates a signed distance field (SDF) for the circle at every pixel: it measures the distance from the pixel to the ideal circle edge and converts that distance into coverage with a smoothstep. Because the shape is a mathematical function rather than geometry, edges are resolution-independent and antialiasing is a single smooth transition wide.
Coordinates follow the Grafit standard: origin (0,0) at the viewport center, with the shorter viewport edge mapping to [-1, +1]. X, Y, Radius, and Border Width are all in Grafit units, never pixels. Positive Rotation is clockwise, entered in degrees and converted to radians on the GPU.
The shape is built in this order:
- Base SDF — a circle of
Radius, stretched byScale X/Scale Y(unequal values produce an ellipse) and rotated byRotation. - Arc mask — if
End Angle − Start Angleis less than 360°, an angular mask cuts the shape into an arc or pie slice. Angles start at 12 o'clock (0°) and increase clockwise, and the mask rotates together with the shape. - Fill — when
Fillis on, the interior is covered withFill Color. - Border — when
Borderis on, a stroke ofBorder Widthis drawn on top of the fill, placed according toBorder Mode. On partial arcs withRounded Endson, semicircular caps (radius = half the border width) are added at both arc endpoints of the border stroke. - Premultiply — the final color is premultiplied (
rgb *= a), the mandatory format for Grafit generator textures.
Border Mode values:
| Value | Mode | Stroke placement |
|---|---|---|
| 0 | Inside | Drawn inward from the shape edge (outer stroke edge = shape edge) |
| 1 | Middle | Centered on the edge — half inside, half outside |
| 2 | Outside | Drawn outward from the edge (inner stroke edge = shape edge) |
Antialiasing uses the global AA multiplier (set in app settings); the node's Antialiasing toggle only switches it on or off for this shape. The shadow is not part of the SDF — it is a GPU post-process (the shape's geometry is extracted, blurred with a separable Gaussian, tinted with Shadow Color, offset, and composited underneath).
The Width and Height outputs report the shape's bounding size in Grafit units, not the texture size:
Width = 2 × Radius × Scale X
Height = 2 × Radius × Scale YThe Image output is the full-viewport offscreen texture. When Enable is false, the texture is cleared to transparent — downstream Canvas nodes show nothing, but connections stay intact.
Parameters in Depth
| Port | Default | Meaning |
|---|---|---|
Enable | true | Master switch. Off clears the output texture to transparent. |
X, Y | 0, 0 | Center position in Grafit units (0,0 = viewport center). |
Radius | 0.1 | Base radius in Grafit units. 1.0 spans half the shorter viewport edge. |
Scale X, Scale Y | 1.0, 1.0 | Per-axis stretch. Unequal values turn the circle into an ellipse; both also scale the Width/Height outputs. |
Rotation | 0 | Rotation in degrees, positive = clockwise. Only visible on ellipses and arcs — a full, un-stretched circle looks identical at any rotation. |
Start Angle, End Angle | 0, 360 | Arc span in degrees; 0° is at 12 o'clock, increasing clockwise. A span of 360° or more renders the full shape. |
Fill | true | Toggles the solid interior. |
Fill Color | White (1,1,1,1) | RGBA fill color; alpha below 1 makes a translucent disc. |
Border | false | Toggles the stroke, drawn on top of the fill. |
Border Color | Black (0,0,0,1) | RGBA stroke color. |
Border Width | 0.01 | Stroke thickness in Grafit units. |
Border Mode | 0 | Stroke placement: 0 = Inside, 1 = Middle, 2 = Outside (table above). |
Rounded Ends | false | Rounds the border's endpoints on partial arcs with semicircular caps. No effect on full circles or on the fill's cut edges. |
Antialiasing | true | Smooth SDF edges using the global AA multiplier. Off gives hard, aliased edges (useful for pixel-art looks or masks). |
Shadow | false | Enables the post-process drop shadow (extra GPU passes). |
Shadow Color | Black (0,0,0,1) | Shadow tint including alpha. |
Shadow Offset X, Shadow Offset Y | 0.02, −0.02 | Shadow displacement in Grafit units (default: down-right). |
Shadow Blur | 0.02 | Gaussian blur radius of the shadow. |
Shadow Size | 0 | Reserved for shadow expansion — currently not applied by Circle 2D (the renderer always passes 0). Use Rectangle if you need it today. |
Parameter interactions worth knowing: Radius sets the base size and Scale X/Scale Y multiply it, so animate Radius for uniform pulsing and the scales for squash-and-stretch. Border Width is independent of scale — a scaled ellipse keeps a constant-thickness stroke.
Use Cases
- Audio-reactive pulse —
Audio FFT→Remap→Radiusfor a disc that beats with the music; addAudio Beat Detection→Enablefor on-beat flashes. - Progress ring / gauge — disable
Fill, enableBorderwithRounded Ends, keepStart Angleat 0 and driveEnd Angle(0–360) fromCounter,Timer, orRemapfor a circular progress indicator. - Loading spinner —
Time→Math(multiply by degrees per second) →Rotationon a short arc (e.g.Start Angle0,End Angle90) withRounded Endson. - Pie chart — stack several Circle 2D nodes with adjacent
Start Angle/End Angleranges and differentFill Colors, each on its own Canvas layer. - Soft glow dot — a filled circle with
Shadowenabled, zero offset, and a largeShadow Blurreads as a halo; or run theImageoutput throughGaussian Blurand composite additively on a Canvas. - Eye-follow marker —
Mouse→X/Yfor a cursor-tracking highlight ring over other layers. - Circular mask — feed the
Imageoutput into a Canvas node'sMaskinput to cut any other generator into a disc or arc shape.
Tips
- Generators never draw directly to screen: connect
Imageto a Canvas node. Layer order and blend modes live on Canvas, not here. - The
Width/Heightoutputs are made to be wired into a Canvas or other consumer that needs the shape's footprint — they already includeScale X/Scale Y, but not the border or shadow overhang. Rounded Endsonly rounds the border of a partial arc. If you want a rounded pie-slice fill, fake it with a thick border in the same color as the fill.Shadow Sizeis currently a no-op on this node — offset and blur work, expansion does not.- Shadows cost four extra GPU passes (extract, horizontal blur, vertical blur, composite). Disable
Shadowwhen it is not visible. - Antialiasing quality is a global app setting; the per-node toggle cannot make one circle smoother than the rest of the scene.
- Related nodes: Rectangle (same SDF feature set for boxes), Gradient (colored fills), Mask Grow / Mask Outline (post-process the circle's silhouette).
Open Circle 2D in the interactive catalog →
Circle 2D is one of 381 nodes in Grafit Pro.
Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.