172 Chapter 3 Renderers
repeat, or mirrored repeat). The returned value is the modification. The sampling
itself depends on the type of sampler. The base class specifies the pure virtual function
virtual ColorRGBA operator() (const float* afCoord) = 0;
Each derived class implements this according to its needs. A pixel program that uses
textures receives an array of samplers. A texture coordinate is passed to a sampler
using
operator() and the returned value is the color to be used by the pixel progr am.
For a simple base texture effect, the returned color is the pixel color.
The derived classes
SoftSampler1, SoftSampler2, and SoftSampler3 implement
texture sampling for 1-, 2-, and 3-dimensional textures, respectively. The derived
class
SoftSamplerCube