Guide to the different contexts in which you can write VEX programs.
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.
See common shading context features for information specific to the shading contexts.
A displacement shader moves points on the assigned surface before it’s rendered.
A fog shader modifies the color, opacity, and/or alpha of the output image to simulate atmospheric effects.
A light shader is called from surface or fog shaders to calculate the illumination at a point.
A shadow shader is called from a surface or fog shader to calculate the occlusion of a light source at a point.
A surface shader calculates the final color, opacity, and alpha of a surface.
Define a custom CHOP node using a VEX program that edits channel values.
Define a custom compositing node using a VEX program that modifies image values.
Generate 3D textures.
Define a custom particle node using a VEX program that modifies particle attributes.
Define a custom surface node using a VEX program that edits geometry point attributes.
|Shading context information|
|chop||Define a custom CHOP operator with a program that edits channel values.|
|cop||Define a custom COP operator with a program that sets RGBA or Cr,Cg,Cb,C4 values in an image.|
|displace||Define a displacement shader with a program that moves a point on a surface before the surface is rendered.|
|fog||Define a fog shader with a program that modifies the Cf, Of, or Af values to simulate atmospheric effects.|
|image3d||Write a program for use with the i3dgen program to generate 3D textures.|
|light||Define a light shader with a program called from surface or fog shaders to calculate the illumination of a surface.|
|pop||Define a custom POP operator with a program that edits particle attributes.|
|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.|
|sop||Define a custom SOP operator with a program that edits geometry point attributes.|
|surface||Define a surface shader with a program that sets the final color, opacity, and alpha of a surface being rendered.|