Sample

Evaluate fields, sample curves, or query spatial relationships at positions.

What it does

Sample reads a value at a position. Wire in a field, a curve or shape, or a set of points, and Sample evaluates it at the positions given, walks along it, or asks a spatial question about it: how far, how many nearby, what the nearest one looks like. Mode switches between these behaviours, and the node relabels its own controls to match.

With nothing wired to Position, Field mode passes the source field straight through unchanged, so a bare Noise or Distance Field into Sample previews exactly like the source alone.

When to use it

ParameterTypeDefaultWhat it does
sourceField or Curve or Collection or Color Field—Source: Field (SDF, noise, color), Curve/Shape (for curve sampling), Points/Geometry (for proximity queries), or Image (auto-coerced to ColorField).
positionCollection or Vec3 or Vec3[]—Elements to evaluate at. Points, Geometry, or Shape collection.
modeString"Field"Field: evaluate continuous field. Curve: distribute elements along a curve. Splat Pick: nearest splats to a screen-space NDC point. Others: query discrete point sets. One of: Field, Curve, Nearest Attribute, Nearest Distance, Density, KNN Blend, Splat Pick.
cameraCamera3D—Camera used to project splat positions into NDC for distance comparison
screen_pointVec2(0, 0)NDC point to pick around. (0,0) = screen centre; (-1,-1) = bottom-left; (+1,+1) = top-right.
aspect_ratioNumber1.778Viewport aspect ratio (width / height). Must match the NDC the query point is expressed in. 16:9 = 1.7778.
attributeString"Cd"Source attribute to read and transfer to query positions
neighborsNumber1KNN Blend: count of nearest neighbors to blend. Splat Pick: count of splats nearest to the screen point.
max_radiusNumber100Maximum search distance. 0 = unlimited (except Density which requires > 0).
density_modeString"Normalized"Count: raw count in radius. Normalized: 0-1 range. One of: Count, Normalized.
field_attributeString"sampled"Attribute name to write sampled field values to
source_channelString""For a multi-channel field source (a captured record): which named channel to evaluate.
apply_modeString"Set"Set: replace, Add: add to existing, Multiply: multiply existing. One of: Set, Add, Multiply.
timeNumber0Time value passed to field evaluation (for animated fields)
channelString"All"All: output full RGBA (ColorArray). Others: extract single channel as NumberArray — useful for sonification pipelines. One of: All, Red, Green, Blue, Alpha, Luminance.
parameterizationString"Arc Length"Uniform: equal parameter spacing. Arc Length: equal distance spacing. By Attribute: read t-values from a named attribute. One of: Uniform, Arc Length, By Attribute.
t_attributeString"t"Attribute name containing t-values (0-1) for curve sampling. Used when parameterization is 'By Attribute'.
alignBooleantrueOutput tangent rotation for aligning elements to the curve direction
curve_offsetNumber0Perpendicular offset from the curve
curve_loop_modeString"clamp"Behavior when curve parameter goes outside 0-1 range. One of: clamp, loop, ping_pong.
opacityNumber1Layer opacity (0 = transparent, 1 = opaque). Editable, wirable, keyframable.

Gotchas

Field mode has two shapes depending on whether Position is wired. Left empty, the source field comes back unchanged, which previews a field node through a Sample without committing to positions. Wired, the field is evaluated at those points and written onto them as the Field Attribute.

Distance and Nearest Index are filled in by the point-query modes only: Nearest Attribute, Nearest Distance, Density and KNN Blend. In Field, Curve and Splat Pick mode they are left empty; use the primary output.

Density needs a real search radius. A Max Radius of 0 is treated as unlimited for the nearest-neighbour modes, but Density requires a radius greater than zero to have an area to count within.

Splat Pick needs both Source and Camera wired to project splats into screen space. With Camera unconnected there is nothing to project against and no result is produced.

Worked example

  1. Add a Sample node and wire a Noise field into Source.

  2. Wire a Points node into Position, and set Mode to Field.

  3. Set Field Attribute to density and leave Apply Mode on Set. Each point now carries a density value read from the noise at its location.

  4. Switch Mode to Nearest Attribute, wire a second point set into Position, and set Attribute to Cd to copy colour from the nearest source point onto the new set instead.

See also

Attribute Reader · Fetch · Lookup · Fields