PDA

View Full Version : CG & OPENGL



Powerino
04-10-2003, 03:37 AM
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?

raverbach
04-10-2003, 04:10 AM
You must call a fragment program ..there´s a lot of tutorials over the web http://www.opengl.org/discussion_boards/ubb/smile.gif

147-2
04-11-2003, 07:02 AM
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 :P

Proton
04-11-2003, 07:32 AM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif

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

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

roffe
04-11-2003, 07:50 AM
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.