VEX functions
See VEX contexts to learn about the different contexts (such as surface shaders or displacement shaders) in which the various functions and statements are available.
Subtopics
alphaname vex function
Returns the default name of the alpha plane (as it appears in the compositor preferences).
ashikhmin vex function
assign vex function
An efficient way of extracting the components of a vector, vector4, matrix3 or matrix to float variables.
blinn vex function
phong, blinn, and specular return the illumination for specular highlights using different lighting models.
blinnBRDF vex function
bumpmapA vex function
bumpmapB vex function
bumpmapG vex function
bumpmapL vex function
bumpmapR vex function
bumpname vex function
Returns the default name of the bump plane (as it appears in the compositor preferences).
colorname vex function
Returns the default name of the color plane (as it appears in the compositor preferences).
computenormal vex function
In the POP and SOP contexts, sets how/whether to recompute normals. In the shading contexts, computes normals.
cone vex function
cracktransform vex function
Depending on the value of c, returns the translate (c=0), rotate (c=1), or scale (c=2) component of the transform (xform).
depthmap vex function
The depthmap functions work on an image which was rendered as a z-depth image from mantra.
depthname vex function
Returns the default name of the depth plane (as it appears in the compositor preferences).
diffuse vex function
Returns the diffuse (Lambertian) illumination given the normalized surface normal.
diffuseBRDF vex function
distance2 vex function
Returns the squared distance between the two 3 or 4 dimensional point arguments.
fastshadow vex function
Sends a ray from the position P along the direction specified by the direction D.
fit vex function
Takes the value in the range (omin, omax) and shifts it to the corresponding value in the new range (nmin, nmax).
fntransform vex function
forpoint vex function
fresnel vex function
Computes the fresnel reflection/refraction contributions given an incoming vector, surface normal (both normalized), and an index of refraction (eta).
fromNDC vex function
Transforms a position from normal device coordinates to the coordinates in the appropriate space.
ftransform vex function
fvtransform vex function
gather vex function
Sends rays into the scene and returns information from the shaders of surfaces hit by the rays.
getbbox vex function
Sets two vectors to the minimum and maximum corners of the bounding box for the entire geometry.
getblurP vex function
Returns the blurred point position (P) vector at a fractional time between frames.
getlightname vex function
Returns the name of the current light when called from within an illuminance loop.
getneighbourcount vex function
Returns the number of points that are connected to the specified point.
getrayweight vex function
Returns an approximation to the contribution of the ray to the final pixel color.
gradient3d vex function
Returns the gradient of a single channel texture image at the position specified by P.
hscript_noise vex function
hscript_noise, hscript_turb, hscript_snoise, and hscript_sturb mimic the Houdini expression functions noise(), snoise(), turb(), and sturb().
hscript_rand vex function
Produces the exact same results as the Houdini expression function of the same name.
hscript_snoise vex function
hscript_sturb vex function
hscript_turb vex function
illuminance vex function
Loops through all light sources in the scene, calling the light shader for each light source to set the Cl and L global variables.
ingroup vex function
Returns 1 if the particle specified by the point number is in the group specified by the string.
integrate3d vex function
This function will “integrate” the 3d image along the line specified by p0 and p1.
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.
intersect vex function
This function computes the intersection of the specified ray with the geometry.
intersect3d vex function
This function intersects a ray (with it’s origin at p0 and extending to p1), against a 3d texture image.
iplanename vex function
Returns the name of the plane specified by the planeindex of the given input (e.
iplanesize vex function
Returns the number of components in the plane named 'planename' in the specified input.
isbound vex function
Parameters in VEX can be overridden by geometry attributes (if the attributes exist on the surface being rendered).
isfogray vex function
Returns 1 if the shader is being called to evaluate illumination for fog objects, or 0 if the light or shadow shader is being called to evaluate surface illumination.
isframes vex function
Returns 1 if the Vex CHOP’s Unit Menu is currently set to 'frames', 0 otherwise.
issamples vex function
Returns 1 if the Vex CHOP’s Unit Menu is currently set to 'samples', 0 otherwise.
isseconds vex function
Returns 1 if the Vex CHOP’s Unit Menu is currently set to 'seconds', 0 otherwise.
isshadowray vex function
Returns 1 if the shader is being called to evaluate opacity for shadow rays, or 0 if the shader is being called to evaluate for surface color.
lntransform vex function
lookat vex function
computes a rotation matrix to orient the z-axis along the vector (to-from) under the transformation.
ltransform vex function
lumname vex function
Returns the default name of the luminence plane (as it appears in the compositor preferences).
lvtransform vex function
maskname vex function
Returns the default name of the mask plane (as it appears in the compositor preferences).
match vex function
This function returns 1 if the subject matches the pattern specified, or 0 if the subject doesn’t match.
matchvex_blinn vex function
matchvex_specular vex function
mattrib vex function
Returns the value of the point attribute for the metaballs if metaball geometry is specified to i3dgen.
max vex function
mdensity vex function
Returns the density of the metaball field if metaball geometry is specified to i3dgen.
metaimport vex function
Once you get a handle to a metaball using metastart and metanext, you can query attributes of the metaball with metaimport.
metamarch vex function
Takes the ray defined by p0 and p1 and partitions it into zero or more sub-intervals where each interval intersects a cluster of metaballs from filename.
metanext vex function
metastart vex function
Open a geometry file and return a “handle” for the metaballs of interest, at the position p.
min vex function
noise vex function
There are two forms of Perlin-style noise: a non-periodic noise which changes randomly throughout N-dimensional space, and a periodic form which repeats over a given range of space.
normalname vex function
Returns the default name of the normal plane (as it appears in the compositor preferences).
npoints vex function
ontransform vex function
otransform vex function
otransform, ltransform, ftransform, ontransform, lntransform, fntransform, ovtransform, lvtransform, and fvtransform query the scene for a geometry object, light or fog object of the given name.
ovtransform vex function
pathtrace vex function
pcfarthest vex function
Returns the distance to the farthest point found in the search performed by pcopen.
pcimport vex function
Imports channel data from a point cloud inside a pciterate or a pcunshaded loop.
pciterate vex function
This function can be used to iterate over all the points which were found in the pcopen query.
pcunshaded vex function
Iterate over all of the points of a read-write channel which haven’t had any data written to the channel yet.
phong vex function
phong, blinn, and specular return the illumination for specular highlights using different lighting models.
phongBRDF vex function
phonglobe vex function
photon_diffuse vex function
Generates a new diffuse photon path randomly distributed over the hemisphere defined by P and N, with energy Cl.
photon_reflect vex function
Generates a new specular photon path defined by the ray starting at P and travelling along R (the reflection direction) with energy Cl.
photon_switch vex function
Takes three arguments which represent the probabilities for each of the reflective paths.
photon_transmit vex function
Generates a new transmission photon path defined by the ray starting at P and traveling along R (the reflection direction) with energy Cl.
photonmap vex function
The photonmap function will evaluate a photon map and return the resulting color information.
planesize vex function
Returns the number of components in the plane (1 for scalar planes and up to 4 for vector planes).
pnoise vex function
There are two forms of Perlin-style noise: a non-periodic noise which changes randomly throughout N-dimensional space, and a periodic form which repeats over a given range of space.
pointname vex function
Returns the default name of the point plane (as it appears in the compositor preferences).
prim_attribute vex function
Evaluates the attribute string att for primitive pn at the parametric location u, v.
prim_normal vex function
Returns the normal of the primitive (prim_number) at parametric location u, v.
ptlined vex function
This function returns the closest distance between the point Q and a finite line segment between points P0 and P1.
random vex function
generate a random number based on the position in N dimensional space (where N is 1 to 4 dimensions).
rawbumpmap vex function
rawbumpmapA vex function
rawbumpmapB vex function
rawbumpmapG vex function
rawbumpmapL vex function
rawbumpmapR vex function
rawcolormap vex function
reflect vex function
Returns the vector representing the reflection of the direction against the normal.
refract vex function
Returns the refraction ray given an incoming direction, the normalized normal and an index of refraction.
relbbox vex function
Returns the relative position of the point given with respect to the bounding box of the entire geometry.
scale vex function
scales the given matrix in three directions simultaneously (X, Y, Z - given by the components of the scale_vector).
shadowmap vex function
The shadowmap function will treat the shadow map as if the image were rendered from a light source.
specular vex function
phong, blinn, and specular return the illumination for specular highlights using different lighting models.
specularBRDF vex function
specularBRDF, phongBRDF, blinnBRDF, and diffuseBRDF return the computed BRDFs for the different lighting models used in VEX shading.
sprintf vex function
Formats a string like printf but returns the result as a string instead of printing it.
texture3dBox vex function
This function queries the 3D texture map specified and returns the bounding box information of the file.
velocityname vex function
Returns the default name of the velocity plane (as it appears in the compositor preferences).
