PDA

View Full Version : cg



10-07-2003, 05:09 AM
If you have are making a program using CG and OpenGL can someone with an ATI card use it? I have a 9800 pro and i have noticed that alot of demos on cg dont work.

Leyder Dylan
10-07-2003, 05:51 AM
Here's a reply from "www.cgshaders.org"



Was Cg designed for NVIDIA chips only?

No. Cg was designed to simplify graphics programming, regardless of the hardware that it runs on. Cg allows graphics chip manufacturers to easily and effectively expose the capabilities of their hardware by writing their own Cg compilers. These manufacturers have a unique understanding of their products, and are therefore the most capable compiler writers for their particular hardware. Programs compiled with Cg run today on DirectX 8-compatible hardware, and on any other vendor's implementation of OpenGL, if it supports the NV_vertex_program extension (ARB_vertex_program support is coming soon, since it was only recently approved by the ARB).


You can find it, here :

http://www.cgshaders.org/articles/interview_nvidia-jul2002.php

10-07-2003, 06:30 AM
thanks. So you write cg code in vertex programs? not in a normal cpp or c file?

Leyder Dylan
10-07-2003, 06:40 AM
No, the source code is written in a cpp file or c and for the vertex program you have 2 choices :

1. In a text file
2. In your program

The result is the same but it's more easy to modify the vertex program code in a text file instead of modifing the source code and re-compiling.

If you want a simple example for vertex program, take a look on my website, "Download"-"Extension" section.

In my demo, I use the second choice, the vertex program is written in the source code instead of a text file.


htt://www.slug-production.be.tf/ (http://htt://www.slug-production.be.tf/)



[This message has been edited by Leyder Dylan (edited 10-07-2003).]