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
-
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.
-
If 3d textures have negative values, these will contribute to the integration. When clipping against vector channels, integration is terminated when any component of the channel reaches the limit.
-
This function can be used to “skip” un-interesting parts of the 3D texture map when doing ray-marching through the map.
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.