VEX changes
Summary of changes since previous versions of the VEX language.
This section details the important changes made to the VEX language and its context functions. For more information, check the change logs.
Changes since Houdini 7.2
-
The refract function now returns the reflection vector in the case of total internal reflection. Previously it returned a zero vector.
Changes since Houdini 7.0
Changes since Houdini 6.1
Changes since the Houdini 6.1 release .
New and modified functions
-
The renderstate function lets shading contexts query some information about the render state.
-
The addattribute function now takes additional arguments to specify type qualifiers for the attribute.
-
The specularBRDF, phongBRDF, blinnBRDF, and diffuseBRDF functions compute the BRDFs for the different lighting models. You can use them in illuminance loops the replicate the lighting from the specular, phong, blinn, and diffuse functions.
-
The following functions deal with point cloud textures:
-
shimport can now import values from the shadow shader for surface and fog shaders.
-
There are new versions of maketransform which are similar to lookat, but with slightly different symantics.
Custom VEX operators
-
The optimization levels in specified in the custom VEX Ops (i.e. VEX plug-ins) have changed slightly. The new meanings of the optimization levels are:
-
The constructor for plug-in’s has changed to allow for hints to be passed to the compiler about signature construction. When a function modifies more than 1 argument, it is now possible to force the first argument to be a return code rather than having a void type as the return code. See the header file
VEX_VexOp.hfor more details.
Compiler changes
-
The parmtag pragma lets you set arbitrary tags for a parameter.
-
The hint invisible pragma creates a parameter but does not add it to the user interface.
Changes since Houdini 6.0
Changes since the Houdini 6.0 release .
New and modified functions
-
In the SOP and POP contexts, you can use computenormal to control the generation of the normal attribute from within the VEX function.
-
New functions let you query metaball geometry from disk files. metastart, metanext, and metaimport evaluate metaball attributes per-metaball. This is a more general interface to evaluating metaball fields.
-
getbounds returns the bounding box of a geometry file on disk.
Compiler changes
-
New options for the hint pragma .
-
The choicereplace and choicetoggle pragmas let you create new types of menu interfaces.
Changes since Houdini 5.5
Changes since the Houdini 5.5 release.
New and modified functions
-
Rewritten shadowmap fixes many artifacts and quality issues, and quality of z-mapped shadows should improve dramatically.
-
nrandom can now generate random numbers using different algorithms.
-
nrandom has new
nrandom(float &x, &y, [string scheme])form which generates pairs of random numbers. -
New optional parameters for many ray tracing functions , including options for area sampling, maximum intersection distance, and hit/miss control.
-
New SOP context function addvariablename set up local variables in the same way as the AttribCreate SOP.
-
New SOP context functions getneighbourcount and getneighbour let you query point connectivity within a vex SOP.
-
intersect3d intersects a ray against a 3D texture map.
-
New functions hscript_noise, hscript_turb, hscript_snoise, hscript_sturb, mimic the houdini expression functions rand(), noise(), snoise(), turb(), and sturb().
Area Sampling and Global Illumination
-
All functions which perform ray-tracing (trace(), refractlight(), reflectlight(), fastshadow(), filtershadow(), hittest()) take optional parameters to cause area sampling to be done.
-
The new irradiance function can be used to compute irradiance in mantra. Irradiance is computed by sampling stochastically over the hemisphere and computing the incoming illumination from the other geometry in the scene.
-
The new occlusion function can be used to compute ambient occlusion in mantra. Like the irradiance function, the hemisphere is sampled. But rather than computing the illumination from the rest of the scene, only occlusion testing is performed. This can be much faster than irradiance computation.
-
The new photonmap function can be used to evaluate a photon texture. Photon maps can be generated using mantra or i3dconvert. The photonmap function is available in all VEX contexts (not only shading).
New Photon Context
There is a new VEX context to construct shaders for photon shading . This context is invoked when mantra is generating photon maps.
Compiler changes
The hint pragma now lets you specify that a string parameter is a path to an operator.