Programs, Parameters, and Attributes

Michael D. McCool, Stefanus Du Toit · A K Peters/CRC Press eBooks · 2009

This chapter introduces the construction of shading (Sh) program objects, and in particular the implementation of Graphics processing unit (GPU) shaders. Sh programs are defined by putting Sh into a mode that observes and records sequences of operations on Sh types, rather than executing those operations immediately. The chapter discusses Sh tuple and matrix types and showed how C++ could be used to encapsulate definitions of lighting models on these types. It focuses on the use of Sh programs for implementing single-pass GPU shaders in particular and assume that a shader compilation target is used. The scope rules and modularity constructs of C++ can be used to control which parameters get bound to which shaders. The chapter utilizes subclass capabilities of C++ to create a hierarchy of shaders and parameters. Sh permits reading from output attributes and writing to input attributes.

Cited by 0 works. doi:10.1201/9781568816692-3

Authors