ABSTRACT

This chapter provides detailed descriptions of the library of operators and functions supported by shading (Sh). In general, the implementation of library functions and operators may vary by compilation target. All the functions and operators in the standard library can be compiled on hardware without branch support, unless specified otherwise. Operators are also provided that act on ShProgram objects. These operators are used to manipulate ShProgram objects in various useful ways and to apply programs to streams and tuples. Swizzling refers to the extraction, rearrangement, and possible duplication of elements of tuple types. Swizzles can be applied to computed values as well as to individual tuples. Sh allows scalars to be promoted to tuples in the basic arithmetic operations. The ability to take derivatives of functions relative to screen-space position is important for shader antialiasing.