CoSMo: Intent-based Composition of Shader Modules

Georg Haaser, Harald Steinlechner, Michael May, Michael Schwärzler, Stefan Maierhofer, Robert Tobler


We propose a novel shader programming model which operates on intent-oriented shader modules instead of specific programs for dedicated GPU rasterization pipeline stages. In constrast to existing pipeline shader frameworks, our system exposes a radically simplified pipeline, which we purposefully aligned with our basic intuition of shaders as per-primitive and per-pixel operations and compositions thereof. This simplicity lends itself to structure modules purely based on their intent, instead of dealing with structure enforced by specific versions of graphics APIs. Consequently, this offers great flexibility when it comes to reusing and combining modules with completely different semantics, or when targeting different graphics APIs. The simplicity and uniformity of our system also motivates automatic parameterization and simplification of shader programs as well as interesting interactive shader development and management techniques.


  1. Austin, C. A. (2005). Renaissance: A Functional Shading Language. Master's thesis, Iowa State University, Ames, Iowa, USA.
  2. Cook, R. L. (1984). Shade Trees. SIGGRAPH Comp. Graph., 18(3):223-231.
  3. Elliott, C. (2004). Programming Graphics Processors Functionally. In Proc. of the 2004 ACM SIGPLAN workshop on Haskell, Haskell 7804, pages 45-56, New York, NY, USA. ACM.
  4. Foley, T. and Hanrahan, P. (2011). Spark: Modular, Composable Shaders for Graphics Hardware. ACM Transactions on Graphics, 30(4):107:1-107:12.
  5. Fraser, C. W., Henry, R. R., and Proebsting, T. A. (1992). BURG: fast optimal instruction selection and tree parsing. SIGPLAN Not., 27(4):68-76.
  6. Hanrahan, P. and Lawson, J. (1990). A Language for Shading and Lighting Calculations. SIGGRAPH Comput. Graph., 24(4):289-298.
  7. Kessenich, J., Baldwin, D., and Rost, R. (2012). OpenGL Shading Language, version 4.3. Available from: (accessed 23 October 2012).
  8. Knoop, J., Rüthing, O., and Steffen, B. (1992). Lazy code motion. SIGPLAN Not., 27(7):224-234.
  9. Kuck, R. and Wesche, G. (2009). A Framework for ObjectOriented Shader Design. In Proc. of the 5th International Symposium on Advances in Visual Computing: Part I, ISVC 7809, pages 1019-1030, Berlin, Heidelberg. Springer-Verlag.
  10. Mark, W. R., Glanville, R. S., Akeley, K., and Kilgard, M. J. (2003). Cg: a system for programming graphics hardware in a c-like language. ACM Trans. Graph., 22(3):896-907.
  11. McCool, M., Du Toit, S., Popa, T., Chan, B., and Moule, K. (2004). Shader Algebra. In ACM SIGGRAPH 2004 Papers, SIGGRAPH 7804, pages 787-795, New York, NY, USA. ACM.
  12. McCool, M. D., Qin, Z., and Popa, T. S. (2002). Shader Metaprogramming. In Proc. of the ACM SIGGRAPH/EUROGRAPHICS conf. on Graph. Hardware, HWWS 7802, pages 57-68, Aire-la-Ville, Switzerland. Eurograph. Assoc.
  13. McCool, M. D. and Toit, S. D. (2004). Metaprogramming GPUs with Sh. A K Peters.
  14. McGuire, M. (2005). The SuperShader. Shader X4: Advanced Rendering Techniques, chapter 8.1, pages 485-498. Cengage Learning Emea.
  15. McGuire, M., Stathis, G., Pfister, H., and Krishnamurthi, S. (2006). Abstract Shade Trees. In Proc. of the 2006 symposium on Interactive 3D graphics and games, I3D 7806, pages 79-86, New York, NY, USA. ACM.
  16. Microsoft (2010). Shader model 5 DirectX HLSL. from: http://msdn. windows/desktop/ff471356 %28v=vs.85 %29.aspx (accessed Oct. 23, 2012).
  17. Microsoft (2012). Programming Guide for HLSL. from: http://msdn. microsoft. com/en-us/library /bb509635(v=VS.85).aspx (accessed Oct. 23, 2012).
  18. Perlin, K. (1985). An Image Synthesizer. In Proc. of the 12th annual conference on Comp. graph. and interactive techniques, SIGGRAPH 7885, pages 287-296, New York, USA. ACM.
  19. Proudfoot, K., Mark, W. R., Tzvetkov, S., and Hanrahan, P. (2001). A Real-time Procedural Shading System for Programmable Graphics Hardware. In Proc. of the 28th annual conf. on Comp. graph. and interactive techniques, SIGGRAPH 7801, pages 159-170, New York, NY, USA. ACM.
  20. Sitthi-Amorn, P., Lawrence, J., Yang, L., Sander, P. V., Nehab, D., and Xi, J. (2008). Automated ReprojectionBased Pixel Shader Optimization. ACM Trans. Graph., 27(5):127:1-127:11.
  21. Sitthi-Amorn, P., Modly, N., Weimer, W., and Lawrence, J. (2011). Genetic Programming for Shader Simplification. ACM Trans. Graph., 30(6):152:1-152:12.
  22. Trapp, M. and Döllner, J. (2007). Automated Combination of Real-Time Shader Programs. In Cignoni, P. and Sochor, J., editors, Eurographics 2007 Shortpaper, pages 53-56. Eurograph. Assoc.

Paper Citation

in Harvard Style

Haaser G., Steinlechner H., May M., Schwärzler M., Maierhofer S. and Tobler R. (2014). CoSMo: Intent-based Composition of Shader Modules . In Proceedings of the 9th International Conference on Computer Graphics Theory and Applications - Volume 1: GRAPP, (VISIGRAPP 2014) ISBN 978-989-758-002-4, pages 189-199. DOI: 10.5220/0004687201890199

in Bibtex Style

author={Georg Haaser and Harald Steinlechner and Michael May and Michael Schwärzler and Stefan Maierhofer and Robert Tobler},
title={CoSMo: Intent-based Composition of Shader Modules},
booktitle={Proceedings of the 9th International Conference on Computer Graphics Theory and Applications - Volume 1: GRAPP, (VISIGRAPP 2014)},

in EndNote Style

JO - Proceedings of the 9th International Conference on Computer Graphics Theory and Applications - Volume 1: GRAPP, (VISIGRAPP 2014)
TI - CoSMo: Intent-based Composition of Shader Modules
SN - 978-989-758-002-4
AU - Haaser G.
AU - Steinlechner H.
AU - May M.
AU - Schwärzler M.
AU - Maierhofer S.
AU - Tobler R.
PY - 2014
SP - 189
EP - 199
DO - 10.5220/0004687201890199