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

PortTypeDefault
EnableOff clears this shape's texture, so nothing reaches the canvas.booltrue
XHorizontal centre in Grafit units, 0 being the middle of the view. Any value works; past about 1 it leaves the short edge.float0
YVertical centre in Grafit units, 0 being the middle of the view.float0
RadiusCircle radius in Grafit units — 1 reaches the short edge of the view. Not clamped; 0 or less leaves nothing to fill.float0.1
Scale XStretches the circle into an ellipse along its own horizontal axis. 1 keeps it round, 0 flattens it away.float1.0
Scale YStretches the circle into an ellipse along its own vertical axis. 1 keeps it round, 0 flattens it away.float1.0
RotationTurns the ellipse and the arc ends, in degrees, positive clockwise. Any value works; it just keeps rotating.float0
Start AngleWhere the arc begins, in degrees. Any value works — what matters is the span between start and end.float0
End AngleWhere the arc ends, in degrees. A full 360° span from the start draws a closed circle; anything less leaves a wedge open.float360
FillFills the interior with Fill Color.booltrue
Fill ColorColour of the filled interior; its alpha sets how transparent the fill is.color—
BorderDraws an outline along the circle or arc edge.boolfalse
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.float0.01
Border ModeWhere the outline sits relative to the edge — inside, centred on it, or outside. Anything outside the list is drawn centred.int0
Rounded EndsRounds the two cut ends of a partial arc into caps. Does nothing on a full circle.boolfalse
AntialiasingSmooths the edge using the global anti-aliasing amount. Off gives a hard, pixel-crisp edge.booltrue
ShadowTurns on a soft drop shadow — a blurred copy of the shape drawn behind it.boolfalse
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.float0.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.float0.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.float0

Outputs

PortType
Imageimage
Widthfloat
Heightfloat

Live Preview

Interactive — Radius, arc, ring and border — the shape parameters live

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:

  1. Base SDF — a circle of Radius, stretched by Scale X / Scale Y (unequal values produce an ellipse) and rotated by Rotation.
  2. Arc mask — if End Angle − Start Angle is 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.
  3. Fill — when Fill is on, the interior is covered with Fill Color.
  4. Border — when Border is on, a stroke of Border Width is drawn on top of the fill, placed according to Border Mode. On partial arcs with Rounded Ends on, semicircular caps (radius = half the border width) are added at both arc endpoints of the border stroke.
  5. Premultiply — the final color is premultiplied (rgb *= a), the mandatory format for Grafit generator textures.

Border Mode values:

ValueModeStroke placement
0InsideDrawn inward from the shape edge (outer stroke edge = shape edge)
1MiddleCentered on the edge — half inside, half outside
2OutsideDrawn 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 Y

The 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

PortDefaultMeaning
EnabletrueMaster switch. Off clears the output texture to transparent.
X, Y0, 0Center position in Grafit units (0,0 = viewport center).
Radius0.1Base radius in Grafit units. 1.0 spans half the shorter viewport edge.
Scale X, Scale Y1.0, 1.0Per-axis stretch. Unequal values turn the circle into an ellipse; both also scale the Width/Height outputs.
Rotation0Rotation in degrees, positive = clockwise. Only visible on ellipses and arcs — a full, un-stretched circle looks identical at any rotation.
Start Angle, End Angle0, 360Arc span in degrees; 0° is at 12 o'clock, increasing clockwise. A span of 360° or more renders the full shape.
FilltrueToggles the solid interior.
Fill ColorWhite (1,1,1,1)RGBA fill color; alpha below 1 makes a translucent disc.
BorderfalseToggles the stroke, drawn on top of the fill.
Border ColorBlack (0,0,0,1)RGBA stroke color.
Border Width0.01Stroke thickness in Grafit units.
Border Mode0Stroke placement: 0 = Inside, 1 = Middle, 2 = Outside (table above).
Rounded EndsfalseRounds the border's endpoints on partial arcs with semicircular caps. No effect on full circles or on the fill's cut edges.
AntialiasingtrueSmooth SDF edges using the global AA multiplier. Off gives hard, aliased edges (useful for pixel-art looks or masks).
ShadowfalseEnables the post-process drop shadow (extra GPU passes).
Shadow ColorBlack (0,0,0,1)Shadow tint including alpha.
Shadow Offset X, Shadow Offset Y0.02, −0.02Shadow displacement in Grafit units (default: down-right).
Shadow Blur0.02Gaussian blur radius of the shadow.
Shadow Size0Reserved 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 → Radius for a disc that beats with the music; add Audio Beat Detection → Enable for on-beat flashes.
  • Progress ring / gauge — disable Fill, enable Border with Rounded Ends, keep Start Angle at 0 and drive End Angle (0–360) from Counter, Timer, or Remap for a circular progress indicator.
  • Loading spinner — Time → Math (multiply by degrees per second) → Rotation on a short arc (e.g. Start Angle 0, End Angle 90) with Rounded Ends on.
  • Pie chart — stack several Circle 2D nodes with adjacent Start Angle/End Angle ranges and different Fill Colors, each on its own Canvas layer.
  • Soft glow dot — a filled circle with Shadow enabled, zero offset, and a large Shadow Blur reads as a halo; or run the Image output through Gaussian Blur and composite additively on a Canvas.
  • Eye-follow marker — Mouse → X/Y for a cursor-tracking highlight ring over other layers.
  • Circular mask — feed the Image output into a Canvas node's Mask input to cut any other generator into a disc or arc shape.

Tips

  • Generators never draw directly to screen: connect Image to a Canvas node. Layer order and blend modes live on Canvas, not here.
  • The Width/Height outputs are made to be wired into a Canvas or other consumer that needs the shape's footprint — they already include Scale X/Scale Y, but not the border or shadow overhang.
  • Rounded Ends only 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 Size is 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 Shadow when 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.

More Generator nodes