Houdini 11 VEX

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


DuTakes the derivative of the given value with respect to U.
DvTakes the derivative of the given value with respect to V.
DwTakes the derivative of the given value with respect to the 3rd axis, for volume rendering.
absReturns the absolute value of the argument.
acosReturns the arc-cosine of the argument.
addattributeAdds or changes a point attribute.
addgroupAdds the particle specified by point_number to the group specified.
addvariablenameAdds the mapping of the attribute aname to the local variable vname.
albedoReturns the albedo (percentage of reflected light) for a bsdf given the outgoing light direction.
alphanameReturns the default name of the alpha plane (as it appears in the compositor preferences).
ambientReturns the color of ambient light in the scene.
anoiseThese functions are similar to the Worley noise functions listed above.
areaReturns the area of the micropolygon containing a variable such as P.
arrayEfficiently creates an array from its arguments.
arraylengthReturns the length of an array.
ashikhmin
asinReturns the arc-sine of the argument.
assignAn efficient way of extracting the components of a vector, vector4, matrix3 or matrix to float variables.
atanReturns the arc-tangent of the argument.
atan2Returns the arc-tangent of y/x.
atofConverts a string to a float.
atoiConverts a string to an integer.
attenComputes attenuated falloff.
avgReturns the average of the vector’s 3 components
binputbinput returns bilinear sampled input.
blinnphong, blinn, and specular return the illumination for specular highlights using different lighting models.
blinnBRDF
bumpmapBump maps will return the color gradient of the image in the du/dv parameters.
bumpmapA
bumpmapB
bumpmapG
bumpmapL
bumpmapR
bumpnameReturns the default name of the bump plane (as it appears in the compositor preferences).
ceilReturns the smallest integer greater than or equal to the argument
chEvaluates a channel (or parameter) and return its value.
chendReturns the end sample of the input specified.
chendfReturns the frame corresponding to the last sample of the input specified.
chendtReturns the time corresponding to the last sample of the input specified.
chinputReturns the value of a channel at the specified sample in an input.
chnameReturns the channel name of the indexed plane.
chnumchanReturns the number of channels in the input specified.
chrateReturns the sample rate of the input specified.
chstartReturns the start sample of the input specified.
chstartfReturns the frame corresponding to the first sample of the input specified.
chstarttReturns the time corresponding to the first sample of the input specified.
cinputcinput returns point sampled input.
cksplineComputes a Catmull-Rom (Cardinal) spline between the key points specified.
clampReturns value clamped between min and max.
clipclip the line segment between p0 and p1.
colormapLooks up a color from a disk image.
colornameReturns the default name of the color plane (as it appears in the compositor preferences).
computenormalIn the POP and SOP contexts, sets how/whether to recompute normals. In the shading contexts, computes normals.
concatConcatenate all the strings specified to form a single string.
cone
cosReturns the cosine of the argument.
coshReturns the hyperbolic cosine of the argument.
cracktransformDepending on the value of c, returns the translate (c=0), rotate (c=1), or scale (c=2) component of the transform (xform).
crossReturns the cross product between the two vectors
csplineComputes a Catmull-Rom (Cardinal) spline between the key points specified.
ctransformTransforms between color spaces.
degreesReturns the argument from radians into degrees
depthmapThe depthmap functions work on an image which was rendered as a z-depth image from mantra.
depthnameReturns the default name of the depth plane (as it appears in the compositor preferences).
determinantcomputes the determinant of the matrix
diffuseReturns the diffuse (Lambertian) illumination given the normalized surface normal.
diffuseBRDF
dihedralcomputes the rotation matrix which rotates the vector a onto the vector b.
dimportImports a variable from the displacement shader for the surface.
distanceReturns the distance between the two 3 or 4 dimensional point arguments.
distance2Returns the squared distance between the two 3 or 4 dimensional point arguments.
dotReturns the dot product between the arguments.
dsmpixelReads the z-records stored in a pixel of a deep shadow map or deep camera map.
emission_bsdfReturns the emissive component of a bsdf.
environmentReturns the color of the environment texture.
eval_bsdfEvaluates a bsdf given two vectors.
expReturns the exponential function of the argument.
fastshadowSends a ray from the position P along the direction specified by the direction D.
filtershadowSends a ray from the position P along direction D.
filterstepReturns the anti-aliased weight of the step function.
finputfinput returns fully filtered pixel input.
fitTakes the value in the range (omin, omax) and shifts it to the corresponding value in the new range (nmin, nmax).
floorReturns the largest integer less than or equal to the argument
fntransform
foreach
forpoint
fracReturns the fractional component of the floating point number.
fresnelComputes the fresnel reflection/refraction contributions given an incoming vector, surface normal (both normalized), and an index of refraction (eta).
fromNDCTransforms a position from normal device coordinates to the coordinates in the appropriate space.
frontfaceIf dot(I, Nref) is less than zero, N will be negated.
ftransform
fvtransform
gatherSends rays into the scene and returns information from the shaders of surfaces hit by the rays.
getattributeCopies the value of a geometry attribute into a variable.
getbboxSets two vectors to the minimum and maximum corners of the bounding box for the entire geometry.
getblurPReturns the blurred point position (P) vector at a fractional time within the motion blur exposure.
getbounces
getboundsReturns the bounding box of the geometry specified by the filename.
getcompExtracts a single component of a vector type, matrix type, or array.
getglobalraylevelReturns the depth of the ray tree for computing global illumination.
getlightnameReturns the name of the current light when called from within an illuminance loop, or converts an integer light ID into the light’s name.
getlightsReturns an array of light identifiers for the currently shaded surface.
getneighbourReturns the point index of the neighbour of the point.
getneighbourcountReturns the number of points that are connected to the specified point.
getneighboursReturns an array of the point numbers of the neighbours of a point.
getobjectnameReturns the name of the current “object” whose shader is being run.
getphotonlightReturns the integer ID of the light being used for photon shading.
getraylevelReturns the depth of the ray tree for the current shading.
getrayweightReturns an approximation to the contribution of the ray to the final pixel color.
gradient3dReturns the gradient of a single channel texture image at the position specified by P.
hasplaneReturns 1 if the plane specified by the parameter exists in this COP.
hscript_noisehscript_noise, hscript_turb, hscript_snoise, and hscript_sturb mimic the Houdini expression functions noise(), snoise(), turb(), and sturb().
hscript_randProduces the exact same results as the Houdini expression function of the same name.
hscript_snoise
hscript_sturb
hscript_turb
hsvtorgbConvert HSV color space into RGB color space.
iaspectReturns the aspect ratio of the specified input.
ichnameReturns the channel name of the indexed plane of the given input (e.
identcomputes identity matrices
iendReturns the last frame of the specified input.
iendtimeReturns the end time of the specified input.
ihasplaneReturns 1 if the specified input has a plane named 'planename'.
illuminanceLoops through all light sources in the scene, calling the light shader for each light source to set the Cl and L global variables.
importImports attribute data from the SOP or POP connected to the specified input.
importance_lightReturns an estimate of a light’s contribution to the overall scene lighting.
ingroupReturns 1 if the particle specified by the point number is in the group specified by the string.
intif the argument is negative, this returns ceil(x), otherwise it returns floor(x).
integrate3dThis function will “integrate” the 3d image along the line specified by p0 and p1.
integrate3dClipThe integrate3dClip function integrates along the ray described by p0 and p1 where “interesting” things start happening in a given I3D texture.
interpolateInterpolates a value across the currently shaded micropolygon.
intersectThis function computes the intersection of the specified ray with the geometry.
intersect3dThis function intersects a ray (with it’s origin at p0 and extending to p1), against a 3d texture image.
intersect_lightsFinds the nearest intersection of a ray with any of a list of (area) lights and runs the light shader at the intersection point.
inumplanesReturns the number of planes in the given input.
invertinverts the matrix.
iplaneindexReturns the index of the plane named 'planename' in the specified input.
iplanenameReturns the name of the plane specified by the planeindex of the given input (e.
iplanesizeReturns the number of components in the plane named planename in the specified input.
irateReturns the frame rate of the specified input.
irradianceComputes irradiance (global illumination) at the point P with the normal N.
isboundParameters in VEX can be overridden by geometry attributes (if the attributes exist on the surface being rendered).
isconnectedReturns 1 if input_number is connected, or 0 if the input is not connected.
isfograyReturns 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.
isframesReturns 1 if the Vex CHOP’s Unit Menu is currently set to 'frames', 0 otherwise.
isotropicReturns an isotropic bsdf, which scatters light equally in all directions.
issamplesReturns 1 if the Vex CHOP’s Unit Menu is currently set to 'samples', 0 otherwise.
issecondsReturns 1 if the Vex CHOP’s Unit Menu is currently set to 'seconds', 0 otherwise.
isshadowrayReturns 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.
istartReturns the starting frame of the specified input.
istarttimeReturns the start time of the specified input.
ixresReturns the X resolution of the specified input.
iyresReturns the Y resolution of the specified input.
ksplineReturns an interpolated value along a spline curve.
lengthReturns the length of the vector or vector4.
length2Returns the squared distance of the vector or vector4.
lerpPerforms bilinear interpolation between the values.
limportImports a variable from the light shader for the surface.
lksplineComputes a linear spline between the key points.
lntransform
logReturns the natural logarithm of the argument
log10Returns the logarithm (base 10) of the argument
lookatcomputes a rotation matrix to orient the z-axis along the vector (to-from) under the transformation.
lsplineComputes a linear spline between the key points.
ltransform
luminanceCompute the luminance of the RGB color specified by the parameters
lumnameReturns the default name of the luminence plane (as it appears in the compositor preferences).
lvtransform
maketransformBuilds a 3×3 or 4×4 transform matrix.
masknameReturns the default name of the mask plane (as it appears in the compositor preferences).
matchThis function returns 1 if the subject matches the pattern specified, or 0 if the subject doesn’t match.
matchvex_blinn
matchvex_specular
mattribReturns the value of the point attribute for the metaballs if metaball geometry is specified to i3dgen.
max
mdensityReturns the density of the metaball field if metaball geometry is specified to i3dgen.
metaimportOnce you get a handle to a metaball using metastart and metanext, you can query attributes of the metaball with metaimport.
metamarchTakes 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
metastartOpen a geometry file and return a “handle” for the metaballs of interest, at the position p.
metaweightReturns the metaweight of the geometry at position p.
min
mspaceTransforms the position specified into the “local” space of the metaball.
nbouncetypes
newgroupCreates a new group in which to put particles.
newsamplerReturns an initialized sampler sequence for use as the first argument to the nextsample function.
nextsample
ninputReads a pixel and its eight neighbors into a 3×3 matrix.
noiseThere 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_bsdfReturns the normal for the diffuse component of a bsdf.
normalizeReturns the normalized vector
normalnameReturns the default name of the normal plane (as it appears in the compositor preferences).
npoints
nprimitivesReturns the number of primitives in the geometry file.
nrandomThe nrandom() functions are non-deterministic random number generators for VEX.
ntransformSee ptransform.
occlusionComputes ambient occlusion.
onoiseThese functions are similar to wnoise and vnoise.
ontransform
optransformReturns the transform associated with an OP.
otransformotransform, 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_nspaceTransforms a normal vector from Object to World space.
ow_spaceTransforms a position value from Object to World space.
ow_vspaceTransforms a direction vector from Object to World space.
pathtrace
pccloseThis function closes the handle associated with a pcopen function.
pcconvex
pcexportWrites data to a point cloud inside a pciterate or a pcunshaded loop.
pcfarthestReturns the distance to the farthest point found in the search performed by pcopen.
pcfilterFilters the points found by pcopen using a simple reconstruction filter.
pcgenerateGenerates a point cloud.
pcimportImports channel data from a point cloud inside a pciterate or a pcunshaded loop.
pciterateThis function can be used to iterate over all the points which were found in the pcopen query.
pcopenReturns a handle to a point cloud file.
pcopenlodReturns a handle to a point cloud file.
pcunshadedIterate over all of the points of a read-write channel which haven’t had any data written to the channel yet.
pcwriteWrites data to a point cloud file.
phongphong, blinn, and specular return the illumination for specular highlights using different lighting models.
phongBRDF
phonglobe
photonmapThe photonmap function will evaluate a photon map and return the resulting color information.
planeindexReturns the index of the plane specified by the parameter, starting at zero.
planenameReturns the name of the plane specified by the index (e.
planesizeReturns the number of components in the plane (1 for scalar planes and up to 4 for vector planes).
pnoiseThere 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.
pointnameReturns the default name of the point plane (as it appears in the compositor preferences).
popRemoves the last element of an array and returns it.
powRaises the first argument to the power of the second argument
prim_attributeCopies the value of a primitive attribute at a certain parametric (u, v) position into a variable.
prim_normalReturns the normal of the primitive (prim_number) at parametric location u, v.
printfPrints values to the console which started the VEX program.
ptlinedThis function returns the closest distance between the point Q and a finite line segment between points P0 and P1.
ptransformTransforms a vector from one space to another.
pushAdds an item to an array.
qconvertConverts a quaternion represented by a vector4 to a matrix3 representation.
qmultiplyMultiplies two quaternions and returns the result.
quaternionCreates a vector4 representing a quaternion.
radiansConverts the argument from degrees into radians
randomgenerate 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
rayhittestSends a ray from the position P along the direction D.
rayimportImports a value sent by a shader in a gather loop.
reflectReturns the vector representing the reflection of the direction against the normal.
reflectlightComputes the amount of reflected light which hits the surface.
refractReturns the refraction ray given an incoming direction, the normalized normal and an index of refraction.
refractlightComputes the illumination of surfaces refracted by the current surface.
relbboxReturns the relative position of the point given with respect to the bounding box of the entire geometry.
removegroupRemoves the particle specified by point_number from the group specified.
renderstateQueries the renderer for a named property.
resizeSets the length of an array.
resolvemissedrayReturns the background color for rays that exit the scene.
rgbtohsvConvert RGB color space to HSV color space.
rintRounds the number to the closest integer.
rotateapplies a rotation to the given matrix.
sample_bsdfSamples a bsdf.
sample_geometrySamples geometry in the scene and returns information from the shaders of surfaces that were sampled.
sample_lightSamples a 3D position on a light source and runs the light shader at that point.
scalescales the given matrix in three directions simultaneously (X, Y, Z - given by the components of the scale_vector).
serializeFlattens an array of vector or matrix types into an array of floats.
setThese two functions provide a very efficient way of creating a vector/vector4.
setcompSets a single component of a vector type, matrix type, or array.
shadowCalls shadow shaders for the current light source.
shadow_lightExecutes the shadow shader for a given light and returns the amount of shadowing as a multiplier of the shaded color.
shadowmapThe shadowmap function will treat the shadow map as if the image were rendered from a light source.
shimportImports a variable from the shadow shader for the surface.
shlBit-shifts an integer left.
shrBit-shifts an integer right.
simportImports a variable sent by a surface shader in an illuminance loop.
sinReturns the sine of the argument
sinhReturns the hyperbolic sine of the argument
sleepYields processing for a certain number of milliseconds.
slerpQuaternion blend between q1 and q2 based on the bias.
smoothComputes a number between zero and one.
snoiseThese functions are similar to wnoise.
specularphong, blinn, and specular return the illumination for specular highlights using different lighting models.
specularBRDFspecularBRDF, phongBRDF, blinnBRDF, and diffuseBRDF return the computed BRDFs for the different lighting models used in VEX shading.
splineReturns an interpolated value along a polyline or spline curve.
sprintfFormats a string like printf but returns the result as a string instead of printing it.
sqrtReturns the square root of the argument
storelightexportsStores exported data on a light.
strlenReturns the length of the string.
swizzleRearranges components of a vector.
tanReturns the trigonometric tangent of the argument
tanhReturns the hyperbolic tangent of the argument
teximportImports attributes from texture files.
textureComputes a filtered sample of the texture map specified.
texture3dReturns the value of the 3d image at the position specified by P.
texture3dBoxThis function queries the 3D texture map specified and returns the bounding box information of the file.
toNDCTransforms a position into normal device coordinates.
traceSends a ray from P along the normalized vector D.
translatetranslates the given matrix
transposetransposes the given matrix
tw_nspaceTransforms a normal vector from Texture to World space.
tw_spaceTransforms a position value from Texture to World space.
tw_vspaceTransforms a direction vector from Texture to World space.
unserializeTurns a flat array of floats into an array of vectors or matrices.
variadicarguments
velocitynameReturns the default name of the velocity plane (as it appears in the compositor preferences).
vnoiseVoronoi noise gives almost identical results to the Worley noise functions.
volumeReturns the volume of the microvoxel containing a variable such as P.
volumegradientCalculates the volume primitive’s gradient.
volumesampleSamples the volume primitive’s value.
vtransformSee ptransform.
wireblinn
wirediffuse
wnoiseWorley noise scatters points randomly through space (according to a nice Poisson distribution).
wo_nspaceTransforms a normal vector from World to Object space.
wo_spaceTransforms a position value from World to Object space.
wo_vspaceTransforms a direction vector from World to Object space.
wt_nspaceTransforms a normal vector from World to Texture space.
wt_spaceTransforms a position value from World to Texture space.
wt_vspaceTransforms a direction vector from World to Texture space.