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.
Functions
| Du | Takes the derivative of the given value with respect to U. | |
| Dv | Takes the derivative of the given value with respect to V. | |
| Dw | Takes the derivative of the given value with respect to the 3rd axis, for volume rendering. | |
| abs | Returns the absolute value of the argument. | |
| acos | Returns the arc-cosine of the argument. | |
| addattribute | Adds or changes a point attribute. | |
| addgroup | Adds the particle specified by point_number to the group specified. | |
| addvariablename | Adds the mapping of the attribute aname to the local variable vname. | |
| albedo | Returns the albedo (percentage of reflected light) for a bsdf given the outgoing light direction. | |
| alphaname | Returns the default name of the alpha plane (as it appears in the compositor preferences). | |
| ambient | Returns the color of ambient light in the scene. | |
| anoise | These functions are similar to the Worley noise functions listed above. | |
| area | Returns the area of the micropolygon containing a variable such as P. | |
| array | Efficiently creates an array from its arguments. | |
| arraylength | Returns the length of an array. | |
| ashikhmin | ||
| asin | Returns the arc-sine of the argument. | |
| assign | An efficient way of extracting the components of a vector, vector4, matrix3 or matrix to float variables. | |
| atan | Returns the arc-tangent of the argument. | |
| atan2 | Returns the arc-tangent of y/x. | |
| atof | Converts a string to a float. | |
| atoi | Converts a string to an integer. | |
| atten | Computes attenuated falloff. | |
| avg | Returns the average of the vector’s 3 components | |
| binput | binput returns bilinear sampled input. | |
| blinn | phong, blinn, and specular return the illumination for specular highlights using different lighting models. | |
| blinnBRDF | ||
| bumpmap | Bump maps will return the color gradient of the image in the du/dv parameters. | |
| bumpmapA | ||
| bumpmapB | ||
| bumpmapG | ||
| bumpmapL | ||
| bumpmapR | ||
| bumpname | Returns the default name of the bump plane (as it appears in the compositor preferences). | |
| ceil | Returns the smallest integer greater than or equal to the argument | |
| ch | Evaluates a channel (or parameter) and return its value. | |
| chend | Returns the end sample of the input specified. | |
| chendf | Returns the frame corresponding to the last sample of the input specified. | |
| chendt | Returns the time corresponding to the last sample of the input specified. | |
| chinput | Returns the value of a channel at the specified sample in an input. | |
| chname | Returns the channel name of the indexed plane. | |
| chnumchan | Returns the number of channels in the input specified. | |
| chrate | Returns the sample rate of the input specified. | |
| chstart | Returns the start sample of the input specified. | |
| chstartf | Returns the frame corresponding to the first sample of the input specified. | |
| chstartt | Returns the time corresponding to the first sample of the input specified. | |
| cinput | cinput returns point sampled input. | |
| ckspline | Computes a Catmull-Rom (Cardinal) spline between the key points specified. | |
| clamp | Returns value clamped between min and max. | |
| clip | clip the line segment between p0 and p1. | |
| colormap | Looks up a color from a disk image. | |
| colorname | Returns the default name of the color plane (as it appears in the compositor preferences). | |
| computenormal | In the POP and SOP contexts, sets how/whether to recompute normals. In the shading contexts, computes normals. | |
| concat | Concatenate all the strings specified to form a single string. | |
| cone | ||
| cos | Returns the cosine of the argument. | |
| cosh | Returns the hyperbolic cosine of the argument. | |
| cracktransform | Depending on the value of c, returns the translate (c=0), rotate (c=1), or scale (c=2) component of the transform (xform). | |
| cross | Returns the cross product between the two vectors | |
| cspline | Computes a Catmull-Rom (Cardinal) spline between the key points specified. | |
| ctransform | Transforms between color spaces. | |
| degrees | Returns the argument from radians into degrees | |
| depthmap | The depthmap functions work on an image which was rendered as a z-depth image from mantra. | |
| depthname | Returns the default name of the depth plane (as it appears in the compositor preferences). | |
| determinant | computes the determinant of the matrix | |
| diffuse | Returns the diffuse (Lambertian) illumination given the normalized surface normal. | |
| diffuseBRDF | ||
| dihedral | computes the rotation matrix which rotates the vector a onto the vector b. | |
| dimport | Imports a variable from the displacement shader for the surface. | |
| distance | Returns the distance between the two 3 or 4 dimensional point arguments. | |
| distance2 | Returns the squared distance between the two 3 or 4 dimensional point arguments. | |
| dot | Returns the dot product between the arguments. | |
| dsmpixel | Reads the z-records stored in a pixel of a deep shadow map or deep camera map. | |
| emission_bsdf | Returns the emissive component of a bsdf. | |
| environment | Returns the color of the environment texture. | |
| eval_bsdf | Evaluates a bsdf given two vectors. | |
| exp | Returns the exponential function of the argument. | |
| fastshadow | Sends a ray from the position P along the direction specified by the direction D. | |
| filtershadow | Sends a ray from the position P along direction D. | |
| filterstep | Returns the anti-aliased weight of the step function. | |
| finput | finput returns fully filtered pixel input. | |
| fit | Takes the value in the range (omin, omax) and shifts it to the corresponding value in the new range (nmin, nmax). | |
| floor | Returns the largest integer less than or equal to the argument | |
| fntransform | ||
| foreach | ||
| forpoint | ||
| frac | Returns the fractional component of the floating point number. | |
| fresnel | Computes the fresnel reflection/refraction contributions given an incoming vector, surface normal (both normalized), and an index of refraction (eta). | |
| fromNDC | Transforms a position from normal device coordinates to the coordinates in the appropriate space. | |
| frontface | If dot(I, Nref) is less than zero, N will be negated. | |
| ftransform | ||
| fvtransform | ||
| gather | Sends rays into the scene and returns information from the shaders of surfaces hit by the rays. | |
| getattribute | Copies the value of a geometry attribute into a variable. | |
| getbbox | Sets two vectors to the minimum and maximum corners of the bounding box for the entire geometry. | |
| getblurP | Returns the blurred point position (P) vector at a fractional time within the motion blur exposure. | |
| getbounces | ||
| getbounds | Returns the bounding box of the geometry specified by the filename. | |
| getcomp | Extracts a single component of a vector type, matrix type, or array. | |
| getglobalraylevel | Returns the depth of the ray tree for computing global illumination. | |
| getlightname | Returns the name of the current light when called from within an illuminance loop, or converts an integer light ID into the light’s name. | |
| getlights | Returns an array of light identifiers for the currently shaded surface. | |
| getneighbour | Returns the point index of the neighbour of the point. | |
| getneighbourcount | Returns the number of points that are connected to the specified point. | |
| getneighbours | Returns an array of the point numbers of the neighbours of a point. | |
| getobjectname | Returns the name of the current “object” whose shader is being run. | |
| getphotonlight | Returns the integer ID of the light being used for photon shading. | |
| getraylevel | Returns the depth of the ray tree for the current shading. | |
| getrayweight | Returns an approximation to the contribution of the ray to the final pixel color. | |
| gradient3d | Returns the gradient of a single channel texture image at the position specified by P. | |
| hasplane | Returns 1 if the plane specified by the parameter exists in this COP. | |
| hscript_noise | hscript_noise, hscript_turb, hscript_snoise, and hscript_sturb mimic the Houdini expression functions noise(), snoise(), turb(), and sturb(). | |
| hscript_rand | Produces the exact same results as the Houdini expression function of the same name. | |
| hscript_snoise | ||
| hscript_sturb | ||
| hscript_turb | ||
| hsvtorgb | Convert HSV color space into RGB color space. | |
| iaspect | Returns the aspect ratio of the specified input. | |
| ichname | Returns the channel name of the indexed plane of the given input (e. | |
| ident | computes identity matrices | |
| iend | Returns the last frame of the specified input. | |
| iendtime | Returns the end time of the specified input. | |
| ihasplane | Returns 1 if the specified input has a plane named 'planename'. | |
| illuminance | Loops through all light sources in the scene, calling the light shader for each light source to set the Cl and L global variables. | |
| import | Imports attribute data from the SOP or POP connected to the specified input. | |
| importance_light | Returns an estimate of a light’s contribution to the overall scene lighting. | |
| ingroup | Returns 1 if the particle specified by the point number is in the group specified by the string. | |
| int | if the argument is negative, this returns ceil(x), otherwise it returns floor(x). | |
| integrate3d | This function will “integrate” the 3d image along the line specified by p0 and p1. | |
| integrate3dClip | The integrate3dClip function integrates along the ray described by p0 and p1 where “interesting” things start happening in a given I3D texture. | |
| interpolate | Interpolates a value across the currently shaded micropolygon. | |
| intersect | This function computes the intersection of the specified ray with the geometry. | |
| intersect3d | This function intersects a ray (with it’s origin at p0 and extending to p1), against a 3d texture image. | |
| intersect_lights | Finds the nearest intersection of a ray with any of a list of (area) lights and runs the light shader at the intersection point. | |
| inumplanes | Returns the number of planes in the given input. | |
| invert | inverts the matrix. | |
| iplaneindex | Returns the index of the plane named 'planename' in the specified input. | |
| iplanename | Returns the name of the plane specified by the planeindex of the given input (e. | |
| iplanesize | Returns the number of components in the plane named planename in the specified input. | |
| irate | Returns the frame rate of the specified input. | |
| irradiance | Computes irradiance (global illumination) at the point P with the normal N. | |
| isbound | Parameters in VEX can be overridden by geometry attributes (if the attributes exist on the surface being rendered). | |
| isconnected | Returns 1 if input_number is connected, or 0 if the input is not connected. | |
| isfogray | 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 | Returns 1 if the Vex CHOP’s Unit Menu is currently set to 'frames', 0 otherwise. | |
| isotropic | Returns an isotropic bsdf, which scatters light equally in all directions. | |
| issamples | Returns 1 if the Vex CHOP’s Unit Menu is currently set to 'samples', 0 otherwise. | |
| isseconds | Returns 1 if the Vex CHOP’s Unit Menu is currently set to 'seconds', 0 otherwise. | |
| isshadowray | 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. | |
| istart | Returns the starting frame of the specified input. | |
| istarttime | Returns the start time of the specified input. | |
| ixres | Returns the X resolution of the specified input. | |
| iyres | Returns the Y resolution of the specified input. | |
| kspline | Returns an interpolated value along a spline curve. | |
| length | Returns the length of the vector or vector4. | |
| length2 | Returns the squared distance of the vector or vector4. | |
| lerp | Performs bilinear interpolation between the values. | |
| limport | Imports a variable from the light shader for the surface. | |
| lkspline | Computes a linear spline between the key points. | |
| lntransform | ||
| log | Returns the natural logarithm of the argument | |
| log10 | Returns the logarithm (base 10) of the argument | |
| lookat | computes a rotation matrix to orient the z-axis along the vector (to-from) under the transformation. | |
| lspline | Computes a linear spline between the key points. | |
| ltransform | ||
| luminance | Compute the luminance of the RGB color specified by the parameters | |
| lumname | Returns the default name of the luminence plane (as it appears in the compositor preferences). | |
| lvtransform | ||
| maketransform | Builds a 3×3 or 4×4 transform matrix. | |
| maskname | Returns the default name of the mask plane (as it appears in the compositor preferences). | |
| match | This function returns 1 if the subject matches the pattern specified, or 0 if the subject doesn’t match. | |
| matchvex_blinn | ||
| matchvex_specular | ||
| mattrib | Returns the value of the point attribute for the metaballs if metaball geometry is specified to i3dgen. | |
| max | ||
| mdensity | Returns the density of the metaball field if metaball geometry is specified to i3dgen. | |
| metaimport | Once you get a handle to a metaball using metastart and metanext, you can query attributes of the metaball with metaimport. | |
| metamarch | 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 | ||
| metastart | Open a geometry file and return a “handle” for the metaballs of interest, at the position p. | |
| metaweight | Returns the metaweight of the geometry at position p. | |
| min | ||
| mspace | Transforms the position specified into the “local” space of the metaball. | |
| nbouncetypes | ||
| newgroup | Creates a new group in which to put particles. | |
| newsampler | Returns an initialized sampler sequence for use as the first argument to the nextsample function. | |
| nextsample | ||
| ninput | Reads a pixel and its eight neighbors into a 3×3 matrix. | |
| noise | 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. | |
| normal_bsdf | Returns the normal for the diffuse component of a bsdf. | |
| normalize | Returns the normalized vector | |
| normalname | Returns the default name of the normal plane (as it appears in the compositor preferences). | |
| npoints | ||
| nprimitives | Returns the number of primitives in the geometry file. | |
| nrandom | The nrandom() functions are non-deterministic random number generators for VEX. | |
| ntransform | See ptransform. | |
| occlusion | Computes ambient occlusion. | |
| onoise | These functions are similar to wnoise and vnoise. | |
| ontransform | ||
| optransform | Returns the transform associated with an OP. | |
| otransform | 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 | ||
| ow_nspace | Transforms a normal vector from Object to World space. | |
| ow_space | Transforms a position value from Object to World space. | |
| ow_vspace | Transforms a direction vector from Object to World space. | |
| pathtrace | ||
| pcclose | This function closes the handle associated with a pcopen function. | |
| pcconvex | ||
| pcexport | Writes data to a point cloud inside a pciterate or a pcunshaded loop. | |
| pcfarthest | Returns the distance to the farthest point found in the search performed by pcopen. | |
| pcfilter | Filters the points found by pcopen using a simple reconstruction filter. | |
| pcgenerate | Generates a point cloud. | |
| pcimport | Imports channel data from a point cloud inside a pciterate or a pcunshaded loop. | |
| pciterate | This function can be used to iterate over all the points which were found in the pcopen query. | |
| pcopen | Returns a handle to a point cloud file. | |
| pcopenlod | Returns a handle to a point cloud file. | |
| pcunshaded | Iterate over all of the points of a read-write channel which haven’t had any data written to the channel yet. | |
| pcwrite | Writes data to a point cloud file. | |
| phong | phong, blinn, and specular return the illumination for specular highlights using different lighting models. | |
| phongBRDF | ||
| phonglobe | ||
| photonmap | The photonmap function will evaluate a photon map and return the resulting color information. | |
| planeindex | Returns the index of the plane specified by the parameter, starting at zero. | |
| planename | Returns the name of the plane specified by the index (e. | |
| planesize | Returns the number of components in the plane (1 for scalar planes and up to 4 for vector planes). | |
| pnoise | 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 | Returns the default name of the point plane (as it appears in the compositor preferences). | |
| pop | Removes the last element of an array and returns it. | |
| pow | Raises the first argument to the power of the second argument | |
| prim_attribute | Copies the value of a primitive attribute at a certain parametric (u, v) position into a variable. | |
| prim_normal | Returns the normal of the primitive (prim_number) at parametric location u, v. | |
| printf | Prints values to the console which started the VEX program. | |
| ptlined | This function returns the closest distance between the point Q and a finite line segment between points P0 and P1. | |
| ptransform | Transforms a vector from one space to another. | |
| push | Adds an item to an array. | |
| qconvert | Converts a quaternion represented by a vector4 to a matrix3 representation. | |
| qmultiply | Multiplies two quaternions and returns the result. | |
| quaternion | Creates a vector4 representing a quaternion. | |
| radians | Converts the argument from degrees into radians | |
| random | generate a random number based on the position in N dimensional space (where N is 1 to 4 dimensions). | |
| rawbumpmap | ||
| rawbumpmapA | ||
| rawbumpmapB | ||
| rawbumpmapG | ||
| rawbumpmapL | ||
| rawbumpmapR | ||
| rawcolormap | ||
| rayhittest | Sends a ray from the position P along the direction D. | |
| rayimport | Imports a value sent by a shader in a gather loop. | |
| reflect | Returns the vector representing the reflection of the direction against the normal. | |
| reflectlight | Computes the amount of reflected light which hits the surface. | |
| refract | Returns the refraction ray given an incoming direction, the normalized normal and an index of refraction. | |
| refractlight | Computes the illumination of surfaces refracted by the current surface. | |
| relbbox | Returns the relative position of the point given with respect to the bounding box of the entire geometry. | |
| removegroup | Removes the particle specified by point_number from the group specified. | |
| renderstate | Queries the renderer for a named property. | |
| resize | Sets the length of an array. | |
| resolvemissedray | Returns the background color for rays that exit the scene. | |
| rgbtohsv | Convert RGB color space to HSV color space. | |
| rint | Rounds the number to the closest integer. | |
| rotate | applies a rotation to the given matrix. | |
| sample_bsdf | Samples a bsdf. | |
| sample_geometry | Samples geometry in the scene and returns information from the shaders of surfaces that were sampled. | |
| sample_light | Samples a 3D position on a light source and runs the light shader at that point. | |
| scale | scales the given matrix in three directions simultaneously (X, Y, Z - given by the components of the scale_vector). | |
| serialize | Flattens an array of vector or matrix types into an array of floats. | |
| set | These two functions provide a very efficient way of creating a vector/vector4. | |
| setcomp | Sets a single component of a vector type, matrix type, or array. | |
| shadow | Calls shadow shaders for the current light source. | |
| shadow_light | Executes the shadow shader for a given light and returns the amount of shadowing as a multiplier of the shaded color. | |
| shadowmap | The shadowmap function will treat the shadow map as if the image were rendered from a light source. | |
| shimport | Imports a variable from the shadow shader for the surface. | |
| shl | Bit-shifts an integer left. | |
| shr | Bit-shifts an integer right. | |
| simport | Imports a variable sent by a surface shader in an illuminance loop. | |
| sin | Returns the sine of the argument | |
| sinh | Returns the hyperbolic sine of the argument | |
| sleep | Yields processing for a certain number of milliseconds. | |
| slerp | Quaternion blend between q1 and q2 based on the bias. | |
| smooth | Computes a number between zero and one. | |
| snoise | These functions are similar to wnoise. | |
| specular | phong, blinn, and specular return the illumination for specular highlights using different lighting models. | |
| specularBRDF | specularBRDF, phongBRDF, blinnBRDF, and diffuseBRDF return the computed BRDFs for the different lighting models used in VEX shading. | |
| spline | Returns an interpolated value along a polyline or spline curve. | |
| sprintf | Formats a string like printf but returns the result as a string instead of printing it. | |
| sqrt | Returns the square root of the argument | |
| storelightexports | Stores exported data on a light. | |
| strlen | Returns the length of the string. | |
| swizzle | Rearranges components of a vector. | |
| tan | Returns the trigonometric tangent of the argument | |
| tanh | Returns the hyperbolic tangent of the argument | |
| teximport | Imports attributes from texture files. | |
| texture | Computes a filtered sample of the texture map specified. | |
| texture3d | Returns the value of the 3d image at the position specified by P. | |
| texture3dBox | This function queries the 3D texture map specified and returns the bounding box information of the file. | |
| toNDC | Transforms a position into normal device coordinates. | |
| trace | Sends a ray from P along the normalized vector D. | |
| translate | translates the given matrix | |
| transpose | transposes the given matrix | |
| tw_nspace | Transforms a normal vector from Texture to World space. | |
| tw_space | Transforms a position value from Texture to World space. | |
| tw_vspace | Transforms a direction vector from Texture to World space. | |
| unserialize | Turns a flat array of floats into an array of vectors or matrices. | |
| variadicarguments | ||
| velocityname | Returns the default name of the velocity plane (as it appears in the compositor preferences). | |
| vnoise | Voronoi noise gives almost identical results to the Worley noise functions. | |
| volume | Returns the volume of the microvoxel containing a variable such as P. | |
| volumegradient | Calculates the volume primitive’s gradient. | |
| volumesample | Samples the volume primitive’s value. | |
| vtransform | See ptransform. | |
| wireblinn | ||
| wirediffuse | ||
| wnoise | Worley noise scatters points randomly through space (according to a nice Poisson distribution). | |
| wo_nspace | Transforms a normal vector from World to Object space. | |
| wo_space | Transforms a position value from World to Object space. | |
| wo_vspace | Transforms a direction vector from World to Object space. | |
| wt_nspace | Transforms a normal vector from World to Texture space. | |
| wt_space | Transforms a position value from World to Texture space. | |
| wt_vspace | Transforms a direction vector from World to Texture space. |