metamarch()

   4659   2   1
User Avatar
Member
58 posts
Joined: July 2005
Offline
In versioin Log;

7.0.240

The metamarch() function was added to VEX. The primary use of
this function is for ray-marching through metaball fields. Please
see the online documentation for more information.

But I can't find the information in online document.

Have anyone used this function?

Please, teach me how to use.
User Avatar
Member
4262 posts
Joined: July 2005
Offline
You can get all the details here in $HFS/houdini/vex/html/index.html

For some reason the help embedded into chrome/hbrowser thing isn't up to date with the vex help in the above directory.


int metamarch(int index; string filename; vector p0, p1; float displace_bound)

This function will take the ray defined by p0 and p1 and partition the ray into zero or more sub-intervals. Each interval will intersect a cluster of metaballs from the file filename. The interval may not actually intersect any metaballs, but will provide fairly tight bounds on the cluster. This allows a ray-marching algorithm to “skip” uninteresting areas and only focus on marching through areas where metaballs might be found.

The first time the function is called, the index parameter should be set to -1 and the p0 and p1 variables should be set to the end-points of the ray. If an interval was found, the function will return 1 and the p0 and p1 variables will be set to the end-points of the interval. Otherwise the function will return 0 and the p0/p1 variables will be unchanged.

On subsequent calls to the function, the value of index will be modified by the function and any additional interesting intervals will be returned. Thus, the function can be used to ray-march through just areas of interest, skipping the dead space.
int index;
vector p0, p1;

// Initialize input values index = -1;
p0 = Eye;
p1 = P;
result = 0;
while (metamarch(index, metaball_file, p0, p1, displace_bound)) {
result += ray_march(metaball_file, p0, p1);
}
if(coffees<2,round(float),float)
User Avatar
Member
58 posts
Joined: July 2005
Offline
Thaks, Wolfwood.

I try to make volume Shader with metamarch.

But, the shader may need much time to render images.
  • Quick Links