ABSTRACT

This chapter presents the basic capabilities available in shading (Sh) when it is used in immediate mode. In this mode, operations specified on Sh types execute immediately, and Sh can be used like an object-oriented matrix-vector utility library. The core types in Sh are n-tuples of numbers. Tuples have a semantic type, a length, and a storage type. Sh supports small fixed-size matrices to represent affine and projective transformations. Matrices also support swizzling and slicing. Many operators are overloaded on Sh tuple types to provide a simple interface to common functionality. Sh also provides a number of standard library functions that complement the operators. The chapter discusses several reflectance models and shows how they can be given a uniform interface and how they can be encapsulated together with their parameters.