CG & OPENGL

Anyone can teach me how CG works in OPENGL ?
When i use more textures in a fragment program CG resolves Texture Unit pass?
Another question when in opengl i use more texture coords in a vertex progam i have to call glClientActiveTextureARB and how to pass to it more texture coordinates?
Any documentation avaiable in the WEB about it?
How can i concatenate more vertex and frament program when i render a mesh?

You must call a fragment program …there´s a lot of tutorials over the web

None are much good. A lot of them detail ASM fragment programs, and not cg programs. I suggest you ask on cgshaders.org, they’ll prolly help you out, or send you back here :stuck_out_tongue:

There is a lack of good tutorials, and the examples on cgshaders.org don’t like to compile.

The best solution I found was to open the CgFX sample project that comes with the Cg Toolkit. It should be located here by default:
C:\Program Files\NVIDIA Corporation\Cg\examples\runtime_CgFX

CgFX is great because it offers a nice way of handling the materials as .fx files. AND this program compiles nicely

Other than that, check out: http://www.codesampler.com/

They have some simple and easy to follow examples of Cg and CgFX.

Originally posted by Powerino:
call glClientActiveTextureARB and how to pass to it more texture coordinates?
Any documentation avaiable in the WEB about it?

The glClientActiveTextureARB function is part of the multi texture ARB extension which is no longer available in the registry because it’s in the OpenGL 1.2 core specs. Download the specs from opengl.org to find out how it is used, or search for sample code using google.