skip to main content
research-article

Spark: modular, composable shaders for graphics hardware

Published:25 July 2011Publication History
Skip Abstract Section

Abstract

In creating complex real-time shaders, programmers should be able to decompose code into independent, localized modules of their choosing. Current real-time shading languages, however, enforce a fixed decomposition into per-pipeline-stage procedures. Program concerns at other scales -- including those that cross-cut multiple pipeline stages -- cannot be expressed as reusable modules.

We present a shading language, Spark, and its implementation for modern graphics hardware that improves support for separation of concerns into modules. A Spark shader class can encapsulate code that maps to more than one pipeline stage, and can be extended and composed using object-oriented inheritance. In our tests, shaders written in Spark achieve performance within 2% of HLSL.

Skip Supplemental Material Section

Supplemental Material

tp113_11.mp4

mp4

31.9 MB

References

  1. Adobe, 2011. Pixel Bender 3D. http://labs.adobe.com/technologies/pixelbender3d/.Google ScholarGoogle Scholar
  2. Austin, C., and Reiners, D. 2005. Renaissance: A functional shading language. In Proceedings of Graphics Hardware 2005, ACM, New York, NY, USA, 1--8.Google ScholarGoogle Scholar
  3. Blythe, D. 2006. The Direct3D 10 system. Transactions on Graphics 25, 3, 724--734. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Codd, E. F. 1970. A relational model of data for large shared data banks. Commun. ACM 13 (June), 377--387. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Cook, R. L. 1984. Shade trees. In Proceedings of SIGGRAPH 1984, ACM, New York, NY, USA, vol. 18, 223--231. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Hanrahan, P., and Lawson, J. 1990. A language for shading and lighting calculations. In Proceedings of SIGGRAPH 1990, ACM, New York, NY, USA, 289--298. Google ScholarGoogle Scholar
  7. Kessinich, J., Baldwin, D., and Rost, R., 2003. The OpenGL® shading language, version 1.05. http://www.opengl.org, February.Google ScholarGoogle Scholar
  8. Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C. V., Loingtier, J.-M., and Irwin, J. 1997. Aspect-oriented programming. In Proceedings of ECOOP 1997, Springer-Verlag.Google ScholarGoogle Scholar
  9. Kuck, R., and Wesche, G. 2009. A framework for object-oriented shader design. In Proceedings of ISVC 2009: International Symposium on Advances in Visual Computing, Springer-Verlag, Berlin, Heidelberg, 1019--1030. Google ScholarGoogle Scholar
  10. Lalonde, P., and Schenk, E. 2002. Shader-driven compilation of rendering assets. Transactions on Graphics 21, 3, 713--720. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Lattner, C., and Adve, V. 2004. LLVM: A compilation framework for lifelong program analysis & transformation. In Proceedings of CGO 2004: International Symposium on Code Generation and Optimization. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Lejdfors, C., and Ohlsson, L. 2004. PyFX -- an active effect framework. In Proceedings of SIGRAD 2004, Linköping University Electronic Press, Gävle, Sweden, 17--24.Google ScholarGoogle Scholar
  13. Loop, C., Schaefer, S., Ni, T., and Castaño, I. 2009. Approximating subdivision surfaces with Gregory patches for hardware tessellation. Transactions on Graphics 28, 151:1--151:9. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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. Transactions on Graphics 22, 896--907. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. McCool, M. D., Qin, Z., and Popa, T. S. 2002. Shader metaprogramming. In Proceedings of Graphics Hardware 2002, Eurographics, Aire-la-Ville, Switzerland, Switzerland, 57--68. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. McCool, M. D. 2000. SMASH: A next-generation API for programmable graphics accelerators. Tech. Rep. CS-2000-14, University of Waterloo, August.Google ScholarGoogle Scholar
  17. Microsoft, 2002. Shader model 1 (DirectX HLSL). http://msdn.microsoft.com.Google ScholarGoogle Scholar
  18. Microsoft, 2010. Direct3D 11 reference. http://msdn.microsoft.com.Google ScholarGoogle Scholar
  19. Microsoft, 2010. Effect format (Direct3D 11). http://msdn.microsoft.com.Google ScholarGoogle Scholar
  20. NVIDIA, 2010. Introduction to CgFX. http://developer.nvidia.com.Google ScholarGoogle Scholar
  21. Odersky, M., Altherr, P., Cremet, V., Emir, B., Maneth, S., Micheloud, S., Mihaylov, N., Schinz, M., Stenman, E., and Zenger, M. 2004. An overview of the Scala programming language. Tech. Rep. IC/2004/64, EPFL Lausanne, Switzerland.Google ScholarGoogle Scholar
  22. Perlin, K. 1985. An image synthesizer. In Proceedings of SIGGRAPH 1985, ACM, New York, NY, USA, vol. 19, 287--296. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Phong, B. T. 1973. Illumination for Computer-Generated Images. PhD thesis. Google ScholarGoogle Scholar
  24. Proudfoot, K., Mark, W. R., Tzvetkov, S., and Hanrahan, P. 2001. A real-time procedural shading system for programmable graphics hardware. In Proceedings of SIGGRAPH 2001, ACM, New York, NY, USA, 159--170. Google ScholarGoogle Scholar
  25. Segal, M., Akeley, K., Frazier, C., Leech, J., and Brown, P., 2010. The OpenGL® graphics system: A specification (version 4.0 (core profile) - march 11, 2010). http://www.opengl.org/registry/doc/glspec40.core.20100311.pdf.Google ScholarGoogle Scholar
  26. Sugerman, J., Fatahalian, K., Boulos, S., Akeley, K., and Hanrahan, P. 2009. GRAMPS: A programming model for graphics pipelines. Transactions on Graphics 28, 1, 1--11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Wadler, P. 1990. Comprehending monads. In Proceeding of LFP 1990: ACM Conference on LISP and Functional Programming, ACM, New York, NY, USA, 61--78. Google ScholarGoogle Scholar

Index Terms

  1. Spark: modular, composable shaders for graphics hardware

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM Transactions on Graphics
          ACM Transactions on Graphics  Volume 30, Issue 4
          July 2011
          829 pages
          ISSN:0730-0301
          EISSN:1557-7368
          DOI:10.1145/2010324
          Issue’s Table of Contents

          Copyright © 2011 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 25 July 2011
          Published in tog Volume 30, Issue 4

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader