2.4 Arrays, Tables, and Textures

Sh has support for arrays, tables and textures built in. These types represent some large indexed set of tuples, and are all templates taking a regular Sh tuple type as an argument. These types are indexed using the [] and () operators. The former uses integer-based (element) indexing, whereas the latter performs [0,1]-based (tabulated) lookups.

The only difference between the ShArray , ShTable and ShTexture classes is their default interpolation and filtering modes. Arrays use simple nearest neighbour lookups. Tables add linear interpolation to this. Textures use both linear interpolation and MIP-mapped filtering. Arrays, tables and textures can be wrapped in template types which modify these and other traits. See Section 4.2 for more information.

For more detail on arrays, tables and textures, please refer to Chapter 4.


Note: This manual is available as a bound book from AK Peters, including better formatting, in-depth examples, and about 200 pages not available on-line.