Houdini 20.5 VEX VEX contexts

light VEX context

Define a light shader with a program called from surface or fog shaders to calculate the illumination of a surface.

On this page

Note

Unless you want to implement your own non-realistic lighting model, you do not need to write your own light shader.

In non-PBR rendering, light shaders are called from surface or fog shaders to compute the illumination from a light source. The light shader would be invoked in an illuminance loop or using the standard diffuse(), specular(), etc. functions.

Globals

vector P Read only

Position of the point on the surface being shaded. In light or shadow shaders, the P variable contains the point on the light source.

vector I Read only

Direction from the eye to the point being shaded. This may or may not be a normalized vector.

vector dPds Read only

Change in position with respect to the parametric s.

vector dPdt Read only

Change in position with respect to the parametric t.

vector N Read only

Shading normal for the surface.

vector Ng Read only

Geometric normal for the surface. This normal represents the “true” normal of the surface being shaded. For example, with Phong shading, the N variable represents the interpolated normal, while the Ng variable represents the true polygon normal.

vector Cl

Light color.

vector L

Vector from the point on the surface to the light source. The length of this vector represents the distance to the light source.

vector Ps Read only

Position of the point on the surface being illuminated.

vector Eye Read only

Position of the eye.

float s Read only

Parametric s (sometimes called u) coordinate of the surface being shaded.

float t Read only

Parametric t (sometimes called v) coordinate of the surface being shaded.

float Time Read only

The time at which the shading occurs, as a number from 0 (shutter open) to 1 (shutter close).

float dPdz Read only

Floating point step size for volume rendering.

vector Lz Read only

Z-axis in the space of the light. This is a unit vector.

int SID Read only

Sample identifier for the current shading sample.

