Houdini 20.5 VEX

VEX contexts

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 global variables and functions provided for each context are slightly different.

Subtopics

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.

VEX

Language

Next steps

Reference