An Effective Composition Method for Novice Shader Programmers Q. Hendrickx Computer Graphics Group, Delft University of Technology, The Netherlands R. Smelik Modelling, Simulation & Gaming Department, TNO, The Netherlands R. Bidarra Computer Graphics Group, Delft University of Technology, The Netherlands ABSTRACT Shader programming has become an increasingly impor- tant and complex task in computer graphics. Because of the in depth knowledge required to write effective and ef- ficient shader programs, novice users are finding it increas- ingly harder to construct these programs manually. As a result, several tools have been developed to assist develop- ers in producing shader programs more efficiently and easily than writing them with traditional text-based editors. Graph- based composition tools have been proposed as an attractive alternative, as shader programs are intuitively represented as a graph structure. However, such tools do not usually exploit the structural and semantic information implicitly available in the graph to assist building, understanding and debugging shader programs. This paper presents a composition method that allows novice shader programmers to quickly and interactively proto- type shader programs. This method takes advantage of a graph based composition, allowing developers to design their shaders at various levels of abstraction, effectively pro- moting node reusability. Furthermore, consistently building upon the graph’s structure and semantics, the method signif- icantly eases shader program debugging and provides very helpful insight into its workings, as demonstrated by the re- sults of the open source prototype system implemented. It is concluded that this method provides an efficient and very intuitive alternative for developing shaders. It is there- fore particularly appropriate for novice shader programmers and students. Author Keywords Graphics shaders, Novice users, ShaderComposer ACM Classification Keywords I.3.4 Computer Graphics: Graphics Utilities 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. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. CHI 2011, May 7–12, 2011, Vancouver, BC, Canada. Copyright 2011 ACM 978-1-4503-0267-8/11/05...$10.00. INTRODUCTION Starting with the introduction of programmable shaders in 2001, developers of graphics applications are given more and more freedom to customize the rendering pipeline. However, developing shaders is often complex and cum- bersome. Debugging shader code is hindered by the fact that, without specialized tools, it is not possible to introduce breakpoints, step through the code, or inspect values of lo- cal variables. Therefore, the correctness of a shader program typically has to be assessed by inspecting its visual output. Furthermore, the parallel execution of shaders makes it diffi- cult to predict the performance impacts of specific changes. Most of the time, professional shader programmers are ex- perienced enough to overcome most of the aforementioned issues. However, when someone is just starting to learn writ- ing shader programs, these problems can become major ob- stacles. Often, students will not yet be familiar with the par- allel execution and the GPU rendering pipeline, hindering them to learn the principles behind specific shading effects. To solve this problem, several tools have been introduced that aid developers in designing shaders. For example, AMD’s RenderMonkey and nvidia’s FX Composer provide real-time previews of the shader’s output, while editing the code [2] [7]. However, these tools are still based on a text- based editor, requiring the developer to directly write shader code. While current high level shader languages are some- what based on the C programming language, there are a lot of important differences that beginners will have to learn be- fore they are able to write correct and efficient shader code. A first attempt to increase the efficiency of writing shader programs was made by [4]. It introduced a system in which shader programs are represented in a structure called a shade tree. Every node in this shade tree represents an operation, the edges between the nodes are parameters. Every node produces one or more output parameters and can use zero or more input parameters. This model has proven to be very adequate for describing shader programs, as even today most shader programs can still fit into this model. However, [4] does not construct the shader program as a tree, instead the tree is generated based on a written shader program. This is different in [1], where a graphical implementation of a shade tree is introduced. This allowed users to construct shader programs through a simple user interface without requiring 1