In brief
- Raycast calculates intersections between rays cast from source geometry and target geometry.
- Raycast outputs include hit information, position, normal vector, distance, and an optional attribute.
- Sample Index retrieves values from selected indices in the source geometry.
- With Sample Index, you can define the data type, domain, and how invalid indices are handled.
What you’ll learn in this tutorial
The Raycast and Sample Index nodes in Blender Geometry Nodes both read data across geometries, but they don’t do the same thing. Raycast finds where rays cast from one geometry intersect a target geometry. Sample Index retrieves values corresponding to specific indices in source geometry. In this tutorial, we’ll walk through what each node is for, which inputs matter, and how to interpret the outputs.
Raycast is useful in setups that need intersection data such as surface position, normal, or distance. Sample Index, on the other hand, lets you use values from one geometry in another evaluation context by matching indices. Which node is appropriate depends on whether the data you need is based on a surface intersection or an index match.
Requirements
You’ll need a Blender installation that supports Geometry Nodes, plus geometry you can use to build and evaluate node setups. The source documentation doesn’t specify a Blender version, account type, or cost requirement. So there’s no exact version number to give; check that the Raycast and Sample Index nodes are available in your installation.
For Raycast, the geometry in the node’s evaluation context and the geometry tested by the rays serve separate roles. The former is the source geometry; connect the latter to the Raycast node’s Target Geometry input. For Sample Index, you’ll need the Geometry to sample from, the Value field to sample, and the Index input to use. If indices may fall outside the source field’s size, consider how the Clamp option works before you begin.
Step by step: Evaluating surface intersections with Raycast
Identify the source and target geometry. The geometry in the context where Raycast is connected serves as the source geometry from which the rays are cast. Connect the geometry to test against to the Raycast node’s Target Geometry input. Keeping these roles distinct makes it easier to understand which geometry is producing the rays.
Set the rays’ starting positions. Source Position determines where each ray begins. By default, this input behaves as if a Position node were connected. If you want to use another field for the starting position, connect it to this input.
Set the direction and maximum distance. Ray Direction determines the direction each ray travels from its starting point. This field is evaluated on the geometry in the node’s field evaluation context, not on the target geometry. Ray Length sets the maximum distance a ray can travel before it is considered a hit. If the target surface lies beyond this distance, the ray is considered a miss. Make sure the direction and length match the surface intersection you’re looking for.
Check the hit status and key outputs. Is Hit is a Boolean output indicating whether each ray reached the target geometry. Hit Position returns the intersection position, and Hit Normal returns the surface normal at the intersection. Hit Distance is the distance between the starting position and the intersection point. If a ray doesn’t hit the target, Hit Distance returns the Ray Length value.
Sample an attribute from the target surface if needed. You can connect an optional field to Raycast’s Attribute input to evaluate it on the target geometry. The node samples the field at the intersection points and sends the values to the Attribute output. The Interpolation option determines how values on the target mesh are mapped: Interpolated calculates smoothly interpolated values for corner and vertex attributes, while Nearest selects the value from the nearest corner. The right method depends on whether the data should be represented by a smooth transition at the intersection point or by the nearest sample.
Use the outputs in the rest of your setup. Use Is Hit to distinguish between rays that hit and those that miss, and pass Hit Position, Hit Normal, Hit Distance, or Attribute to subsequent operations. The Raycast node also has a Data Type property that determines the type of data being evaluated. Deciding in advance what you need from the outputs helps keep unnecessary data out of your setup.
Step by step: Sampling values with Sample Index
Connect the source geometry and the value to sample. Connect the geometry to sample from to the Geometry input, and the field to evaluate on that source geometry to the Value input. Sample Index retrieves values from the Value field for specified indices and outputs them through Value.
Set the indices. The Index input selects which values to read from the source geometry. Connecting an index field lets you retrieve values from different indices and thereby reorder them. Check what the indices represent in the context of the geometry and field used in your setup.
Review the Data Type and Domain settings. Data Type sets the type of data to retrieve; Domain determines the domain through which attribute data is transferred and evaluated. For example, you can retrieve data from the faces of the source geometry and evaluate it on the points of another geometry. Keep these choices compatible with the values you want to use and the source field.
Choose how Clamp should behave. When Clamp is enabled, indices are constrained to the size of the attribute field. When it’s disabled, invalid indices return a default value. Check that your index field falls within a valid range; don’t treat this option as an automatic fix in setups where clamping isn’t appropriate.
Account for geometry components. The Point domain is shared by Mesh, Point Cloud, and Curve components. If the Geometry input contains multiple components, Sample Index samples from the first non-empty component in this order: Mesh, Point Cloud, Curve. If you need data from a specific component, separate the components with a Separate Components node and sample the desired component directly.
Check whether the index mapping is appropriate. When the source and target geometries have the same point count and topology, using one geometry’s positions on another can produce better results. The documentation notes that this approach can recreate the behavior of Blender’s Transfer Attribute node from before Blender 3.4. This doesn’t guarantee a one-to-one match across different topologies; check whether the indices have the same meaning in both geometries.
Common mistakes
Treating the source geometry and Target Geometry as if they had the same role in Raycast makes it unclear which geometry the rays are being calculated from. Also, expecting an intersection without accounting for Ray Length can lead you to misinterpret rays that don’t reach the target surface. Check the Is Hit output, and remember that Hit Distance returns the Ray Length value when there’s no hit.
The most commonly overlooked issue with Sample Index is index matching. Two geometries that look similar may not have the same number of points or the same topology. Invalid indices returning a default value and Clamp constraining indices are also different behaviors. Don’t interpret results without knowing which component is being sampled in multi-component geometry; separate the components if needed.
Use in architectural and visualization workflows
In architectural modeling and visualization, Raycast can be useful in setups that need the intersection points of rays with a target surface, or normal and distance information at those points. It can also read an attribute from the target surface. Sample Index samples geometry values by index and can be useful in transfer setups where matching point counts and topology matter.
These tools won’t automatically produce the same result on every model. With Raycast, the direction, starting point, and maximum distance affect the result; with Sample Index, the index, domain, and component selection matter. The sources don’t provide information about specific hardware requirements, licensing models, or compatibility with other software. Before using either node in a real project, test hit states, invalid indices, and matching conditions on simple geometry to catch unexpected outputs early.
Next steps
Start by testing Raycast in a simple setup where you can inspect only the hit status and Hit Position output. Then check Hit Normal, Hit Distance, and Attribute separately, and compare the Interpolated and Nearest options. For Sample Index, start with a known index field, then change the Data Type, Domain, and Clamp settings one at a time.
You don’t have to put both nodes in the same setup. Raycast produces information based on surface intersections, while Sample Index selects values by index. Combining the nodes before you’ve determined which method will provide the data you need can make the data flow in your setup unnecessarily complex.
Sources and license
This tutorial is adapted into Turkish from the Blender Manual’s Raycast Node and Sample Index Node documentation. Both sources are published under the CC BY-SA 4.0 license.
Sources
2 sourcesSource texts are not republished; short quotes are marked, everything else is our own summary and commentary.
These two nodes can help architecture offices and visualization teams sample geometry data more carefully. Since Raycast relies on surface intersections and Sample Index relies on index matching, choosing the right node matters. In particular, index transfer shouldn’t be assumed to be reliable when working with models that have different topologies.
The sources don’t specify hardware requirements, pricing, or licensing terms, so it wouldn’t be appropriate to make assumptions about these. Students and production teams should first verify the node outputs on simple test geometry. Before moving on to a real project, they should confirm that the nodes are available in their Blender version and that component and index behavior produces the expected result.
Frequently asked questions
What does the Blender Geometry Nodes Raycast node do?
It calculates intersections between rays cast from source geometry and target geometry. It can output hit status, position, normal, distance, and an optional attribute.
What does Clamp do in the Sample Index node?
When Clamp is enabled, indices are constrained to the size of the attribute field. When it’s disabled, invalid indices return a default value.
Do Raycast and Sample Index do the same thing?
No. Raycast finds surface intersections; Sample Index retrieves values at specific indices from source geometry.



