trace VEX function

Sends a ray from P along the normalized vector D.

Contexts: displace, fog, light, shadow, surface

See also: rayhittest, Raytrace VOP

  1. void trace(vector cv&, vector of&, float af&, vector P, vector D, float shadow_bias, float max_contrib)

Sends a ray from P along the normalized vector D. The resulting color, opacity and alpha will be put in the export variables.

shadow_bias is typically a small number which is used to prevent self-shading.

max_contrib controls how much the result of the trace() call will contribute to the resulting pixel color. max_contrib has no effect on the results of the trace() call.

See optional parameters .

Tip

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