The Cg Toolkit is a legacy NVIDIA toolkit no longer under active development or support. Cg 3.1 is our last release and while we continue to make it available to developers, we do not recommend using it in new development projects because future hardware features may not be supported.

NVIDIA was proud to introduce programmable shading with Cg, which supported dozens of different OpenGL and DirectX profile targets. It allowed developers to incorporate interactive effects within 3D applications and share them among other Cg applications, across graphics APIs, and most operating systems (Windows XP, Vista and Windows 7, Mac OS X for Leopard, Snow Leopard & Lion, Linux 32-bit & 64-bit) as well as balance effect complexities with client GPU capabilities.

Going forward, we recommend new development with GLSL, or HLSL for Windows applications, rather than Cg.

Cg 3.1 Toolkit

Cg 3.1 is our last release and will continue to be available but with no additional support.

Download the Cg 3.1 release

Alternative solutions

There are open-source alternatives that address the effects part of Cg, CgFX.

One developed by an NVIDIA engineer, is called nvFx and is available on Github:

While it is not a replacement for CgFx, it provides an example of an effects layer close to CgFX, with even more features.

Other projects are using different approaches to address this high level management of shaders

Cg 3.1 Toolkit Features

Features include:

  • Compiler for the Cg 3.1 language
  • Cg/CgFX Runtime libraries for OpenGL and Direct3D
  • User’s Manual and documentation on the Cg Language, Runtime APIs, Cg Library, CgFX States, and Cg Profiles
  • Numerous Cg examples

The April 2012 version of Cg 3.1 added these improvements:

  • Improved GLSL support for clip semantics
  • Fixed a runtime bug concerning gp4 and gp5 geometry programs
  • Various documentation updates

The February 2012 version of Cg 3.1 added these improvements:

  • Added Cg language support for uniform buffers
  • Added OpenGL Uni?ed Buffer Object (UBO) support for buffers
  • Added OpenGL GLSL version 110 and 120 translation support
  • New tessellation examples added
  • New uniform buffer examples added
  • VC10 projects added for examples

The February 2011 version of Cg 3.0 added these improvements:

  • Improved DX11 tessellation support
  • Resolved an issue with nearly identical user defined types
  • Resolved an issue with default values from unreferenced uniform parameters
  • Support setting matrices beyond 96 float constants in the vp30 profile
  • Application supplied compilation options now override those set by cgGLSetOptimalOptions
  • Improved support for 'const' variables in the GLSL profiles
  • Added sampler state documentation

See the release notes for a complete list of changes.