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.
Supplemental Material
- Adobe, 2011. Pixel Bender 3D. http://labs.adobe.com/technologies/pixelbender3d/.Google Scholar
- 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 Scholar
- Blythe, D. 2006. The Direct3D 10 system. Transactions on Graphics 25, 3, 724--734. Google ScholarDigital Library
- Codd, E. F. 1970. A relational model of data for large shared data banks. Commun. ACM 13 (June), 377--387. Google ScholarDigital Library
- Cook, R. L. 1984. Shade trees. In Proceedings of SIGGRAPH 1984, ACM, New York, NY, USA, vol. 18, 223--231. Google ScholarDigital Library
- 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 Scholar
- Kessinich, J., Baldwin, D., and Rost, R., 2003. The OpenGL® shading language, version 1.05. http://www.opengl.org, February.Google Scholar
- 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 Scholar
- 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 Scholar
- Lalonde, P., and Schenk, E. 2002. Shader-driven compilation of rendering assets. Transactions on Graphics 21, 3, 713--720. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- McCool, M. D. 2000. SMASH: A next-generation API for programmable graphics accelerators. Tech. Rep. CS-2000-14, University of Waterloo, August.Google Scholar
- Microsoft, 2002. Shader model 1 (DirectX HLSL). http://msdn.microsoft.com.Google Scholar
- Microsoft, 2010. Direct3D 11 reference. http://msdn.microsoft.com.Google Scholar
- Microsoft, 2010. Effect format (Direct3D 11). http://msdn.microsoft.com.Google Scholar
- NVIDIA, 2010. Introduction to CgFX. http://developer.nvidia.com.Google Scholar
- 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 Scholar
- Perlin, K. 1985. An image synthesizer. In Proceedings of SIGGRAPH 1985, ACM, New York, NY, USA, vol. 19, 287--296. Google ScholarDigital Library
- Phong, B. T. 1973. Illumination for Computer-Generated Images. PhD thesis. Google Scholar
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 Scholar
Index Terms
- Spark: modular, composable shaders for graphics hardware
Recommendations
Spark: modular, composable shaders for graphics hardware
SIGGRAPH '11: ACM SIGGRAPH 2011 papersIn 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. ...
Deep screen space
I3D '14: Proceedings of the 18th meeting of the ACM SIGGRAPH Symposium on Interactive 3D Graphics and GamesComputing shading such as ambient occlusion (AO), subsurface scattering (SSS) or indirect light (GI) in screen space has recently received a lot of attention. While being efficient to compute, screen space methods have several key limitations such as ...
Real-time high-quality View-Dependent Texture Mapping using per-pixel visibility
GRAPHITE '05: Proceedings of the 3rd international conference on Computer graphics and interactive techniques in Australasia and South East AsiaWe present an extension of View-Dependent Texture Mapping (VDTM) allowing rendering of complex geometric meshes at high frame rates without usual blurring or skinning artifacts. We combine a hybrid geometric and image-based representation of a given 3D ...
Comments