Clootie graphics pages

Home | Articles | Projects | Delphi | C++Builder | TMT pascal | Links | About
 
 


Site has moved to "www.clootie.ru"
Direct link to this page on new site


 
 

NVIDIA Cg - Delphi and C++Builder toolkit

  
NVIDIA Cg ToolKit logo

This page is dedicated to NVIDIA Cg support in Borland Delphi and C++Builder (including Borland C++). Here you can find headers, helper DLL's what allows NVIDIA Cg to be used with above mentioned compilers. Also samples of Cg usage are provided.

Currently Release 1.3 of NVIDIA Cg dated Jan-2005 is supported

Also you can find Release 1.2 (Feb-2004), Release 1.1 (Mar-2003) and Beta 2.1 (Sep-2002) of NVIDIA Cg Toolkit for Borland tools (with examples) at bottom of page.

NVIDIA Cg is high level C-like language for writing pixel and vertex shaders.
Delphi/C++Builder toolkit allows to use this language internaly in your programs either in DirectX or OpenGL. Cg programs are compiled internally in PixelShader/VertexShader programs under DirectX and to register combiners and VertexPrograms under OpenGL. This behaviour allows to use NVIDIA Cg language in DirectX 8.x applications on any DX8 class GPU - like ATi Radeon 8500, SiS Xabre, Matrox Parhelia, 3DLabs P10, ets. And now for DirectX9 class cards: Radeon 95xx/X800 and GeForceFX, GeForce6 series!

Release 1.3 of the NVIDIA Cg Toolkit includes the following features and improvements:

  • New 'vp40' profile, which enables texture sampling from within vertex programs
  • New 'fp40' profile, which provides a robust branching model in fragment programs, and support for output to multiple draw buffers (MRTs)
  • Support for writing more than one color output (i.e., MRTs) in the arbfp1 and ps_2* profiles
  • New semantics to access OpenGL fixed-function state vectors from within ARB_vertex_program and ARB_fragment_program
  • New -fastprecision option for arbfp*, fp30, and fp40 profiles, to use reduced precision storage (fp16) when appropriate.
Release 1.2 of the NVIDIA Cg Toolkit includes the following features and improvements:
  • Interfaces, a language construct that facilitates the creation of general, reconfigurable Cg programs
  • Unsized arrays
  • Parameter instances may be created and shared between multiple programs
  • Parameters may be marked as compile-time constants, leading to more efficient compiled code
  • enhancements in many other areas
In Release 1.1 of Cg Toolkit support for CgFX were added. CgFX is file format compatible with MS DirectX 9.0 Effect file 2.0. Main difference between MS and NVIDIA tools: NVIDIA CgFX allows to use FX 2.0 files not only in DirectX9 but in DirectX8 and OpenGL.

Note: You will need to download and install NVIDIA Cg toolkit (available here).

Info field below contains Name / Date / Size with links to file and description field contains some notes about sample and screenshot from run-time.

NVIDIA Cg headers and libraries

Info Description
cg.zip

12-Mar-2005
61Kb
Delphi adaptation of NVIDIA Cg headers. This package also includes helper DLLs needed for implementing Direct3D deprecated Cg runtime link in Delphi and CgFX API.

Download it.
CBuilder_cg.zip

12-Mar-2005
42Kb
C++Builder libraries required to compile against NVIDIA Cg toolkit. Also includes modified ICgFXEffect.h headers compatible with C++Builder and helper DLL needed for implementing CgFX runtime link in C++Builder.


Download it.

Samples from NVIDIA Cg toolkit

Info Description
ogl_runtime.zip

14-Mar-2003
74Kb
NVIDIA Cg OpenGL sample Cg OpenGL sample for Delphi. This sample designed for new (Release 1.0 and up) API.

Download source with EXE.


  
Release 1.2 of NVIDIA Cg toolkit
(deprecated and supported only for backward compatibility reasons)


NVIDIA Cg headers and libraries for Release 1.2 of toolkit

Info field below contains Name / Date / Size with links to file and description field contains some notes about sample and screenshot from run-time.
Info Description
cg.zip

14-Mar-2004
60Kb
Delphi adaptation of NVIDIA Cg headers. This package also includes helper DLL needed for implementing CgFX API.

Download it.
CBuilder_cg.zip

