Shader algebra
- 1 August 2004
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Graphics
- Vol. 23 (3) , 787-795
- https://doi.org/10.1145/1015706.1015801
Abstract
An algebra consists of a set of objects and a set of operators that act on those objects. We treat shader programs as first-class objects and define two operators: connection and combination. Connection is functional composition: the outputs of one shader are fed into the inputs of another. Combination concatenates the input channels, output channels, and computations of two shaders. Similar operators can be used to manipulate streams and apply computational kernels expressed as shaders to streams. Connecting a shader program to a stream applies that program to all elements of the stream; combining streams concatenates the record definitions of those streams. In conjunction with an optimizing compiler, these operators can manipulate shader programs in many useful ways, including specialization, without modifying the original source code. We demonstrate these operators in Sh, a metaprogramming shading language embedded in C++.Keywords
This publication has 26 references indexed in Scilit:
- Nonlinear optimization framework for image-based modeling on programmable graphics hardwareACM Transactions on Graphics, 2003
- C and tccACM Transactions on Programming Languages and Systems, 1999
- Composite lighting simulations with lighting networksIEEE Computer Graphics and Applications, 1998
- Interval analysis for computer graphicsACM SIGGRAPH Computer Graphics, 1992
- Generative modelingACM SIGGRAPH Computer Graphics, 1992
- Building block shadersACM SIGGRAPH Computer Graphics, 1990
- Particle animation and rendering using data parallel computationACM SIGGRAPH Computer Graphics, 1990
- Solid texturing of complex surfacesACM SIGGRAPH Computer Graphics, 1985
- Shade treesACM SIGGRAPH Computer Graphics, 1984
- Models of light reflection for computer synthesized picturesACM SIGGRAPH Computer Graphics, 1977