ABSTRACT

Many types are supported by the shading (Sh) library. Two general categories of types exist: classes that provide control of constructed objects such as shaders and textures, and those that represent numerical values manipulated by expressions. Program objects can be used in expressions as subroutines, and texture objects can be used with the array-access operator to indicate texture lookups inside shaders. Instances of the ShProgram type represent compiled shader programs. Tuples are short arrays with elements of the same basic type. Tuples have a semantic type, a size, and a storage type. Tuples can be used in several different situations. If they are declared outside of a shader definition, they are considered to be parameters. Matrices in Sh are supported for the representation of linear, affine, and projective transformations. Sh has built-in support for arrays, tables and textures. Most Sh types support storing metadata with their instances.