Abstract
In order to simplify shader programming we propose a system to specify composable shaders in a functional way directly in typical implementation languages of modern rendering frameworks. 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 compositions of per-primitive and per-pixel operations. By programming the shaders in the host language, we additionally remove the complexity of handling different programming languages for shaders and the rest of the framework.
The resulting simplicity lends itself to structure modules purely based on their semantic, instead of dealing with structure enforced by specific versions of graphics APIs. Thus our system offers great flexibility when it comes to reusing and combining shaders with completely different semantics, or when targeting different graphics APIs: our high level shaders can be automatically translated into the shading language of the backend (e.g. HLSL, GLSL, CG).
Keywords
This is a preview of subscription content, log in via an institution.
References
Austin, C.A.: Renaissance: a functional shading language. Master’s thesis, Iowa State University, Ames, Iowa, USA (2005). http://www.aegisknight.org/hci_portfolio/thesis.pdf
Cook, R.L.: Shade trees. SIGGRAPH Comput. Graph. 18(3), 223–231 (1984). http://doi.acm.org/10.1145/964965.808602
Elliott, C.: Programming graphics processors functionally. Proceedings of the 2004 ACM SIGPLAN Workshop on Haskell. Haskell 2004, pp. 45–56. ACM, New York (2004)
Foley, T., Hanrahan, P.: Spark: modular, composable shaders for graphics hardware. ACM Trans. Graph. 30(4), 107:1–107:12 (2011)
Fraser, C.W., Henry, R.R., Proebsting, T.A.: BURG: fast optimal instruction selection and tree parsing. SIGPLAN Not. 27(4), 68–76 (1992). http://doi.acm.org/10.1145/131080.131089
Hanrahan, P., Lawson, J.: A language for shading and lighting calculations. SIGGRAPH Comput. Graph. 24(4), 289–298 (1990)
Kessenich, J., Baldwin, D., Rost, R.: OpenGL Shading Language, v 4.3 (2012). http://www.opengl.org/documentation/glsl/. Accessed 23 October 2012
Knoop, J., Rüthing, O., Steffen, B.: Lazy code motion. SIGPLAN Not. 27(7), 224–234 (1992). http://doi.acm.org/10.1145/143103.143136
Kuck, R., Wesche, G.: A framework for object-oriented shader design. In: Bebis, G., Boyle, R., Parvin, B., Koracin, D., Kuno, Y., Wang, J., Wang, J.-X., Wang, J., Pajarola, R., Lindstrom, P., Hinkenjann, A., Encarnação, M.L., Silva, C.T., Coming, D. (eds.) ISVC 2009, Part I. LNCS, vol. 5875, pp. 1019–1030. Springer, Heidelberg (2009)
Mark, W.R., Glanville, R.S., Akeley, K., Kilgard, M.J.: Cg: a system for programming graphics hardware in a C-like language. ACM Trans. Graph. 22(3), 896–907 (2003)
McCool, M., Du Toit, S., Popa, T., Chan, B., Moule, K.: Shader algebra. ACM SIGGRAPH 2004 Papers. SIGGRAPH 2004, pp. 787–795. ACM, New York (2004)
McCool, M.D., Qin, Z., Popa, T.S.: Shader metaprogramming. Proceedings of the ACM SIGGRAPH/EUROGRAPHICS Conference on Graphics Hardware, HWWS 2002, pp. 57–68. Eurograph. Assoc, Aire-la-Ville (2002)
McCool, M.D., Toit, S.D.: Metaprogramming GPUs with Sh. A K Peters, Stanford (2004)
McGuire, M.: The SuperShader. In: Shader X4: Advanced Rendering Techniques, chap. 8.1, pp. 485–498. Cengage Learning Emea (2005). http://www.cs.brown.edu/research/graphics/games/SuperShader/index.html
McGuire, M., Stathis, G., Pfister, H., Krishnamurthi, S.: Abstract shade trees. Proceedings of the 2006 Symposium on Interactive 3D Graphics and Games. I3D 2006, pp. 79–86. ACM, New York (2006)
Microsoft: Shader model 5 DirectX HLSL (2010). http://msdn.microsoft.com/en-us/library/windows/desktop/ff471356%28v=vs.85%29.aspx. Accessed 23 October 2012
Microsoft: Programming Guide for HLSL (2012). http://msdn.microsoft.com/en-us/library/bb509635(v=VS.85).aspx. Accessed 23 October 2012
Perlin, K.: An image synthesizer. Proceedings of the 12th Annual Conference on Computer Graphics and Interactive Techniques. SIGGRAPH 1985, pp. 287–296. ACM, N.Y. (1985)
Proudfoot, K., Mark, W.R., Tzvetkov, S., Hanrahan, P.: A real-time procedural shading system for programmable graphics hardware. Proceedings of the 28th Annual Conference on Computer Graphics and Interactive Techniques. SIGGRAPH 2001, pp. 159–170. ACM, New York (2001)
Sitthi-Amorn, P., Lawrence, J., Yang, L., Sander, P.V., Nehab, D., Xi, J.: Automated reprojection-based pixel shader optimization. ACM Trans. Graph. 27(5), 127:1–127:11 (2008). http://doi.acm.org/10.1145/1409060.1409080
Sitthi-Amorn, P., Modly, N., Weimer, W., Lawrence, J.: Genetic programming for shader simplification. ACM Trans. Graph. 30(6), 152:1–152:12 (2011). http://doi.acm.org/10.1145/2070781.2024186
Trapp, M., Döllner, J.: Automated combination of real-time shader programs. In: Cignoni, P., Sochor, J. (eds.) Eurographics 2007 Shortpaper, pp. 53–56. Eurograph. Assoc. (2007)
Acknowledgements
We would like to thank Manuel Wieser for providing 3D models, especially Eigi, The Dinosaur. The competence center VRVis is funded by BMVIT, BMWFJ, and City of Vienna (ZIT) within the scope of COMET Competence Centers for Excellent Technologies. The program COMET is managed by FFG.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Haaser, G., Steinlechner, H., May, M., Schwärzler, M., Maierhofer, S., Tobler, R. (2015). Semantic Composition of Language-Integrated Shaders. In: Battiato, S., Coquillart, S., Pettré, J., Laramee, R., Kerren, A., Braz, J. (eds) Computer Vision, Imaging and Computer Graphics - Theory and Applications. VISIGRAPP 2014. Communications in Computer and Information Science, vol 550. Springer, Cham. https://doi.org/10.1007/978-3-319-25117-2_4
Download citation
DOI: https://doi.org/10.1007/978-3-319-25117-2_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-25116-5
Online ISBN: 978-3-319-25117-2
eBook Packages: Computer ScienceComputer Science (R0)