Mark, William R.Proudfoot, KekoaKurt Akeley and Ulrich Neumann2013-10-282013-10-282001158113407X1727-3471https://doi.org/10.2312/EGGH/EGGH01/047-055The latest generation of graphics hardware supports fully programmable vertex and pixel/fragment operations, but programming this hardware at a low level is difficult and time consuming. To address this problem, we have developed a complete real-time procedural shading system that compiles a high-level shading language to programmable vertex and fragment hardware, as described in a separate publication. In this paper, we describe in detail the algorithms used by this system to generate and optimize fragment code for NVIDIAs register combiner architecture and show that our compiler generates efficient code. The register combiner architecture has some similarities to WIW CPU architectures, so we compare our compilation algorithms to those described in the literature for VLIW CPU architectures. We also discuss some of the lessons we leamed from building and using this compiler that may be useful to the designers of future programmable graphics hardware.L3.7 [Computer Graphics]Three Dimensional Graphics and RealismColorshadingshadowingand textureD.3.4 [Programming Languages]ProcessorsCompilers and code generation L3.l [Computer Graphics]Hardware ArchitectureGraphics processorsI.3.6 [Computer Graphics]Methodology and TechniquesLanguagesCompiling to a VLIW Fragment Pipeline