Ray

The Ultimate Houdini node reference

Visit the Node Bible

To learn more, please log in or sign up for free to explore the Node Bible.
Write your awesome label here.

Ray

Write your awesome label here.
The Ray SOP is used to project geometry onto another surface or transfer attributes /groups between two geometry streams.
Drag to resize

General Parameters:

Group:
    --  This allows you to specify a selection of prims or points to be considered when reading geometry from the first input of the node.

Entity:
    --  This relates to what kind of group you'd like to specify

Collision Group:
    --  This is the group of prims or points to be considered when reading information from the second input of the node.

---------------------------------
Method:

Project Rays:
    --  This method will cause the ray node to project rays away from the points or prims in a certain direction.  If the rays hit something, it can then allow you to affect the geometry in some kind of way.

Minimum Distance:
   --  This method will simply find the minimum distance between the two geometry streams.  If you'd like to, for example, move points to the location that's closest to it from the the other geometry stream, this will do so.

--------------------------------------

D
irection Source:  (These options are only visible when the "Project Rays" is selected)

    --  Vector   
Sets a custom direction vector for the projection.  You can think of this as specifying a direction from each point or prim in x,y,z for the ray to travel in.  So, for example, a value of 0,1,0 would tell each point or primitive to send a ray in the +Y direction.  By default, this uses an expression @N.[] to use the point normals of your geometry when sending rays.  You can delete this if you'd like, and specify your own vector here. 

    --  Normal   
Uses the point normals to define the projection direction. 

    --  Attribute   
Allows you to use a custom vector attribute for direction, offering more control on a per-point basis. This attribute ought to be a vector attribute which describes which direction a specific point or prim ought to shoot a ray.

--------------------------------------

Direction Type
:  (These options are only visible when the "Project Rays" is selected)

    --  Forward
Shoots the ray in the direction that's specified.

    --  Reverse
Shoots the ray in the opposite direction specified.

    -- Bidirectional
Shoots the ray in both the direction and opposite direction specified.

--------------------------------------


--  Show Guide Geometry   
Displays a wireframe of the target collision geometry to help visualize how your projection interacts with it. 

-- Transform Points   
Enables actual transformation of the points. Disable this if you're only using the Ray SOP to transfer attributes or create groups. 

-- Intersect Farthest Surface   
By default, rays hit the closest surface. Enable this to project onto the **farthest** surface instead. 

-- Ray Tolerance
According to the docs: "Controls the tolerance of the ray intersection. Due to numerical round off, otherwise watertight geometry might let rays pass through it. The ray tolerance decreases the chance of ray leakage by allowing near misses to count as hits. For very small geometry, you may want to decrease the default to avoid false positives. Likewise, very large geometry may need a higher value."  
In practice, the ray tolerance is there to help with accuracy when dealing with very large or small objects.  Only use if you're finding inaccurate results.

-  Scale
This affects the positioning of an object that is casted onto another object.  In effect, it allows you to undershoot or overshoot the position.  In practice, this can be nice to use if you need a little bit of spacing between the two objects so that they're not perfectly on top of each other.

--  Lift
This is identical to the scale parameter except that it maintains the shape of the projected object.  The scale act more like a blend between the original mesh and the projected mesh.  This acts more like an offset because it doesn't change the shape of the projected geometry.

-- Bias
The user documentation does not include any info about the bias parameter.  From what we can tell, this will allow you to enable / disable certain areas for projection.

--  Max Distance
This allows the rays to travel a max distance when searching for objects to hit.  If an object is not within a certain distance, the ray node not affect the point/prim in any way.

-- Point Intersection Normal   
Transfers normals from the collision geometry to the affected points on your projected geometry. In case you want good normals on your new geometry, it's best practise to add a normal node after the Ray node, with possible a reverse node in between (in case your normals are the wrong way around). 

--------------------------------------

Samples
:  (This section will generally randomize the directions of each sample.  In order to see any change, you need to increase the "Jitter Scale."  In practice, it's usually easier to ignore this section and specify the directions yourself on the incoming geometry.)
Sample:
This parameter creates a certain number of samples that are sent from each point/prim.  With multiple samples shot out in random directions, the result of multiple samples are then combined into one ray sample via the "Combine Samples" method that is selected.

Jitter Scale:
This can generally be thought of as how much you want the rays to randomly change their direction.  This value appears to be arbitrary, so it's best to adjust it yourself and see the result.

Seed:
Provides a different variation of randomization

Combine Samples:
When multiple rays are sent from each point/prim, this parameter determines how the final ray is determined.  Average will return the average direction, median will find the median vector value, shortest finds the shortest vector that hit the other object, and longest finds the longest ray that was randomly shot outwards.

--------------------------------------

Output:  (This section determines what sort of output attribute information is stored onto the resulting geometry)

--  Point Intersection Normal
There doesn't seem to be any documentation for this parameter.  From what we can tell, checking this on will tell the collision geometry that it should replace it's original normals with the normals of the collision geometry.

--  Point Intersection Distance 
Writes out an attribute containing the exact distance from each point (or primitive) to the collision geometry. Use this value when you need to drive custom effects or visualize how far each intersection traveled. 

-- Ray Hit Group
If the projected ray from a point/prim hits the collision geometry successfully, then turning this on will include that point/prim within a group.  If a point/prim does not hit the collis geometry, then it will not be included in this output group.

-- Prim Num Attribute:
This will create an attribute on the ray geometry that indicates the prim number of the collis geometry that it hit.

--  Prim UVW Attribute:
This will create an attribute that describes the location in the primitive's parametric space.  This is different than the UV space.  It refers to a parametric location that exists along the primitive that it hit.  For more information on what parametric space means for primitives, visit the primitives chapter in Houdini Principles.

-- Import Hit Attributes   
This section allows you to import the attributes found on the collision geometry.

-- Import Hit Groups
This section allows you to import groups found on the collision geometry.