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
Baking a field, noise, a distance field, an image, onto points or geometry as an attribute → Field
Scattering or aligning elements along a curve or shape outline → Curve
Copying an attribute from one point set onto another by proximity, or blending several nearby values → Nearest Attribute or KNN Blend
How far the nearest point is, or how crowded a location is → Nearest Distance or Density
The splats nearest to a point on screen, for click-to-select on a Gaussian splat cloud → Splat Pick
| Parameter | Type | Default |
|---|---|---|
source | OneOf([Field, Curve, Collection, FieldOf(Color)]) | — |
position | OneOf([Collection, Vec3, Vec3Array]) | — |
mode | String | "Field" |
camera | OneOf([Camera3D]) | — |
screen_point | Vec2 | (0, 0) |
aspect_ratio | Number | 1.778 |
attribute | String | "Cd" |
neighbors | Number | 1 |
max_radius | Number | 100 |
density_mode | String | "Normalized" |
field_attribute | String | "sampled" |
source_channel | String | "" |
apply_mode | String | "Set" |
time | Number | 0 |
channel | String | "All" |
parameterization | String | "Arc Length" |
t_attribute | String | "t" |
align | Boolean | true |
curve_offset | Number | 0 |
curve_loop_mode | String | "clamp" |
opacity | Number | 1 |
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
Add a Sample node and wire a Noise field into Source.
Wire a Points node into Position, and set Mode to Field.
Set Field Attribute to
densityand leave Apply Mode on Set. Each point now carries adensityvalue read from the noise at its location.Switch Mode to Nearest Attribute, wire a second point set into Position, and set Attribute to
Cdto copy colour from the nearest source point onto the new set instead.
See also
Attribute Reader · Fetch · Lookup · Fields