VEX contexts
Guide to the different contexts in which you can write VEX programs.
About contexts
Unlike C or C++, VEX has different “contexts” for which you write programs. These contexts define how the function is to be used.
For example, one context is the “surface” context. Functions written in this context are used to calculate the color(s) of a surface during rendering. The “pop” context is a different context where functions are used to control the motion or attributes of particle systems. While a surface shader processes pixel color information, a custom particle node deals with particle velocities and positions. So the global variables and functions provided for each context are slightly different.
Contexts
Shading contexts
See common shading context features for information specific to the shading contexts.
| displace | A displacement shader moves points on the assigned surface before it’s rendered. |
| fog | A fog shader modifies the color, opacity, and/or alpha of the output image to simulate atmospheric effects. |
| light | A light shader is called from surface or fog shaders to calculate the illumination at a point. |
| photon | A photon shader calculates photon maps. |
| shadow | A shadow shader is called from a surface or fog shader to calculate the occlusion of a light source at a point. |
| surface | A surface shader calculates the final color, opacity, and alpha of a surface. |
Other contexts
| chop | Define a custom CHOP node using a VEX program that edits channel values. |
| cop | Define a custom compositing node using a VEX program that modifies image values. |
| image3d | Generate 3D textures. |
| pop | Define a custom particle node using a VEX program that modifies particle attributes. |
| sop | Define a custom surface node using a VEX program that edits geometry point attributes. |
