Accelerating the convergence of film and real-time rendering
Up until now, game developers have had to use complex assembly language to create the lifelike graphics gamers experience in today’s latest games. The programming skills required to truly bring these games to life are only possessed by a select group of programmers and requires an extensive amount of time and patience to be done properly. In today’s fast-paced world, game developers are often placed under intense time constraints, while others lack the resources to bring in top-notch talent. With economic pressure continuing to hamper game developers while the complexity of modern graphics also continues to increase, life in the game development field has never been tougher. In an attempt to alleviate some of the pressure on 3D content developers, NVIDIA has been working behind closed doors on its Cg graphics programming language.
Cg (“C” for graphics) is a high-level graphics programming language NVIDIA has developed in cooperation with Microsoft for game developers and other 3D content developers to ease the process of bringing 3D objects to life on your computer screen. Besides the language itself, NVIDIA has developed a toolkit that consists of the Cg compiler, Cg browser, Cg standard library, and a variety of pre-written Cg shaders that can be used in game development, digital content creation, and computer-aided design applications.
In today’s programming environment, programmers are forced to code directly to the hardware itself. As we discussed earlier, this is done in low-level assembly code. Cg replaces the abstract assembly code with more familiar syntax that resembles a programming language all programmers are familiar with: C. As a result, a graphics effect that once took dozens (or even hundreds) of lines of code has been simplified to only a handful of lines.
Assembly vs. Cg
Cg in action
The illustrations above highlight the difference between assembly and Cg for content creation developers. As you can see Cg has simplified the process of bringing objects to life substantially. If you were a programmer, which language would you prefer to code in?