Where to get started learning to use CG 2.0?

Started by
11 comments, last by MARS_999 15 years, 8 months ago
I've been looking for a simple example of how to use CG 2.0. I can find stuff about how to use the older versions but I'm not sure where to look for a example of how CG 2.0 works. Can someone point me in the right direction?
This is your life, and it's ending one minute at a time. - Fight club
Advertisement
http://developer.nvidia.com/object/cg_toolkit.html

Quote:Original post by MARS_999
http://developer.nvidia.com/object/cg_toolkit.html


Already been there no samples and the tutorials are old...
This is your life, and it's ending one minute at a time. - Fight club
Some of these use CG 2.0

http://developer.download.nvidia.com/SDK/10/opengl/samples.html
Quote:Original post by Moonshoe
Some of these use CG 2.0

http://developer.download.nvidia.com/SDK/10/opengl/samples.html


Two of them do but the code they use is kinda complex. I was looking for something like a program that creates a window and draws a triangle that's using a vertex and pixel shader.

I love Nvidia but there sample code is a little bit hard for a beginner to understand.
This is your life, and it's ending one minute at a time. - Fight club
Vertex and pixel shader tutorials.
Quote:Original post by Moonshoe
Vertex and pixel shader tutorials.


"The first step (if it hasn’t been done already) is to download the Cg Compiler from nVidia. It is important that you download version 1.1, as nVidia appear to have made changes between version 1.0 and 1.1 (different variable naming, replaced functions, etc…), and code compiled for one may not necessarily work with the other."

As you can see this tutorial is for version 1.1 not 2.0

And the other one just makes no since to me because it's telling you how to load the pixel shader without telling how to do anything else such as how to load the header files etc.

[Edited by - EmptyVoid on July 25, 2008 3:59:11 AM]
This is your life, and it's ending one minute at a time. - Fight club
I started with CG 1.5 and only used the CgUsersManual.pdf that comes along with the download. This describes the functionality quite well, has short examples of how to load, compile and use shaders and some short samples as well.

Give it a try, the API isn't that complicated and if you have loaded your first shader it will get easier. Then start and look at other shaders (CG, GLSL, HLSL doesn't matter since the syntax is pretty similar and the most important things are the algorithms).
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
Quote:Original post by Lord_Evil
I started with CG 1.5 and only used the CgUsersManual.pdf that comes along with the download. This describes the functionality quite well, has short examples of how to load, compile and use shaders and some short samples as well.

Give it a try, the API isn't that complicated and if you have loaded your first shader it will get easier. Then start and look at other shaders (CG, GLSL, HLSL doesn't matter since the syntax is pretty similar and the most important things are the algorithms).


It is very important that I use CG 2.0 since it is the only version that supports the features of DirectX10 and I would think to use these features it would have needed to change allot form the older versions.
This is your life, and it's ending one minute at a time. - Fight club
I didn't switch over to CG2.0 but I assume it should also have a users manual.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!

This topic is closed to new replies.

Advertisement