Functions

  • Du

    Returns the derivative of the given value with respect to U.

  • Dv

    Returns the derivative of the given value with respect to V.

  • Dw

    Returns the derivative of the given value with respect to the 3rd axis (for volume rendering).

  • __uniform_mul

    Multiply matrices.

  • __uniform_premul

    Pre multiply matrices.

  • abs

    Returns the absolute value of the argument.

  • abspath

    Returns the full path of a file.

  • acos

    Returns the inverse cosine of the argument.

  • addattrib

    Adds an attribute to a geometry.

  • adddetailattrib

    Adds a detail attribute to a geometry.

  • addpoint

    Adds a point to the geometry.

  • addpointattrib

    Adds a point attribute to a geometry.

  • addprim

    Adds a primitive to the geometry.

  • addprimattrib

    Adds a primitive attribute to a geometry.

  • addvariablename

    Adds a mapping for an attribute to a local variable.

  • addvertex

    Adds a vertex to a primitive in a geometry.

  • addvertexattrib

    Adds a vertex attribute to a geometry.

  • addvisualizer

    Appends to a geometry’s visualizer detail attribute.

  • agentaddclip

    Add a clip into an agent’s definition.

  • agentchannelcount

    Returns the number of channels in an agent primitive’s rig.

  • agentchannelnames

    Returns the names of the channels in an agent primitive’s rig.

  • agentchannelvalue

    Returns the current value of an agent primitive’s channel.

  • agentchannelvalues

    Returns the current values of an agent primitive’s channels.

  • agentclipcatalog

    Returns all of the animation clips that have been loaded for an agent primitive.

  • agentclipchannel

    Finds the index of a channel in an agent’s animation clip.

  • agentclipchannelnames

    Returns the names of the channels in an agent’s animation clip.

  • agentcliplayerblend

    Blends values according to an agent’s animation layers.

  • agentcliplength

    Returns the length (in seconds) of an agent’s animation clip.

  • agentclipnames

    Returns an agent primitive’s current animation clips.

  • agentclipsample

    Samples a channel of an agent’s clip at a specific time.

  • agentclipsamplelocal

    Samples an agent’s animation clip at a specific time.

  • agentclipsamplerate

    Returns the sample rate of an agent’s animation clip.

  • agentclipsampleworld

    Samples an agent’s animation clip at a specific time.

  • agentclipstarttime

    Returns the start time (in seconds) of an agent’s animation clip.

  • agentcliptimes

    Returns the current times for an agent primitive’s animation clips.

  • agentcliptransformgroups

    Returns the transform groups for an agent primitive’s current animation clips.

  • agentclipweights

    Returns the blend weights for an agent primitive’s animation clips.

  • agentcollisionlayer

    Returns the name of the collision layer of an agent primitive.

  • agentcollisionlayers

    Returns the names of an agent primitive’s collision layers.

  • agentcurrentlayer

    Returns the name of the current layer of an agent primitive.

  • agentcurrentlayers

    Returns the names of an agent primitive’s current layers.

  • agentfindclip

    Finds the index of a clip in an agent’s definition.

  • agentfindlayer

    Finds the index of a layer in an agent’s definition.

  • agentfindtransformgroup

    Finds the index of a transform group in an agent’s definition.

  • agentlayerbindings

    Returns the transform that each shape in an agent’s layer is bound to.

  • agentlayers

    Returns all of the layers that have been loaded for an agent primitive.

  • agentlayershapes

    Returns the names of the shapes referenced by an agent primitive’s layer.

  • agentlocaltransform

    Returns the current local space transform of an agent primitive’s bone.

  • agentlocaltransforms

    Returns the current local space transforms of an agent primitive.

  • agentmetadata

    Returns the agent definition’s metadata dictionary.

  • agentrestlocaltransform

    Returns the local space rest transform for an agent primitive’s joint.

  • agentrestworldtransform

    Returns the world space rest transform for an agent primitive’s joint.

  • agentrigchildren

    Returns the child transforms of a transform in an agent primitive’s rig.

  • agentrigfind

    Finds the index of a transform in an agent primitive’s rig.

  • agentrigfindchannel

    Finds the index of a channel in an agent primitive’s rig.

  • agentrigparent

    Returns the parent transform of a transform in an agent primitive’s rig.

  • agentsolvefbik

    Applies a full-body inverse kinematics algorithm to an agent’s skeleton.

  • agenttransformcount

    Returns the number of transforms in an agent primitive’s rig.

  • agenttransformgroupmember

    Returns whether a transform is a member of the specified transform group.

  • agenttransformgroupmemberchannel

    Returns whether a channel is a member of the specified transform group.

  • agenttransformgroups

    Returns the names of the transform groups in an agent’s definition.

  • agenttransformgroupweight

    Returns the weight of a member of the specified transform group.

  • agenttransformnames

    Returns the name of each transform in an agent primitive’s rig.

  • agenttransformtolocal

    Converts transforms from world space to local space for an agent primitive.

  • agenttransformtoworld

    Converts transforms from local space to world space for an agent primitive.

  • agentworldtransform

    Returns the current world space transform of an agent primitive’s bone.

  • agentworldtransforms

    Returns the current world space transforms of an agent primitive.

  • albedo

    Returns the albedo (percentage of reflected light) for a bsdf given the outgoing light direction.

  • anoise

    Generates alligator noise.

  • append

    Adds an item to an array or string.

  • area

    Returns the area of the micropolygon containing a variable such as P.

  • argsort

    Returns the indices of a sorted version of an array.

  • array

    Efficiently creates an array from its arguments.

  • ashikhmin

    Returns a specular BSDF using the Ashikhmin shading model.

  • asin

    Returns the inverse sine of the argument.

  • assert_enabled

    Returns 1 if the VEX assertions are enabled (see HOUDINI_VEX_ASSERT) or 0 if assertions are disabled. Used the implement the assert macro.

  • assign

    An efficient way of extracting the components of a vector or matrix into float variables.

  • atan

    Returns the inverse tangent of the argument.

  • atan2

    Returns the inverse tangent of y/x.

  • atof

    Converts a string to a float.

  • atoi

    Converts a string to an integer.

  • atten

    Computes attenuated falloff.

  • attrib

    Reads the value of an attribute from geometry.

  • attribclass

    Returns the class of a geometry attribute.

  • attribdataid

    Returns the data id of a geometry attribute.

  • attribsize

    Returns the size of a geometry attribute.

  • attribtype

    Returns the type of a geometry attribute.

  • attribtypeinfo

    Returns the transformation metadata of a geometry attribute.

  • avg

    Returns the average value of the input(s)

  • blackbody

    Compute the color value of an incandescent black body.

  • blinn

    Returns a Blinn BSDF or computes Blinn shading.

  • blinnBRDF

  • bouncelabel

  • bouncemask

  • cbrt

    Returns the cube root of the argument.

  • ceil

    Returns the smallest integer greater than or equal to the argument.

  • ch

    Evaluates a channel (or parameter) and return its value.

  • ch2

    Evaluates a channel (or parameter) and return its value.

  • ch3

    Evaluates a channel (or parameter) and return its value.

  • ch4

    Evaluates a channel (or parameter) and return its value.

  • chdict

    Evaluates a key-value dictionary parameter and return its value.

  • chexpr

    Evaluates a channel with a new segment expression.

  • chexprf

    Evaluates a channel with a new segment expression at a given frame.

  • chexprt

    Evaluates a channel with a new segment expression at a given time.

  • chf

    Evaluates a channel (or parameter) and return its value.

  • chi

    Evaluates a channel (or parameter) and return its value.

  • chiang

    Returns a chiang BSDF.

  • chiang_fur

    Returns a chiang_fur BSDF.

  • chid

    Resolves a channel string (or parameter) and return op_id, parm_index and vector_index.

  • chop

    Returns the value of a CHOP channel at the specified sample.

  • choplocal

    Returns the value of a CHOP local transform channel at the specified sample.

  • choplocalt

    Returns the value of a CHOP local transform channel at the specified sample and evaluation time.

  • chopt

    Returns the value of a CHOP channel at the specified sample and evaluation time.

  • chp

    Evaluates a channel (or parameter) and return its value.

  • chprim_clear

    Clears a channel primitive, removing all keys.

  • chprim_destroykey

    Destroy an existing key from a channel primitive.

  • chprim_end

    Get the end time of a channel primitive.

  • chprim_eval

    Evaluate a channel primitive at the given time.

  • chprim_insertkey

    Insert a key into a channel primitive.

  • chprim_keycount

    Get the number of keys in a channel primitive.

  • chprim_keytimes

    Get the key times of a channel primitive.

  • chprim_keyvalues

    Get the key values of a channel primitive.

  • chprim_length

    Get the length of a channel primitive.

  • chprim_setkeyaccel

    Set the acceleration of a channel primitive key.

  • chprim_setkeyslope

    Set the slope of a channel primitive key.

  • chprim_setkeyvalue

    Set the value of a channel primitive key.

  • chprim_start

    Get the start time of a channel primitive.

  • chr

    Converts an unicode codepoint to a UTF8 string.

  • chramp

    Evaluates a ramp parameter and return its value.

  • chrampderiv

    Evaluates the derivative of a parm parameter with respect to position.

  • chs

    Evaluates a channel (or parameter) and return its value.

  • chsop

    Evaluates an operator path parameter and return the path to the operator.

  • chsraw

    Returns the raw string channel (or parameter).

  • chu

    Evaluates a channel or parameter, and return its value.

  • chv

    Evaluates a channel or parameter, and return its value.

  • ckspline

    Samples a Catmull-Rom (Cardinal) spline defined by position/value keys.

  • clamp

    Returns value clamped between min and max.

  • clip

    Clip the line segment between p0 and p1.

  • colormap

    Looks up a (filtered) color from a texture file.

  • combinelocaltransform

    Combines Local and Parent Transforms with Scale Inheritance.

  • computenormal

    In shading contexts, computes a normal. In the SOP contexts, sets how/whether to recompute normals.

  • concat

    Concatenate all the strings specified to form a single string.

  • cone

    Returns a cone reflection BSDF.

  • cos

    Returns the cosine of the argument.

  • cosh

    Returns the hyperbolic cosine of the argument.

  • cospi

    Returns the cosine of the argument scaled by Pi.

  • cracktransform

    Depending on the value of c, returns the translate (c=0), rotate (c=1), scale (c=2), or shears (c=3) component of the transform (xform).

  • create_cdf

    Creates a cumulative distribution function (CDF) from an array of probability density function (PDF) values.

  • create_pdf

    Creates a probability density function from an array of input values.

  • cregioncapturetransform

    Returns the capture transform associated with a Capture Region SOP.

  • cregiondeformtransform

    Returns the deform transform associated with a Capture Region SOP.

  • cregionoverridetransform

    Returns the capture or deform transform associated with a Capture Region SOP based on the global capture override flag.

  • cross

    Returns the cross product between the two vectors.

  • cspline

    Samples a Catmull-Rom (Cardinal) spline defined by uniformly spaced keys.

  • ctransform

    Transforms between color spaces.

  • curlgxnoise

    Computes divergence free noise based on simplex noise.

  • curlgxnoise2d

    Computes divergence free noise in the plane based on simplex noise.

  • curlnoise

    Computes divergence free noise based on Perlin noise.

  • curlnoise2d

    Computes 2d divergence free noise based on Perlin noise.

  • curlxnoise

    Computes divergence free noise based on Simplex noise.

  • curlxnoise2d

    Computes 2d divergence free noise based on simplex noise.

  • curvearclen

    Evaluates the length of an arc on a primitive defined by an array of points using parametric uv coordinates.

  • cvex_bsdf

    Creates a bsdf object from two CVEX shader strings.

  • cwnoise

    Generates Worley (cellular) noise using a Chebyshev distance metric.

  • decode

    Decodes a variable name that was previously encoded.

  • decodeattrib

    Decodes a geometry attribute name that was previously encoded.

  • decodeparm

    Decodes a node parameter name that was previously encoded.

  • decodeutf8

    Decodes a UTF8 string into a series of codepoints.

  • degrees

    Converts the argument from radians into degrees.

  • depthmap

    The depthmap functions work on an image which was rendered as a z-depth image from mantra.

  • detail

    Reads the value of a detail attribute value from a geometry.

  • detailattrib

    Reads a detail attribute value from a geometry.

  • detailattribsize

    Returns the size of a geometry detail attribute.

  • detailattribtype

    Returns the type of a geometry detail attribute.

  • detailattribtypeinfo

    Returns the type info of a geometry attribute.

  • detailintrinsic

    Reads the value of a detail intrinsic from a geometry.

  • determinant

    Computes the determinant of the matrix.

  • diag

    Extracts diagonal entries or constructs a diagonal matrix.

  • diagonalizesymmetric

    Diagonalizes Symmetric Matrices.

  • diffuse

    Returns a diffuse BSDF or computes diffuse shading.

  • diffuseBRDF

  • dihedral

    Computes the rotation matrix or quaternion which rotates the vector a onto the vector b.

  • dimport

    Reads a variable from the displacement shader for the surface.

  • distance

    Returns the distance between two points.

  • distance2

    Returns the squared distance between the two points.

  • distance_pointline

    This function returns the closest distance between the point Q and the infinite line going through O parallel to vector D.

  • distance_pointray

    This function returns the closest distance between the point Q and the semi-finite ray starting at O and extending in the direction D.

  • distance_pointsegment

    This function returns the closest distance between the point Q and a finite line segment between points P0 and P1.

  • 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.

  • efit

    Takes the value in one range and shifts it to the corresponding value in a new range.

  • eigenvalues

    Computes the eigenvalues of a 3×3 matrix.

  • encode

    Encodes any string into a valid variable name.

  • encodeattrib

    Encodes any string into a valid geometry attribute name.

  • encodeparm

    Encodes any string into a valid node parameter name.

  • encodeutf8

    Encodes a UTF8 string from a series of codepoints.

  • endswith

    Indicates the string ends with the specified string.

  • environment

    Returns the color of the environment texture.

  • erf

    Gauss error function.

  • erf_inv

    Inverse Gauss error function.

  • erfc

    Gauss error function’s complement.

  • error

    Reports a custom runtime VEX error.

  • eulertoquaternion

    Creates a vector4 representing a quaternion from euler angles.

  • eval_bsdf

    Evaluates a bsdf given two vectors.

  • exp

    Returns the exponential function of the argument.

  • expand_udim

    Perform UDIM or UVTILE texture filename expansion.

  • expandedgegroup

  • expandpointgroup

    Returns an array of point numbers corresponding to a group string.

  • expandprimgroup

    Returns an array of prim numbers corresponding to a group string.

  • expandvertexgroup

    Returns an array of linear vertex numbers corresponding to a group string.

  • extractlocaltransform

    Extracts Local Transform from a World Transform with Scale Inheritance.

  • fastshadow

    Sends a ray from the position P along the direction specified by the direction D.

  • filamentsample

    Samples the velocity field defined by a set of vortex filaments.

  • file_stat

    Returns file system status for a given file.

  • filter_remap

    Computes an importance sample based on the given filter type and input uv.

  • filtershadow

    Sends a ray from the position P along direction D.

  • filterstep

    Returns the anti-aliased weight of the step function.

  • find

    Finds an item in an array or string.

  • findattribval

    Finds a primitive/point/vertex that has a certain attribute value.

  • findattribvalcount

    Returns number of elements where an integer or string attribute has a certain value.

  • findlowerbound

    Finds the largest item smaller than a target value in an array.

  • findlowerboundsorted

    Finds the largest item smaller than a target value in a sorted array.

  • findsorted

    Finds an item in a sorted array.

  • fit

    Takes the value in one range and shifts it to the corresponding value in a new range.

  • fit01

    Takes the value in the range (0, 1) and shifts it to the corresponding value in a new range.

  • fit10

    Takes the value in the range (1, 0) and shifts it to the corresponding value in a new range.

  • fit11

    Takes the value in the range (-1, 1) and shifts it to the corresponding value in a new range.

  • floor

    Returns the largest integer less than or equal to the argument.

  • flownoise

    Generates 1D and 3D Perlin Flow Noise from 3D and 4D data.

  • flowpnoise

    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.

  • 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.

  • fuzzify

  • fuzzy_and

  • fuzzy_defuzz_centroid

  • fuzzy_nand

  • fuzzy_nor

  • fuzzy_not

  • fuzzy_nxor

  • fuzzy_or

  • fuzzy_xor

  • geoself

    Returns a handle to the current geometry.

  • geounwrap

    Returns an oppath: string to unwrap the geometry in-place.

  • getattrib

    Reads an attribute value from geometry, with validity check.

  • getattribute

    Copies the value of a geometry attribute into a variable and returns a success flag.

  • getbbox

    Sets two vectors to the minimum and maximum corners of the bounding box for the geometry.

  • getbbox_center

    Returns the center of the bounding box for the geometry.

  • getbbox_max

    Returns the maximum of the bounding box for the geometry.

  • getbbox_min

    Returns the minimum of the bounding box for the geometry.

  • getbbox_size

    Returns the size of the bounding box for the 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.

  • getcomponents

  • getderiv

    Evaluates surface derivatives of an attribute.

  • getglobalraylevel

    Returns the depth of the ray tree for computing global illumination.

  • getlight

    Returns a light struct for the specified light identifier.

  • getlights

    Returns an array of light identifiers for the currently shaded surface.

  • getlightscope

    Returns a selection of lights that illuminate a given material.

  • getmaterial

    Returns a material struct for the current surface.

  • getobjectid

    Returns the object id for the current shading context.

  • getpackedtransform

    Gets the transform of a packed primitive.

  • getphotonlight

    Returns the integer ID of the light being used for photon shading.

  • getpointbbox

    Sets two vectors to the minimum and maximum corners of the bounding box for the geometry.

  • getpointbbox_center

    Returns the center of the bounding box for the geometry.

  • getpointbbox_max

    Returns the maximum of the bounding box for the geometry.

  • getpointbbox_min

    Returns the minimum of the bounding box for the geometry.

  • getpointbbox_size

    Returns the size of the bounding box for the geometry.

  • getscope

    Returns a selection of objects visible to rays for a given material.

  • getspace

    Returns a transform from one space to another.

  • getuvtangents

    Evaluates UV tangents at a point on an arbitrary object.

  • ggx

    Returns a ggx BSDF.

  • gradient

    Returns the gradient of a field.

  • gxnoise

    Evaluates a simplex noise field.

  • gxnoised

    Evaluates a simplex noise field and its derivatives.

  • hair

    Returns a BSDF for shading hair.

  • has_udim

    Test string for UDIM or UVTILE patterns.

  • hasattrib

    Checks whether a geometry attribute exists.

  • hasdetailattrib

    Returns if a geometry detail attribute exists.

  • haslight

    Returns whether a light illuminates the given material.

  • haspointattrib

    Returns if a geometry point attribute exists.

  • hasprimattrib

    Returns if a geometry prim attribute exists.

  • hasvertexattrib

    Returns if a geometry vertex attribute exists.

  • hedge_dstpoint

    Returns the destination point of a half-edge.

  • hedge_dstvertex

    Returns the destination vertex of a half-edge.

  • hedge_equivcount

    Returns the number of half-edges equivalent to a given half-edge.

  • hedge_isequiv

    Determines whether a two half-edges are equivalent (represent the same edge).

  • hedge_isprimary

    Determines whether a half-edge number corresponds to a primary half-edge.

  • hedge_isvalid

    Determines whether a half-edge number corresponds to a valid half-edge.

  • hedge_next

    Returns the half-edge that follows a given half-edge in its polygon.

  • hedge_nextequiv

    Returns the next half-edges equivalent to a given half-edge.

  • hedge_postdstpoint

    Returns the point into which the vertex following the destination vertex of a half-edge in its primitive is wired.

  • hedge_postdstvertex

    Returns the vertex following the destination vertex of a half-edge in its primitive.

  • hedge_presrcpoint

    Returns the point into which the vertex that precedes the source vertex of a half-edge in its primitive is wired.

  • hedge_presrcvertex

    Returns the vertex that precedes the source vertex of a half-edge in its primitive.

  • hedge_prev

    Returns the half-edge that precedes a given half-edge in its polygon.

  • hedge_prim

    Returns the primitive that contains a half-edge.

  • hedge_primary

    Returns the primary half-edge equivalent to a given half-edge.

  • hedge_srcpoint

    Returns the source point of a half-edge.

  • hedge_srcvertex

    Returns the source vertex of a half-edge.

  • henyeygreenstein

    Returns an anisotropic volumetric BSDF, which can scatter light forward or backward.

  • hex_adjacent

    Returns primitive number of an adjacent hexahedron.

  • hex_faceindex

    Returns vertex indices of each face of a hexahedron.

  • hscript_noise

    Generates noise matching the output of the Hscript noise() expression function.

  • hscript_rand

    Produces the exact same results as the Houdini expression function of the same name.

  • hscript_snoise

  • hscript_sturb

  • hscript_turb

    Generates turbulence matching the output of the HScript turb() expression function.

  • hsvtorgb

    Convert HSV color space into RGB color space.

  • ident

    Returns an identity matrix.

  • idtopoint

    Finds a point by its id attribute.

  • idtoprim

    Finds a primitive by its id attribute.

  • importance_remap

    Remaps a texture coordinate to another coordinate in the map to optimize sampling of brighter areas.

  • inedgegroup

    Returns 1 if the edge specified by the point pair is in the group specified by the string.

  • inpointgroup

    Returns 1 if the point specified by the point number is in the group specified by the string.

  • inprimgroup

    Returns 1 if the primitive specified by the primitive number is in the group specified by the string.

  • insert

    Inserts an item, array, or string into an array or string.

  • instance

    Creates an instance transform matrix.

  • integratehoseksky

    Computes irradiance from the given Hosek Sky on a horizontal surface

  • interpolate

    Interpolates a value across the currently shaded micropolygon.

  • intersect

    This function computes the first intersection of a ray with geometry.

  • intersect_all

    Computes all intersections of the specified ray with geometry.

  • invert

    Inverts a matrix.

  • invertexgroup

    Returns 1 if the vertex specified by the vertex number is in the group specified by the string.

  • invlerp

    Inverses a linear interpolation between the values.

  • isalpha

    Returns 1 if all the characters in the string are alphabetic

  • isbound

    Parameters in VEX can be overridden by geometry attributes (if the attributes exist on the surface being rendered).

  • isdigit

    Returns 1 if all the characters in the string are numeric

  • isfinite

    Checks whether a value is a normal finite number.

  • 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.

  • isinf

    Checks whether a value is a positive or negative infinity.

  • isnan

    Checks whether a value is not a number.

  • isotropic

    Returns an isotropic BSDF, which scatters light equally in all directions.

  • isshadingRHS

    Detects the orientation of default shading space.

  • isuvrendering

    Indicates whether the shader is being evaluated while doing UV rendering (e.g. texture unwrapping)

  • isvalidindex

    Checks if the index given is valid for the array or string given.

  • isvarying

    Check whether a VEX variable is varying or uniform.

  • itoa

    Converts an integer to a string.

  • join

    Concatenate all the strings of an array inserting a common spacer.

  • json_dumps

    Converts a VEX dictionary into a JSON string.

  • json_loads

    Converts a JSON string into a VEX dictionary.

  • keys

    Returns all the keys in a dictionary.

  • kspline

    Returns an interpolated value along a curve defined by a basis and key/position pairs.

  • len

    Returns the length of an array.

  • length

    Returns the magnitude of a vector.

  • length2

    Returns the squared distance of the vector or vector4.

  • lerp

    Performs linear interpolation between the values.

  • limit_sample_space

    Limits a unit value in a way that maintains uniformity and in-range consistency.

  • lkspline

    Samples a polyline between the key points.

  • log

    Returns the natural logarithm of the argument.

  • log10

    Returns the logarithm (base 10) of the argument.

  • lookat

    Computes a rotation matrix or angles to orient the negative z-axis along the vector (to-from) under the transformation.

  • lspline

    Samples a polyline defined by linearly spaced values.

  • lstrip

    Strips leading whitespace from a string.

  • luminance

    Compute the luminance of the RGB color specified by the parameters.

  • makebasis

    Creates an orthonormal basis given a z-axis vector.

  • maketransform

    Builds a 3×3 or 4×4 transform matrix.

  • makevalidvarname

    Forces a string to conform to the rules for variable names.

  • mask_bsdf

    Returns new BSDF that only includes the components specified by the mask.

  • match

    This function returns 1 if the subject matches the pattern specified, or 0 if the subject doesn’t match.

  • matchvex_blinn

    Returns a BSDF that matches the output of the traditional VEX blinn function.

  • matchvex_specular

    Returns a BSDF that matches the output of the traditional VEX specular function.

  • max

  • 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

    Iterate to the next metaball in the list of metaballs returned by the metastart() function.

  • 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

  • minpos

    Given a position in world space, returns the position of the closest point on a given geometry.

  • mwnoise

    Generates Worley (cellular) noise using a Manhattan distance metric.

  • mx_cellnoise

    MaterialX compatible cellnoise

  • mx_perlin

    MaterialX compatible Perlin noise

  • mx_voronoi

    MaterialX compatible Voronoi noise

  • mx_worley

    MaterialX compatible Worley noise

  • nametopoint

    Finds a point by its name attribute.

  • nametoprim

    Finds a primitive by its name attribute.

  • nbouncetypes

  • ndcdepth

    Returns the camera space z-depth of the NDC z-depth value.

  • nearpoint

    Finds the closest point in a geometry.

  • nearpoints

    Finds the all the closest point in a geometry.

  • nedgesgroup

    Returns the number of edges in the group.

  • neighbour

    Returns the point number of the next point connected to a given point.

  • neighbourcount

    Returns the number of points that are connected to the specified point.

  • neighbours

    Returns an array of the point numbers of the neighbours of a point.

  • newsampler

    Initializes a sampling sequence for the nextsample function.

  • nextsample

  • 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.

  • noised

    Derivatives of Perlin Noise.

  • norm_1

    Returns the induced matrix 1-norm.

  • norm_fro

    Returns the Frobenius norm of a matrix.

  • norm_inf

    Returns the induced matrix infinity-norm.

  • norm_max

    Returns the matrix max-norm.

  • norm_spectral

    Returns the matrix spectral norm.

  • normal_bsdf

    Returns the normal for the diffuse component of a BSDF.

  • normalize

    Returns a normalized vector.

  • npoints

    Returns the number of points in the input or geometry file.

  • npointsgroup

    Returns the number of points in the group.

  • nprimitives

    Returns the number of primitives in the input or geometry file.

  • nprimitivesgroup

    Returns the number of primitives in the group.

  • nrandom

    Non-deterministic random number generation function.

  • ntransform

    Transforms a normal vector.

  • nuniqueval

    Returns the number of unique values from an integer or string attribute.

  • nvertices

    Returns the number of vertices in the input or geometry file.

  • nverticesgroup

    Returns the number of vertices in the group.

  • ocean_sample

    Evaluates an ocean spectrum and samples the result at a given time and location.

  • ocio_activedisplays

    Returns the names of active displays supported in Open Color IO

  • ocio_activeviews

    Returns the names of active views supported in Open Color IO

  • ocio_import

    Imports attributes from OpenColorIO spaces.

  • ocio_parsecolorspace

    Parse the color space from a string

  • ocio_roles

    Returns the names of roles supported in Open Color IO

  • ocio_spaces

    Returns the names of color spaces supported in Open Color IO.

  • ocio_transform

    Transform colors using Open Color IO

  • ocio_transformview

    Transform colors to a view using Open Color IO

  • onoise

    These functions are similar to wnoise and vnoise.

  • opdigits

    Returns the integer value of the last sequence of digits of a string

  • opfullpath

    Returns the full path for the given relative path

  • opid

    Resolves an operator path string and return its op_id.

  • opparentbonetransform

    Returns the parent bone transform associated with an OP.

  • opparenttransform

    Returns the parent transform associated with an OP.

  • opparmtransform

    Returns the parm transform associated with an OP.

  • oppreconstrainttransform

    Returns the preconstraint transform associated with an OP.

  • oppreparmtransform

    Returns the pre and parm transform associated with an OP.

  • opprerawparmtransform

    Returns the pre and raw parm transform associated with an OP.

  • oppretransform

    Returns the pretransform associated with an OP.

  • oprawparmtransform

    Returns the raw parm transform associated with an OP.

  • optransform

    Returns the transform associated with an OP.

  • ord

    Converts an UTF8 string into a codepoint.

  • orthographic

    Create an orthographic projection matrix.

  • osd_facecount

  • osd_firstpatch

  • osd_limitsurface

    Evaluates a point attribute at the subdivision limit surface using Open Subdiv.

  • osd_limitsurfacevertex

    Evaluates a vertex attribute at the subdivision limit surface using Open Subdiv.

  • osd_lookupface

    Outputs the Houdini face and UV coordinates corresponding to the given coordinates on an OSD patch.

  • osd_lookuppatch

    Outputs the OSD patch and UV coordinates corresponding to the given coordinates on a Houdini polygon face.

  • osd_patchcount

  • osd_patches

    Returns a list of patch IDs for the patches in a subdivision hull.

  • outerproduct

    Returns the outer product between the arguments.

  • 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.

  • pack_inttosafefloat

    Reversibly packs an integer into a finite, non-denormal float.

  • packedtransform

    Transforms a packed primitive.

  • pcclose

    This function closes the handle associated with a pcopen function.

  • pccone

    Returns a list of closest points from a file within a specified cone.

  • pccone_radius

    Returns a list of closest points from a file in a cone, taking into account their radii

  • 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 points found by pcopen using a simple reconstruction filter.

  • pcfind

    Returns a list of closest points from a file.

  • pcfind_radius

    Returns a list of closest points from a file taking into account their radii.

  • pcgenerate

    Generates a point cloud.

  • pcimport

    Imports channel data from a point cloud inside a pciterate or a pcunshaded loop.

  • pcimportbyidx3

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidx4

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxf

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxi

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxp

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxs

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxv

    Imports channel data from a point cloud outside 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.

  • pcline

    Returns a list of closest points to an infinite line from a specified file

  • pcline_radius

    Returns a list of closest points to an infinite line from a specified file

  • pcnumfound

    This node returns the number of points found by pcopen.

  • pcopen

    Returns a handle to a point cloud file.

  • pcopenlod

    Returns a handle to a point cloud file.

  • pcsampleleaf

    Changes the current iteration point to a leaf descendant of the current aggregate point.

  • pcsegment

    Returns a list of closest points to a line segment from a specified file

  • pcsegment_radius

    Returns a list of closest points to a line segment from a specified file

  • pcsize

  • 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.

  • perspective

    Create a perspective projection matrix.

  • pgfind

    Returns a list of closest points from a file.

  • phongBRDF

  • phonglobe

  • photonmap

    Samples a color from a photon map.

  • pinvert

    Computes the pseudo-inverse of a matrix.

  • planepointdistance

    Computes the distance and closest point of a point to an infinite plane.

  • planesphereintersect

    Computes the intersection of a 3D sphere and an infinite 3D plane.

  • pluralize

    Converts an English noun to its plural.

  • 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.

  • point

    Reads a point attribute value from a geometry.

  • pointattrib

    Reads a point attribute value from a geometry and outputs a success/fail flag.

  • pointattribsize

    Returns the size of a geometry point attribute.

  • pointattribtype

    Returns the type of a geometry point attribute.

  • pointattribtypeinfo

    Returns the type info of a geometry attribute.

  • pointedge

    Finds and returns a half-edge with the given endpoints.

  • pointhedge

    Finds and returns a half-edge with a given source point or with given source and destination points.

  • pointhedgenext

    Returns the next half-edge with the same source as a given half-edge.

  • pointlocaltransforms

    Returns an array of point localtransforms from an array of point indices.

  • pointprims

    Returns the list of primitives containing a point.

  • pointtransform

    Returns a point transform from a point index.

  • pointtransformrigid

    Returns a rigid point transform from a point index.

  • pointtransforms

    Returns an array of point transforms from an array of point indices.

  • pointtransformsrigid

    Returns an array of rigid point transforms from an array of point indices.

  • pointvertex

    Returns a linear vertex number of a point in a geometry.

  • pointvertices

    Returns the list of vertices connected to a point.

  • polardecomp

    Computes the polar decomposition of a matrix.

  • polyneighbours

    Returns an array of the primitive numbers of the edge-neighbours of a polygon.

  • pop

    Removes the last element of an array and returns it.

  • pow

    Raises the first argument to the power of the second argument.

  • predicate_incircle

    Determines if a point is inside or outside a triangle circumcircle.

  • predicate_insphere

    Determines if a point is inside or outside a tetrahedron circumsphere.

  • predicate_orient2d

    Determines the orientation of a point with respect to a line.

  • predicate_orient3d

    Determines the orientation of a point with respect to a plane.

  • premul

    Pre multiply matrices.

  • prerotate

    Applies a pre rotation to the given matrix.

  • prescale

    Prescales the given matrix in three directions simultaneously (X, Y, Z - given by the components of the scale_vector).

  • pretranslate

    Pretranslates a matrix by a vector.

  • prim

    Reads a primitive attribute value from a geometry.

  • prim_attribute

    Interpolates the value of an attribute at a certain parametric (u, v) position and copies it into a variable.

  • prim_normal

    Returns the normal of the primitive (prim_number) at parametric location u, v.

  • primarclen

    Evaluates the length of an arc on a primitive using parametric uv coordinates.

  • primattrib

    Reads a primitive attribute value from a geometry, outputting a success flag.

  • primattribsize

    Returns the size of a geometry prim attribute.

  • primattribtype

    Returns the type of a geometry prim attribute.

  • primattribtypeinfo

    Returns the type info of a geometry attribute.

  • primduv

    Returns position derivative on a primitive at a certain parametric (u, v) position.

  • primfind

    Returns a list of primitives potentially intersecting a given bounding box.

  • primhedge

    Returns one of the half-edges contained in a primitive.

  • priminteriorweights

    Finds the indices and weightings of the vertices that will compute an interior point given the UVW coordinates.

  • primintrinsic

    Reads a primitive intrinsic from a geometry.

  • primpoint

    Converts a primitive/vertex pair into a point number.

  • primpoints

    Returns the list of points on a primitive.

  • primuv

    Interpolates the value of an attribute at a certain parametric (uvw) position.

  • primuvconvert

    Convert parametric UV locations on curve primitives between different spaces.

  • primvertex

    Converts a primitive/vertex pair into a linear vertex.

  • primvertexcount

    Returns number of vertices in a primitive in a geometry.

  • primvertices

    Returns the list of vertices on a primitive.

  • print_once

    Prints a message only once, even in a loop.

  • printf

    Prints values to the console which started the VEX program.

  • product

    Returns the product of a list of numbers.

  • ptexture

    Computes a filtered sample from a ptex texture map. Use texture instead.

  • 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.

  • xnoise

    Simplex noise is very close to Perlin noise, except with the samples on a simplex mesh rather than a grid. This results in less grid artifacts. It also uses a higher order bspline to provide better derivatives. This is the periodic simplex noise

  • pxnoised

    Periodic derivatives of Simplex Noise.

  • qconvert

    Converts a quaternion represented by a vector4 to a matrix3 representation.

  • qdistance

    Finds distance between two quaternions.

  • qinvert

    Inverts a quaternion rotation.

  • qmultiply

    Multiplies two quaternions and returns the result.

  • qrotate

    Rotates a vector by a quaternion.

  • quaternion

    Creates a vector4 representing a quaternion.

  • quaterniontoeuler

    Creates a euler angle representing a quaternion.

  • radians

    Converts the argument from degrees into radians.

  • ramp_lookup

    Evaluates a Houdini-style ramp at a specific location.

  • ramp_pack

    Packs a set of arrays into a string-encoded ramp.

  • ramp_unpack

    Unpacks a string-encoded ramp into a set of arrays.

  • rand

    Creates a random number between 0 and 1 from a seed.

  • random

    Generate a random number based on the integer position in 1-4D space.

  • random_brj

    Generate a uniformly distributed random number.

  • random_fhash

    Hashes floating point numbers to integers.

  • random_ihash

    Hashes integer numbers to integers.

  • random_poisson

    Generates a random Poisson variable given the mean to the distribution and a seed.

  • random_shash

    Hashes a string to an integer.

  • random_sobol

    Generate a uniformly distributed random number.

  • rawcolormap

    Looks up an unfiltered color from a texture file.

  • rayhittest

    Sends a ray from the position P along the direction D.

  • rayimport

    Imports a value sent by a shader in a gather loop.

  • re_find

    Matches a regular expression in a string

  • re_findall

    Finds all instances of the given regular expression in the string

  • re_match

    Returns 1 if the entire input string matches the expression

  • re_replace

    Replaces instances of regex_find with regex_replace

  • re_split

    Splits the given string based on regex match.

  • reflect

    Returns the vector representing the reflection of the direction against the normal.

  • refract

    Returns the refraction ray given an incoming direction, the normalized normal and an index of refraction.

  • relativepath

    Computes the relative path for two full paths.

  • relbbox

    Returns the relative position of the point given with respect to the bounding box of the geometry.

  • relpath

    Returns the relative path to a file.

  • relpointbbox

    Returns the relative position of the point given with respect to the bounding box of the geometry.

  • removeattrib

    Removes an attribute or group from the geometry.

  • removedetailattrib

    Removes a detail attribute from a geometry.

  • removeindex

    Removes an item at the given index from an array.

  • removepoint

    Removes a point from the geometry.

  • removepointattrib

    Removes a point attribute from a geometry.

  • removepointgroup

    Removes a point group from a geometry.

  • removeprim

    Removes a primitive from the geometry.

  • removeprimattrib

    Removes a primitive attribute from a geometry.

  • removeprimgroup

    Removes a primitive group from a geometry.

  • removevalue

    Removes an item from an array.

  • removevertex

    Removes a vertex from the geometry.

  • removevertexattrib

    Removes a vertex attribute from a geometry.

  • removevertexgroup

    Removes a vertex group from a geometry.

  • reorder

    Reorders items in an array or string.

  • replace

    Replaces occurrences of a substring.

  • replace_match

    Replaces the matched string pattern with another pattern.

  • resample_linear

  • resize

    Sets the length of an array.

  • reverse

    Returns an array or string in reverse order.

  • rgbtohsv

    Convert RGB color space to HSV color space.

  • rgbtoxyz

    Convert a linear sRGB triplet to CIE XYZ tristimulus values.

  • rint

    Rounds the number to the closest whole number.

  • rotate

    Applies a rotation to the given matrix.

  • rotate_x_to

    Rotates a vector by a rotation that would bring the x-axis to a given direction.

  • rstrip

    Strips trailing whitespace from a string.

  • sample_bsdf

    Samples a BSDF.

  • sample_cauchy

    Samples the Cauchy (Lorentz) distribution.

  • sample_cdf

    Samples a cumulative distribution function (CDF).

  • sample_circle_arc

    Generates a uniform unit vector2, within maxangle of center, given a uniform number between 0 and 1.

  • sample_circle_edge_uniform

    Generates a uniform unit vector2, given a uniform number between 0 and 1.

  • sample_circle_ring_uniform

    Generates a uniform vector2 with alpha < length < 1, where 0 < alpha < 1, given a vector2 of uniform numbers between 0 and 1.

  • sample_circle_slice

    Generates a uniform vector2 with length < 1, within maxangle of center, given a vector2 of uniform numbers between 0 and 1.

  • sample_circle_uniform

    Generates a uniform vector2 with length < 1, given a vector2 of uniform numbers between 0 and 1.

  • sample_direction_cone

    Generates a uniform unit vector, within maxangle of center, given a vector2 of uniform numbers between 0 and 1.

  • sample_direction_uniform

    Generates a uniform unit vector, given a vector2 of uniform numbers between 0 and 1.

  • sample_discrete

    Returns an integer, either uniform or weighted, given a uniform number between 0 and 1.

  • sample_exponential

    Samples the exponential distribution.

  • sample_geometry

    Samples geometry in the scene and returns information from the shaders of surfaces that were sampled.

  • sample_hemisphere

    Generates a unit vector, optionally biased, within a hemisphere, given a vector2 of uniform numbers between 0 and 1.

  • sample_hypersphere_cone

    Generates a uniform vector4 with length < 1, within maxangle of center, given a vector4 of uniform numbers between 0 and 1.

  • sample_hypersphere_uniform

    Generates a uniform vector4 with length < 1, given a vector4 of uniform numbers between 0 and 1.

  • sample_lognormal

    Samples the log-normal distribution based on parameters of the underlying normal distribution.

  • sample_lognormal_by_median

    Samples the log-normal distribution based on median and standard deviation.

  • sample_normal

    Samples the normal (Gaussian) distribution.

  • sample_orientation_cone

    Generates a uniform unit vector4, within maxangle of center, given a vector of uniform numbers between 0 and 1.

  • sample_orientation_uniform

    Generates a uniform unit vector4, given a vector of uniform numbers between 0 and 1.

  • sample_photon

    Samples a 3D position on a light source and runs the light shader at that point.

  • sample_sphere_cone

    Generates a uniform vector with length < 1, within maxangle of center, given a vector of uniform numbers between 0 and 1.

  • sample_sphere_shell_uniform

    Generates a uniform vector with alpha < length < 1, where 0 < alpha < 1, given a vector of uniform numbers between 0 and 1.

  • sample_sphere_uniform

    Generates a uniform vector with length < 1, given a vector of uniform numbers between 0 and 1.

  • sampledisk

    Warps uniform random samples to a disk.

  • scale

    Scales the given matrix in three directions simultaneously (X, Y, Z - given by the components of the scale_vector).

  • scatter

    Evaluates a scattering event through the domain of a geometric object.

  • select

    Returns one of two parameters based on a conditional.

  • sensor_panorama_create

    Sensor function to render GL scene and query the result.

  • sensor_panorama_getcolor

    Sensor function query a rendered GL scene.

  • sensor_panorama_getcone

    Sensor function to query average values from rendered GL scene.

  • sensor_panorama_getdepth

    Sensor function query a rendered GL scene.

  • sensor_save

    Sensor function to save a rendered GL scene.

  • serialize

    Flattens an array of vector or matrix types into an array of floats.

  • set

    Creates a new value based on its arguments, such as creating a vector from its components.

  • setagentchannelvalue

    Overrides the value of an agent primitive’s channel.

  • setagentchannelvalues

    Overrides the values of an agent primitive’s channels.

  • setagentclipnames

    Sets the current animation clips for an agent primitive.

  • setagentclips

    Sets the animation clips that an agent should use to compute its transforms.

  • setagentcliptimes

    Sets the current times for an agent primitive’s animation clips.

  • setagentclipweights

    Sets the blend weights for an agent primitive’s animation clips.

  • setagentcollisionlayer

    Sets the collision layer of an agent primitive.

  • setagentcollisionlayers

    Sets the collision layers of an agent primitive.

  • setagentcurrentlayer

    Sets the current layer of an agent primitive.

  • setagentcurrentlayers

    Sets the current display layers of an agent primitive.

  • setagentlocaltransform

    Overrides the local space transform of an agent primitive’s bone.

  • setagentlocaltransforms

    Overrides the local space transforms of an agent primitive.

  • setagentworldtransform

    Overrides the world space transform of an agent primitive’s bone.

  • setagentworldtransforms

    Overrides the world space transforms of an agent primitive.

  • setattrib

    Writes an attribute value to geometry.

  • setattribtypeinfo

    Sets the meaning of an attribute in geometry.

  • setcomp

    Sets a single component of a vector or matrix type, or an item in an array.

  • setdetailattrib

    Sets a detail attribute in a geometry.

  • setdetailintrinsic

    Sets the value of a writeable detail intrinsic attribute.

  • setedgegroup

    Sets edge group membership in a geometry.

  • setpackedtransform

    Sets the transform of a packed primitive.

  • setpointattrib

    Sets a point attribute in a geometry.

  • setpointgroup

    Adds or removes a point to/from a group in a geometry.

  • setpointlocaltransforms

    Sets an array of point local transforms at the given point indices.

  • setpointtransform

    Sets the world space transform of a given point

  • setpointtransforms

    Sets an array of point transforms at the given point indices.

  • setprimattrib

    Sets a primitive attribute in a geometry.

  • setprimgroup

    Adds or removes a primitive to/from a group in a geometry.

  • setprimintrinsic

    Sets the value of a writeable primitive intrinsic attribute.

  • setprimvertex

    Rewires a vertex in the geometry to a different point.

  • setvertexattrib

    Sets a vertex attribute in a geometry.

  • setvertexgroup

    Adds or removes a vertex to/from a group in a geometry.

  • setvertexpoint

    Rewires a vertex in the geometry to a different point.

  • shadowmap

    The shadowmap function will treat the shadow map as if the image were rendered from a light source.

  • shl

    Bit-shifts an integer left.

  • shr

    Bit-shifts an integer right.

  • shrz

    Bit-shifts an integer right.

  • sign

    Returns -1, 0, or 1 depending on the sign of the argument.

  • 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.

  • sinpi

    Returns the sine of the argument scaled by Pi.

  • sleep

    Yields processing for a certain number of milliseconds.

  • slerp

    Quaternion blend between q1 and q2 based on the bias.

  • slerpv

    Spherical blends between two vectors based on the bias.

  • slice

    Slices a sub-string or sub-array of a string or array.

  • slideframe

    Finds the normal component of frame slid along a curve.

  • smooth

    Computes ease in/out interpolation between values.

  • smoothrotation

    Returns the closest equivalent Euler rotations to a reference rotation.

  • snoise

    These functions are similar to wnoise.

  • solid_angle

    Computes the solid angle (in steradians) a BSDF function subtends.

  • solveconstraint

    Applies an inverse kinematics algorithm to a skeleton.

  • solvecubic

    Solves a cubic function returning the number of real roots.

  • solvecurve

    Applies a curve inverse kinematics algorithm to a skeleton.

  • solvefbik

    Applies a full-body inverse kinematics algorithm to a skeleton.

  • solveik

    Applies an inverse kinematics algorithm to a skeleton.

  • solvephysfbik

    Applies a full-body inverse kinematics algorithm to a skeleton, with optional control over the center of mass.

  • solvepoly

    Finds the real roots of a polynomial.

  • solvequadratic

    Solves a quadratic function returning the number of real roots.

  • solvetriangleSSS

    Finds the angles of a triangle from its sides.

  • sort

    Returns the array sorted in increasing order.

  • specular

    Returns a specular BSDF or computes specular shading.

  • specularBRDF

    Returns the computed BRDFs for the different lighting models used in VEX shading.

  • spline

    Samples a value along a polyline or spline curve.

  • spline_cdf

    Generate a cumulative distribution function (CDF) by sampling a spline curve.

  • split

    Splits a string into tokens.

  • split_bsdf

    Splits a bsdf into its component lobes.

  • splitpath

    Splits a file path into the directory and name parts.

  • 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.

  • sssapprox

    Creates an approximate SSS BSDF.

  • startswith

    Returns 1 if the string starts with the specified string.

  • strip

    Strips leading and trailing whitespace from a string.

  • strlen

    Returns the length of the string.

  • sum

    Returns the sum of a list of numbers.

  • surfacedist

    Finds the distance of a point to a group of points along the surface of a geometry.

  • svddecomp

    Computes the singular value decomposition of a given matrix.

  • switch

    Use a different bsdf for direct or indirect lighting.

  • swizzle

    Rearranges the components of a vector.

  • tan

    Returns the trigonometric tangent of the argument

  • tanh

    Returns the hyperbolic tangent of the argument

  • tanpi

    Returns the trigonometric tangent of the argument scaled by Pi

  • tet_adjacent

    Returns primitive number of an adjacent tetrahedron.

  • tet_faceindex

    Returns vertex indices of each face of a tetrahedron.

  • teximport

    Imports attributes from texture files.

  • texprintf

    Similar to sprintf, but does expansion of UDIM or UVTILE texture filename expansion.

  • 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.

  • titlecase

    Returns a string that is the titlecase version of the input string.

  • toNDC

    Transforms a position into normal device coordinates.

  • tolower

    Converts all characters in string to lower case

  • toupper

    Converts all characters in string to upper case

  • tr

    Returns the trace of the given matrix.

  • translate

    Translates a matrix by a vector.

  • translucent

    Returns a Lambertian translucence BSDF.

  • transpose

    Transposes the given matrix.

  • trunc

    Removes the fractional part of a floating point number.

  • 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.

  • typeid

    Returns a numeric code identifying a VEX data type.

  • uniqueval

    Returns one of the set of unique values across all values for an int or string attribute.

  • uniquevals

    Returns the set of unique values across all values for an int or string attribute.

  • unpack_intfromsafefloat

    Reverses the packing of pack_inttosafefloat to get back the original integer.

  • unserialize

    Turns a flat array of floats into an array of vectors or matrices.

  • upush

    Adds a uniform item to an array.

  • usd_addattrib

    Creates an attribute of a given type on a primitive.

  • usd_addcollectionexclude

    Excludes an object from the collection

  • usd_addcollectioninclude

    Includes an object in the collection

  • usd_addinversetotransformorder

    Appends an inversed transform operation to the primitive’s transform order

  • usd_addorient

    Applies a quaternion orientation to the primitive

  • usd_addprim

    Creates a primitive of a given type.

  • usd_addprimvar

    Creates a primvar of a given type on a primitive.

  • usd_addrelationshiptarget

    Adds a target to the primitive’s relationship

  • usd_addrotate

    Applies a rotation to the primitive

  • usd_addscale

    Applies a scale to the primitive

  • usd_addschemaattrib

    Creates an attribute of a given type on a primitive, and sets the custom metadata flag to False.

  • usd_addtotransformorder

    Appends a transform operation to the primitive’s transform order

  • usd_addtransform

    Applies a transformation to the primitive

  • usd_addtranslate

    Applies a translation to the primitive

  • usd_applyapi

    Apply an API schema to a primitive.

  • usd_attrib

    Reads the value of an attribute from the USD primitive.

  • usd_attribelement

    Reads the value of an element from an array attribute.

  • usd_attriblen

    Returns the length of the array attribute.

  • usd_attribnames

    Returns the names of the attributes available on the primitive.

  • usd_attribsize

    Returns the tuple size of the attribute.

  • usd_attribtimesamples

    Returns the time codes at which the attribute values are authored.

  • usd_attribtypename

    Returns the name of the attribute type.

  • usd_blockattrib

    Blocks the attribute.

  • usd_blockprimvar

    Blocks the primvar.

  • usd_blockprimvarindices

    Blocks the primvar.

  • usd_blockrelationship

    Blocks the primitive’s relationship

  • usd_boundmaterialpath

    Returns the material path bound to a given primitive.

  • usd_childnames

    Returns the names of the primitive’s children.

  • usd_clearmetadata

    Clears the value of the metadata.

  • usd_cleartransformorder

    Clears the primitive’s transform order

  • usd_collectioncomputedpaths

    Obtains the list of all objects that belong to the collection

  • usd_collectioncontains

    Checks if an object path belongs to the collection

  • usd_collectionexcludes

    Obtains the object paths that are in the collection’s exclude list

  • usd_collectionexpansionrule

    Obtains the collection’s expansion rule

  • usd_collectionincludes

    Obtains the object paths that are in the collection’s include list

  • usd_drawmode

    Returns the primitive’s draw mode.

  • usd_findtransformname

    Retrurns primitive’s transform operation full name for given the transform operation suffix

  • usd_flattenediprimvar

    Reads the value of a flattened primvar directly from the USD primitive or from USD primitive’s ancestor.

  • usd_flattenediprimvarelement

    Reads an element value of a flattened array primvar directly from the USD primitive or from its ancestor.

  • usd_flattenedprimvar

    Reads the value of an flattened primvar directly from the USD primitive.

  • usd_flattenedprimvarelement

    Reads an element value of a flattened array primvar directly from a USD primitive.

  • usd_getbbox

    Sets two vectors to the minimum and maximum corners of the bounding box for the primitive.

  • usd_getbbox_center

    Returns the center of the bounding box for the primitive.

  • usd_getbbox_max

    Returns the maximum of the bounding box for the primitive.

  • usd_getbbox_min

    Returns the minimum of the bounding box for the primitive.

  • usd_getbbox_size

    Returns the size of the bounding box for the primitive.

  • usd_getbounds

    Obtains the primitive’s bounds

  • usd_getpointinstancebounds

    Obtains the primitive’s bounds

  • usd_hasapi

    Checks if the primitive adheres to the given API.

  • usd_haspayload

    Checks if the primitive adheres to the given API.

  • usd_iprimvar

    Reads the value of a primvar directly from the USD primitive or from USD primitive’s ancestor.

  • usd_iprimvarelement

    Reads the value of an element from the array primvar directly from the USD primitive or from USD primitive’s ancestor.

  • usd_iprimvarelementsize

    Returns the element size of the primvar directly from the USD primitive or from USD primitive’s ancestor.

  • usd_iprimvarindices

    Returns the index array of an indexed primvar directly on the USD primitive or on USD primitive’s ancestor.

  • usd_iprimvarinterpolation

    Returns the element size of the primvar directly on the USD primitive or on USD primitive’s ancestor.

  • usd_iprimvarlen

    Returns the length of the array primvar directly on the USD primitive or on USD primitive’s ancestor.

  • usd_iprimvarnames

    Returns the names of the primvars available directly on the given USD primitive or on USD primitive’s ancestor.

  • usd_iprimvarsize

    Returns the tuple size of the primvar directly on the USD primitive or on USD primitive’s ancestor.

  • usd_iprimvartimesamples

    Returns the time codes at which the primvar values are authored directly on the given primitive or on its ancestor.

  • usd_iprimvartypename

    Returns the name of the primvar type found on the given primitive or its ancestor.

  • usd_isabstract

    Checks if the primitive is abstract.

  • usd_isactive

    Checks if the primitive is active.

  • usd_isarray

    Checks if the attribute is an array.

  • usd_isarrayiprimvar

    Checks if there is an array primvar directly on the USD primitive or on USD primitive’s ancestor.

  • usd_isarraymetadata

    Checks if the given metadata is an array.

  • usd_isarrayprimvar

    Checks if there is an array primvar directly on the USD primitive.

  • usd_isattrib

    Checks if the primitive has an attribute by the given name.

  • usd_iscollection

    Checks if the collection exists.

  • usd_iscollectionpath

    Checks if the path is a valid collection path.

  • usd_isindexediprimvar

    Checks if there is an indexed primvar directly on the USD primitive or on USD primitive’s ancestor.

  • usd_isindexedprimvar

    Checks if there is an indexed primvar directly on the USD primitive.

  • usd_isinstance

    Checks if the primitive is an instance.

  • usd_isiprimvar

    Checks if the primitive or its ancestor has a primvar of the given name.

  • usd_iskind

    Checks if the primitive is of a given kind.

  • usd_ismetadata

    Checks if the primitive has metadata by the given name.

  • usd_ismodel

    Checks if the primitive is a model.

  • usd_isprim

    Checks if the path refers to a valid primitive.

  • usd_isprimvar

    Checks if the primitive has a primvar of the given name.

  • usd_isrelationship

    Checks if the primitive has a relationship by the given name.

  • usd_isstage

    Checks if the stage is valid.

  • usd_istransformreset

    Checks if the primitive transform is reset

  • usd_istype

    Checks if the primitive is of a given type.

  • usd_isvisible

    Checks if the primitive is visible.

  • usd_kind

    Returns the primitive’s kind.

  • usd_localtransform

    Obtains the primitive’s local transform

  • usd_makeattribpath

    Constructs an attribute path from a primitive path and an attribute name.

  • usd_makecollectionpath

    Constructs a collection path from a primitive path and a collection name.

  • usd_makepropertypath

    Constructs an property path from a primitive path and an property name.

  • usd_makerelationshippath

    Constructs an relationship path from a primitive path and a relationship name.

  • usd_makevalidprimname

    Forces a string to conform to the rules for naming USD primitives.

  • usd_makevalidprimpath

    Forces a string to conform to the rules for paths to USD primitives.

  • usd_metadata

    Reads the value of metadata from the USD object.

  • usd_metadataelement

    Reads the value of an element from the array metadata.

  • usd_metadatalen

    Returns the length of the array metadata.

  • usd_metadatanames

    Returns the names of the metadata available on the object.

  • usd_name

    Returns the name of the primitive.

  • usd_parentpath

    Returns the path of the primitive’s parent.

  • usd_pointinstance_getbbox

    Sets two vectors to the minimum and maximum corners of the bounding box for the given instance inside point instancer.

  • usd_pointinstance_getbbox_center

    Returns the center of the bounding box for the instance inside a point instancer primitive.

  • usd_pointinstance_getbbox_max

    Returns the maximum position of the bounding box for the instance inside a point instancer primitive.

  • usd_pointinstance_getbbox_min

    Returns the minimum position of the bounding box for the instance inside a point instancer primitive.

  • usd_pointinstance_getbbox_size

    Returns the size of the bounding box for the instance inside a point instancer primitive.

  • usd_pointinstance_relbbox

    Returns the relative position of the point given with respect to the bounding box of the geometry.

  • usd_pointinstancetransform

    Obtains the transform for the given point instance

  • usd_primvar

    Reads the value of a primvar directly from the USD primitive.

  • usd_primvarattribname

    Returns the namespaced attribute name for the given primvar.

  • usd_primvarelement

    Reads the value of an element from the array primvar directly from the USD primitive.

  • usd_primvarelementsize

    Returns the element size of the primvar directly from the USD primitive.

  • usd_primvarindices

    Returns the index array of an indexed primvar directly on the USD primitive.

  • usd_primvarinterpolation

    Returns the element size of the primvar directly on the USD primitive.

  • usd_primvarlen

    Returns the length of the array primvar directly on the USD primitive.

  • usd_primvarnames

    Returns the names of the primvars available on the given USD primitive.

  • usd_primvarsize

    Returns the tuple size of the primvar directly on the USD primitive.

  • usd_primvartimesamples

    Returns the time codes at which the primvar values are authored directly on the given primitive.

  • usd_primvartypename

    Returns the name of the primvar type found on the given primitive.

  • usd_purpose

    Returns the primitive’s purpose.

  • usd_relationshipforwardedtargets

    Obtains the relationship forwarded targets.

  • usd_relationshipnames

    Returns the names of the relationships available on the primitive.

  • usd_relationshiptargets

    Obtains the relationship targets.

  • usd_relbbox

    Returns the relative position of the point given with respect to the bounding box of the geometry.

  • usd_removerelationshiptarget

    Remove a target from the primitive’s relationship

  • usd_setactive

    Sets the primitive active state.

  • usd_setattrib

    Sets the value of an attribute.

  • usd_setattribelement

    Sets the value of an element in an array attribute.

  • usd_setcollectionexcludes

    Sets the excludes list on the collection

  • usd_setcollectionexpansionrule

    Sets the expansion rule on the collection

  • usd_setcollectionincludes

    Sets the includes list on the collection

  • usd_setdrawmode

    Sets the primitive’s draw mode.

  • usd_setkind

    Sets the primitive’s kind.

  • usd_setmetadata

    Sets the value of an metadata.

  • usd_setmetadataelement

    Sets the value of an element in an array metadata.

  • usd_setprimvar

    Sets the value of a primvar.

  • usd_setprimvarelement

    Sets the value of an element in an array primvar.

  • usd_setprimvarelementsize

    Sets the element size of a primvar.

  • usd_setprimvarindices

    Sets the indices for the given primvar.

  • usd_setprimvarinterpolation

    Sets the interpolation of a primvar.

  • usd_setpurpose

    Sets the primitive’s purpose.

  • usd_setrelationshiptargets

    Sets the targets in the primitive’s relationship

  • usd_settransformorder

    Sets the primitive’s transform order

  • usd_settransformreset

    Sets/clears the primitive’s transform reset flag

  • usd_setvariantselection

    Sets the selected variant in the given variant set.

  • usd_setvisibility

    Configures the primitive to be visible, invisible, or to inherit visibility from the parent.

  • usd_setvisible

    Makes the primitive visible or invisible.

  • usd_specifier

    Returns the primitive’s specifier.

  • usd_transformname

    Constructs a full name of a transform operation

  • usd_transformorder

    Obtains the primitive’s transform order

  • usd_transformsuffix

    Extracts the transform operation suffix from the full name

  • usd_transformtype

    Infers the transform operation type from the full name

  • usd_typename

    Returns the name of the primitive’s type.

  • usd_uniquetransformname

    Constructs a unique full name of a transform operation

  • usd_variants

    Returns the variants belonging to the given variant set on a primitive.

  • usd_variantselection

    Returns the currently selected variant in a given variant set.

  • usd_variantsets

    Returns the variant sets available on a primitive.

  • usd_worldtransform

    Obtains the primitive’s world transform

  • uvdist

    Finds the distance of a uv coordinate to a geometry in uv space.

  • uvintersect

    This function computes the intersection of the specified ray with the geometry in uv space.

  • uvsample

    Interpolates the value of an attribute at certain UV coordinates using a UV attribute.

  • uvunwrap

    Computes the position and normal at given (u, v) coordinates, for use in a lens shader.

  • variance

    Computes the mean value and variance for a value.

  • vertex

    Reads a vertex attribute value from a geometry.

  • vertexattrib

    Reads a vertex attribute value from a geometry.

  • vertexattribsize

    Returns the size of a geometry vertex attribute.

  • vertexattribtype

    Returns the type of a geometry vertex attribute.

  • vertexattribtypeinfo

    Returns the type info of a geometry attribute.

  • vertexcurveparam

    Returns the parametric coordinate of a vertex along the perimeter of its primitive.

  • vertexhedge

    Returns the half-edge which has a vertex as source.

  • vertexindex

    Converts a primitive/vertex pair into a linear vertex.

  • vertexnext

    Returns the linear vertex number of the next vertex sharing a point with a given vertex.

  • vertexpoint

    Returns the point number of linear vertex in a geometry.

  • vertexprev

    Returns the linear vertex number of the previous vertex sharing a point with a given vertex.

  • vertexprim

    Returns the number of the primitive containing a given vertex.

  • vertexprimindex

    Converts a linear vertex index into a primitive vertex number.

  • vnoise

    Generates Voronoi (cellular) noise.

  • volume

    Returns the volume of the microvoxel containing a variable such as P.

  • volumecubicsample

    Samples the volume primitive’s value.

  • volumecubicsamplev

    Samples the volume primitive’s value.

  • volumegradient

    Calculates the volume primitive’s gradient.

  • volumeindex

    Gets the value of a specific voxel.

  • volumeindexactive

    Gets the active setting of a specific voxel.

  • volumeindexi

    Gets the integer value of a specific voxel.

  • volumeindexorigin

    Gets the index of the bottom left of a volume primitive.

  • volumeindexp

    Gets the vector4 value of a specific voxel.

  • volumeindextopos

    Converts a volume voxel index into a position.

  • volumeindexu

    Gets the vector2 value of a specific voxel.

  • volumeindexv

    Gets the vector value of a specific voxel.

  • volumepostoindex

    Converts a position into a volume voxel index.

  • volumeres

    Gets the resolution of a volume primitive.

  • volumesample

    Samples the volume primitive’s float value.

  • volumesamplei

    Samples the volume primitive’s integer value.

  • volumesamplep

    Samples the volume primitive’s vector4 value.

  • volumesampleu

    Samples the volume primitive’s vector2 value.

  • volumesamplev

    Samples the volume primitive’s vector value.

  • volumesmoothsample

    Samples the volume primitive’s value.

  • volumesmoothsamplev

    Samples the volume primitive’s value.

  • volumetypeid

    Gets the typeid of the data of a volume or VDB primitive.

  • volumevoxeldiameter

    Computes the approximate diameter of a voxel.

  • vtransform

    Transforms a directional vector.

  • warning

    Reports a custom runtime VEX warning.

  • weightarrayblend

    Blends an existing name/weight array pair with another array or named item.

  • weightarrayfromname

    Initializes an index array and weight array pair with a single named entry.

  • weightarraynormalize

    Normalizes an array of floats so it sums to 1.0.

  • weightarraythreshold

    Discards any weights below a threshold from an name/weight array pair.

  • windingnumber

    Computes the winding number of a mesh around a point. Winding number indicates how many times a geometry wraps around a point. Useful for inside/outside test, the winding number is equal to one inside of the mesh and zero outside.

  • windingnumber2d

    Computes the winding number of a curve in XY plane around a point. Winding number indicates how many times a curve wraps around a point. Useful for inside/outside test, the winding number is equal to one inside of the curve and zero outside.

  • wireblinn

  • wirediffuse

  • wnoise

    Generates Worley (cellular) noise.

  • 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.

  • xnoise

    Simplex noise is very close to Perlin noise, except with the samples on a simplex mesh rather than a grid. This results in less grid artifacts. It also uses a higher order bspline to provide better derivatives.

  • xnoised

    Derivatives of Simplex Noise.

  • xyzdist

    Finds the distance from a point to the closest location on surface geometry.

  • xyztorgb

    Convert CIE XYZ tristimulus values to a linear sRGB triplet.

VEX contexts

Shading contexts

See common shading context features for information specific to the shading contexts.

  • displace

    Define a displacement shader with a program that moves a point on a surface before the surface is rendered.

  • fog

    Deprecated. Define a fog shader with a program that modifies the Cf, Of, or Af values to simulate atmospheric effects.

  • light

    Define a light shader with a program called from surface or fog shaders to calculate the illumination of a surface.

  • shadow

    Define a shadow shader by defining a program that’s called from surface or fog shaders to calculate the occlusion on a surface from a light source.

  • surface

    Define a surface shader with a program that sets the final color, opacity, and alpha of a surface being rendered.

Other contexts

  • cvex

  • chop

    Define a custom CHOP operator with a program that edits channel values.

Obsolete contexts

  • image3d

    Obsolete. Write a program for use with the i3dgen program to generate 3D textures.

  • sop

    Obsolete. Define a custom SOP operator with a program that edits geometry point attributes.