14-Mar-2004
44Kb
C++Builder libraries required to compile against NVIDIA Cg toolkit. Also includes modified ICgFXEffect.h headers compatible with C++Builder and helper DLL needed for implementing CgFX runtime link in C++Builder.


Download it.


  
Release 1.1 of NVIDIA Cg toolkit
(deprecated and supported only for backward compatibility reasons)


NVIDIA Cg headers and libraries for Release 1.1 of toolkit

Info field below contains Name / Date / Size with links to file and description field contains some notes about sample and screenshot from run-time.

NVIDIA Cg headers and libraries

Info Description
cg.zip

05-Apr-2003
183Kb
Delphi adaptation of NVIDIA Cg headers. This package also includes helper DLLs needed for implementing Direct3D deprecated Cg runtime link in Delphi and CgFX API.

Download it.
CBuilder_cg.zip

05-Apr-2002
145Kb
C++Builder libraries required to compile against NVIDIA Cg toolkit. Also includes modified cgD3D.h headers compatible with C++Builder and helper DLL needed for implementing Direct3D deprecated Cg runtime link in C++Builder.


Download it.

Samples from NVIDIA Cg toolkit

Info Description
ogl_runtime.zip

14-Mar-2003
74Kb
NVIDIA Cg OpenGL sample Cg OpenGL sample for Delphi. This sample designed for new (Release 1.0) API.

Download source with EXE.
runtime_d3d_depr.zip

11-Jan-2003
299Kb
NVIDIA Cg DirectX sample Cg Direct3D sample (deprecated API) for Delphi. NVIDIA modified MS DirectX 8 SDK sample "VertexShader" to get this sample.
This sample uses Pixel and Vertex Shaders internally, so to see it in full mode you should either use DirectX8 compliant video-adapter or switch to reference rasterizer under debug version of DirectX SDK.
You can read read "How to compile ObjectPascal DirectX examples" page containing instructions how to compile example in Delphi.
Note: Sample uses deprecated Cg toolkit API.

Download source with EXE.
ogl_runtime_depr.zip

11-Jan-2003
97Kb
NVIDIA Cg OpenGL sample Cg OpenGL sample for Delphi (uses deprecated API).

Download source with EXE.

Direct3D examples

Info Description
DepthColoringCG.zip

14-Sep-2002
71Kb
DepthColoring image DepthColoring sample

Direct3D DepthColoring sample demonstrate how to convert depth information to color during vertex processing with help of NVIDIA Cg. Color calculation (hue channel of HSL color model) done completely in DirectX8 vertex shader, generated by NVIDIA Cg.

In addition you can look for pure DirectX8 DepthColoring sample, what use plain vertex shader assembler syntax along with other methods of depth coloring.
This sample requires DirectX 8.1 headers and libs.

Download source with EXE.


  
Beta 2.1 of NVIDIA Cg toolkit
(deprecated and supported only for backward compatibility reasons)


NVIDIA Cg headers and libraries for Beta 2.1 of toolkit

Info Description
cg_beta.zip

27-Sep-2002
199Kb
Delphi adaptation of NVIDIA Cg headers. This package also includes helper DLL's needed for implementing Cg runtime link in Delphi.

Download it.
CBuilder_cg_beta.zip

14-Dec-2002
249Kb
C++Builder libraries required to compile against NVIDIA Cg toolkit. Also includes modified cgGL.h and totaly new cgD3D.h headers compatible with C++Builder.
Note: DirectX link for C++Builder can run into MS VC RTL runtime errors without a reason.

Download it.

Samples from NVIDIA Cg toolkit for Beta 2.1 of toolkit

Info Description
runtime_d3d_beta.zip

26-Aug-2002
297Kb
NVIDIA Cg DirectX sample Cg Direct3D sample for Delphi. NVIDIA modified MS DirectX 8 SDK sample "VertexShader" to get this sample.
This sample uses Pixel and Vertex Shaders internally, so to see it in full mode you should either use DirectX8 compliant video-adapter or switch to reference rasterizer under debug version of DirectX SDK.
You can read read "How to compile ObjectPascal DirectX examples" page containing instructions how to compile example in Delphi.

Download source with EXE.
ogl_runtime_beta.zip

26-Aug-2002
96Kb
NVIDIA Cg OpenGL sample Cg OpenGL sample for Delphi.

Download source with EXE.


Please inform me of any grammar or general errors, contained on these pages, Alexey Barkovoy
Last updated: 12-Mar-2005

Hosted by uCoz