Houdini 12 VEX VEX functions

Sends a ray from the position P along the direction D.

  1. float rayhittest(vector P, vector D, float bias)

  2. float rayhittest(vector P, vector D, vector pHit&, vector nHit&, float bias)

Sends a ray from the position P along the direction D. The length of the D vector represents the farthest distance considered when check for occlusion.

Returns the distance to the object intersected. If no object is hit, returns less than 0.

If you specify pHit and nHit, they get the position and normal of the hit surface.

See optional raytracing parameters .

In many cases, the area sampling features will not produce usable results with the rayhittest() function.

Tip

When hit testing polygons you can get lots of rays missing. In these cases triangulating the geometry can improves hits.

Contexts: displace, fog, light, shadow, surface

Related topics