NVIDIA CgFX program
File type: Source code and script file
The .cg file extension identifies source files for shader programs written in NVIDIA Cg, a programming language for graphics processing.
A .cg file contains human-readable Cg shader code and can be compiled by the Cg Toolkit for use in supported graphics applications.
File type category:
Source code and script file
Date updated: October 12, 2026
NVIDIA Cg is a shader programming language designed for writing programs that run on graphics processing units. A .cg file can contain shader source code, including program logic, parameters, declarations, and other settings used to control graphics rendering.
The file belongs to the Cg development workflow rather than being a standalone image or model. The Cg compiler processes the source for a supported graphics environment, while an application or engine loads and uses the resulting shader program.
The Cg Toolkit was available for Microsoft Windows and is now a legacy, discontinued technology. Existing .cg files may still be maintained for older projects, but newer graphics projects generally use more current shader languages and toolchains.
On Microsoft Windows, several NVIDIA programs, including the Cg Toolkit, can be used to open and edit a .cg file. Because the file is plain-text source code, it can also be viewed or edited in a text editor, although a text editor cannot compile or test the shader.
The CUDA Toolkit is intended for CUDA development and is not normally used to edit or compile NVIDIA Cg shader source.
A .cg file is source code, so it does not have a useful general-purpose conversion to another file format. The Cg Toolkit can compile it into output suitable for a supported graphics environment, but that is a build step rather than a conversion of the source file.
Moving the shader to another language normally requires manual rewriting and adaptation to the target graphics API.
Software applications that can open cg files:
Microsoft Windows
Software applications that can edit cg files:
Microsoft Windows
Software capable of saving cg files:
Microsoft Windows
Software apps that create cg files:
Microsoft Windows
Software applications that handle other tasks involving cg files:
Microsoft Windows