
20312.3 Shader Generation
12.3.3 Shader Graph Traversal and Compilation
A shader graph is a directed acyclic graph and has a straightforward internal compilation
mechanism. As the path is traversed, each node’s output is followed. e output from the
previous node becomes the input for the next node in the graph. For a shader node to be
taken into account during compilation, it must ultimately traverse to gl_FragColor
(seeFigure12.8). During each traversal, dierent fragment shader parts are gathered.
e nal node output is the fragment shader gl_FragColor, and the nal traversal
produces the main() function. is ensures that m ain() always ...