VEX evaluation is typically very efficient giving performance close to compiled C/C++ code. VEX is not an alternative to scripting, but rather a smaller, more efficient general purpose language for writing shaders and custom nodes.
VEX is loosely based on the C language, but takes ideas from C++ as well as the RenderMan shading language.
VEX is used in several places in Houdini:
-
Rendering – mantra uses VEX for all shading computation. This includes light, surface, displacement and fog shaders.
-
compositing – The VEX Generator and VEX Filter COPs allows you to write complex custom COPs in VEX. The expressions evaluate very close to C/C++ speeds and run 1000's of times faster than the Pixel Expression COP.
-
Particles – The POP VOP allows you to do almost anything that POPs can do themselves. It is possible to write one single VEX function which performs the task of many POPs. Because the VEX code is localized to one single operator, the VEX code will typically run faster than a network of POPs.
-
Modeling – The VEX SOP allows you to write a custom surface node that manipulates point attributes. This can move points around, adjust velocities, change colors. As well, you can group points or do many other useful tasks. VEX SOPs typically run 10 or more times faster than a point SOP.
-
CHOPs – The VEX CHOP lets you to custom CHOPs. The CHOP functions can manipulate arbitrary numbers of input channels and process channel data in arbitrary ways. In some cases, the VEX code can run faster than compiled C++ code.
-
Fur – Procedural fur behavior is implemented with VEX.
Subtopics ¶
Language ¶
-
Details of VEX syntax, data types, and so on.
-
Overview of how to use the VEX language compiler vcc and its pre-processor and pragma statements.
Next steps ¶
-
Working with geometry groups in VEX
You can read the contents of primitive/point/vertex groups in VEX as if they were attributes.
-
Examples and suggestions for programming in VEX.
-
VEX has functions that let you treat edges as unshared per-face half-edges.
-
You can use the assert() macro to print information while you are debugging VEX code.
Reference ¶
-
Guide to the different contexts in which you can write VEX programs.