
Mantra has some pre-defined struct types that are used in shading-specific functions.ĭefined in mantra shading contexts only. See writing PBR shaders for information on BSDFs. See dicts for more information.Ī bidirectional scattering distribution function. See strings for more information.Ī dictionary mapping strings to other VEX data types. Sixteen floating point values representing a 3D transformation matrixĪ string of characters. Nine floating point values representing a 3D rotation matrix or a 2D transformation matrix

See structs for more information.įour floating point values representing a 2D rotation matrix See arrays for more information.Ī fixed set of named values. This applies both to both quaternions and positions with homogeneous coordinates.Ī list of values. Quaternions in VEX are laid out in x/y/z/w order, not w/x/y/z. It is often used to represent a quaternion. You can use this to represent positions in homogeneous coordinates, or color with alpha (RGBA). You can use this to represent positions, directions, normals or colors (RGB or HSV)įour floating point values. You might use this to represent texture coordinates (though usually Houdini uses vectors) or complex numbers You can use underscores to break up long numbers. There is no double or long type to allow mixed precision math. In 32bit mode, allįloats, vectors, and integers are 32bit. The VEX engine runs in either 32bit or 64bit mode. If you use the AttribCast SOP to cast a geometry attribute to 64 bits, VEX will silently discard the extra bits if you manipulate the attribute in VEX code.
#RENDERMAN MESH LIGHT 32 BIT#
Instead, pass the global(s) to the function as parameters.įunctions can be defined inside of a function (nested functions).īy default, VEX uses 32 bit integers. Recommend you avoid accessing global variables, since this limits yourįunction to only work in one context (where those globals exist). Language, you do not need to declare them with extern).

You can access global variables directly (unlike RenderMan Shading You can have more than one return statement in a function. There is no limit on the number of user functions. Writes to an output parameter, prefix it with the export keyword. You can force a shader parameter to be read-onlyīy prefixing it with the const keyword. Passed by reference, so modifications in a user function affect the variable

To write a recursive algorithm, you should useĪs in RenderMan Shading Language, parameters to user functions are always The functions are in-lined automatically by the compiler, so User functions must be declared before they are referenced.
