Nvidia intros Cg -- new high-level graphics language

Graphics chip maker Nvidia on Thursday took the wraps off of Cg. Described as "C for graphics," Cg is a new high-level graphics programming language and is being promoted not just as a solution for Nvidia products but also comparable hardware from other companies. It's fully cross-platform, too.

Cg is intended to help ease development of applications that will leverage underutilized capabilities of Nvidia's hardware, and while games stand to obviously benefit from Cg, that's hardly the only application. The news immediately drew positive reactions from prominent game programmers, cinema technologists and many others in various fields that stand to benefit from the new technology.

"Cg makes it much easier for developers to create cinematic style graphics and special effects," Jim Black of Nvidia developer marketing told MacCentral.

Nvidia's current and future graphics technology supports vertex and pixel shaders. When utilized, such technology yields remarkably realistic lighting and shading effects in 3D games and other 3D applications, but presently, only a very small minority of programmers are using them. That's because the barrier to entry is the way in which such technology is programmed: Using assembly code, an extremely low-level programming language that, while bringing the programmer close to the hardware, isn't something the majority of game developers feel comfortable using on a daily basis.

"There are a finite number of people on the planet that can operate at that level of programming experience. Not only does Cg expand the base of people who can program shaders, but it offers much easier debugging for developers who already program in assembly," said Black.

Black also explained that while Nvidia's own Cg compiler is heavily optimized for their own hardware, the company is offering an open source version that can be optimized to work with other manufacturer's graphics hardware as well. ATI, for example, produces Radeon graphics chips that sport programmable vertex and shader capabilities.

The Cg Toolkit itself is expected to be released for download from Nvidia's Web site beginning today. It'll also be available to European developers attending "The Gathering 2" conference in London today and tomorrow.

The initial release of the toolkit, a beta version, includes the compiler, a prototyping and visualization environment called Cg Browser, the Cg Standard Library, and a set of pre-written shader examples.

The toolkit is forward and backward compatible, thanks to Nvidia's own Unified Driver Architecture (UDA). Likewise, Cg employs a Unified Compiler Architecture that makes it possible for programs to run on future or past generations of Cg-compatible graphics processing units (GPUs), optimized at run-time for the specific GPU in the system.

This means that developers who use Cg won't have to manually optimize their code for each generation of GPU that's released. Nvidia vice president of marketing Dan Vivoli said, "Because we do the heavy lifting with our Cg Compiler, developers can spend more time on the creative side of game development."

And what's the significance of this for Mac users and Mac developers?

"Cg is inherently a lingua franca," explained Black. "The same shader you write will run on a variety of operating systems. It will also compile to different APIs, like DirectX and OpenGL."

And while Nvidia makes it clear that it has worked closely with Microsoft in developing the new language to support features in DirectX 9.0, Black added that Nvidia and Apple are working closely together to make sure that Mac OS X will experience benefits from Cg.

"When Nvidia first shipped the GeForce2 MX, we committed to supporting the Macintosh with all future GPUs," said Black. "This announcement extends our commitment to software as well."

(MacCentral is an affiliate of PC World).

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Peter Cohen

PC World
Show Comments

Brand Post

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Tom Pope

Dynabook Portégé X30L-G

Ultimately this laptop has achieved everything I would hope for in a laptop for work, while fitting that into a form factor and weight that is remarkable.

Tom Sellers


This smart laptop was enjoyable to use and great to work on – creating content was super simple.

Lolita Wang


It really doesn’t get more “gaming laptop” than this.

Jack Jeffries


As the Maserati or BMW of laptops, it would fit perfectly in the hands of a professional needing firepower under the hood, sophistication and class on the surface, and gaming prowess (sports mode if you will) in between.

Taylor Carr


The MSI PS63 is an amazing laptop and I would definitely consider buying one in the future.

Christopher Low

Brother RJ-4230B

This small mobile printer is exactly what I need for invoicing and other jobs such as sending fellow tradesman details or step-by-step instructions that I can easily print off from my phone or the Web.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?