integrate3dClip VEX function

The integrate3dClip function integrates along the ray described by p0 and p1 where “interesting” things start happening in a given I3D texture.

Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex

  1. int integrate3dClip(string filename, string channel, vector p0&, vector p1, float limit)

The integrate3dClip function integrates along the ray described by p0 and p1 where “interesting” things start happening in a given I3D texture. It works by marching along the given ray, integrating the value of channel in the 3d texture space until the sum of the integration reaches the limit. At that point, it stops and sets the value of p0 to be the point where limit was reached and returns 1.

If the limit is not reached during the integration, then the function will return 0 and the value of p0 will be set to the value of p1.

You can specify additional arguments to control the integration. See integrate3d.

For example:

clipped = integrate3dClip(file, "density", eye, ps, .001);
if (clipped)
{
    // eye will be moved to the start of the "interesting"
    // area.
    raymarch(eye, ps);
}

For more information on .i3d files, see the Image3d Files help page.