Draw Field
Visualize a scalar, vector, or color field as a texture — either as a bare raster (default), a heatmap with a custom color ramp, arrow glyphs, or integrated streamlines.
Category: Render Menu path: Render > Draw Field
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
field_in | scalarField (polymorphic — also accepts vectorField / colorField) | input | Field to visualize |
out | imageRgba16f | output | Rasterized or visualized texture |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
visualization | enum | None | None / Heatmap / Arrows / Streamlines — see below |
colorRamp | GradientRamp | black→white | Heatmap mode — scalar value [0, 1] maps through this ramp |
density | scalar | 16 | Arrows / Streamlines — count along the shorter axis (longer axis scales to keep cells square) |
arrowColor | color | cyan | Arrows / Streamlines — stroke color |
arrowLength | scalar | 30 | Arrows — arrow shaft length in comp pixels at magnitude=1 |
steps | scalar | 30 | Streamlines — integration steps per seed |
stepSize | scalar | 4 | Streamlines — distance in comp pixels per step |
Inspector hides params not relevant to the active mode.
Visualization Modes
None (default, backward compatible)
Straight rasterization of whatever field is connected. Scalar → grayscale. Vector → R=u, G=v, B=0. Color → RGBA directly. Same behavior Draw Field had before visualization modes existed, and identical to what resolve_as_texture() does automatically when you wire a field into any imageRgba16f input.
Heatmap (scalar fields)
Each pixel's scalar value (clamped to [0, 1]) is fed through colorRamp to produce an RGBA. Useful for visualizing distance fields, noise, curvature, or any 1D signal where a named color palette helps legibility. Drop in a "viridis"/"inferno"/"thermal" style ramp for scientific-visualization looks; use a custom 3-stop ramp for branded palettes.
Vector and color inputs fall back to None rendering when Heatmap is selected (no canonical heatmap of an RGBA or 2D signal).
Arrows (vector fields)
Draws a grid of arrow glyphs at evenly-spaced comp positions. Each arrow:
- Sits at a grid cell center
- Points in the direction of the field at that location
- Has shaft length proportional to field magnitude ×
arrowLength - Gets a proper arrowhead (two wings at 25° from the shaft)
Arrows are drawn on a transparent background — merge over a Heatmap or the original content for context.
Streamlines (vector fields)
Seeds particles at a grid, integrates each forward through the vector field for steps steps of length stepSize, and draws the resulting polyline. Gives an "iron filings around a magnet" look — reveals field topology far more clearly than discrete arrows or raw color.
Alpha fades ~50% from head to tail across the streamline length, hinting at direction of flow. Seeds that enter zero-magnitude regions stop early.
Usage Examples
Inspect a Noise vector field
Noise.vectorField → DrawField (visualization: Streamlines, density: 16, steps: 40) → OutputSee the flow topology at a glance. Great for tuning Noise params until the flow feels right for downstream particle work.
Heatmap a DistanceField
DistanceField (shape: your_shape).scalarField → DrawField (visualization: Heatmap, colorRamp: viridis) → OutputFalloff surface gets a clean false-color rendering — useful for previewing what a particle attribute driven by this field will look like.
Visualize Optical Flow
VideoSource → OpticalFlow → ImageSample (as vectorField) → DrawField (Streamlines) → OutputLive flow visualization on video — great for tuning OpticalFlow's smoothness and iterations against real footage.
Arrows overlay on source
Noise.vectorField → DrawField (Arrows) → Merge ← Source → OutputField direction overlaid on the source image (merge as Normal / Add for different looks).
Tips
- Density vs count: the actual arrow / streamline count is
density × density × (aspect ratio)— at density 16 on a 16:9 comp you get ~144 elements. Raise to 24-32 for finer sampling; lower to 8-10 for minimalist visualization. - Streamlines are cheap: CPU integration of a few thousand points per frame is sub-millisecond. Density 32 + 60 steps ≈ 30k points — still fast.
- Heatmap + scalar noise is a very common scientific-viz pairing. Combine with a
Colorizenode on a texture for even more control (Colorize operates per-pixel like DrawField Heatmap mode, just on a texture rather than a field). - Step size tradeoff (streamlines): small
stepSize(1-2) = precise flow tracing but needs morestepsto travel visible distance. LargestepSize(8-16) = longer streaks per step but overshoots sharp turns. Default 4 works for most fields. - Background is transparent in Arrows / Streamlines mode. Merge or place against a solid color / heatmap underneath for readability.
When to Use
- None: you just want a texture out of a field. Unless you're using Draw Field as a visual marker in the graph, you can skip the node entirely — wire the field port directly into Output and the engine auto-rasterizes.
- Heatmap: visualizing scalar signals — distance fields, noise, any 1D data — with a meaningful color palette.
- Arrows: visualizing vector field direction at discrete positions. Good when you want to see exact values at specific places.
- Streamlines: visualizing vector field topology. Best for understanding what particles will do when advected through the field.
Related Nodes
- Colorize — per-pixel scalar → color via ramp on textures (not fields). Useful parallel to Heatmap mode.
- OpticalFlow — the canonical source of vector fields that benefit from streamline visualization
- Noise, Voronoi, Gradient — field sources to inspect
- DistanceField — scalar field source, classic heatmap candidate
- PointAdvect — if streamlines look interesting, this is how you put real particles through the same field