Does any one use Nvidia's Cg?
Ive been thinking about triing it out. But to learn it takes quite an investment. Has any one tried it? Any reasion not to use it? Is it worth triing?
Thanks
i use Cg. u are right though, it does take a long time to learn it. if u know c++ then you are ready to go. it just takes a while to get your head around the semantics and a lot of the effects it covers.
there is a forum that i found thats called cgshaders.org. everyone there programs with it.
one thing to remember... make sure you have ALL OF THE SEMICOLONS ( ; ) IN THE RIGHT PLACES!!! trust me. i thought my application was not loading the shader right. o well thats just me.
quick answer for you learn it. its much easier than using assembly.
[edited by - adam17 on October 12, 2003 1:42:44 AM]
there is a forum that i found thats called cgshaders.org. everyone there programs with it.
one thing to remember... make sure you have ALL OF THE SEMICOLONS ( ; ) IN THE RIGHT PLACES!!! trust me. i thought my application was not loading the shader right. o well thats just me.
quick answer for you learn it. its much easier than using assembly.
[edited by - adam17 on October 12, 2003 1:42:44 AM]
how exactly does Cg work? Does it comile into a separate exe? Or can you put it inside your own program ?
well u can do it one of two ways. you can run the vertex or fragment program through the cg compiler and get either a .vp or .fp file out of it which you load into your application. the other way is to compile the code at run time. doing it at run time you must include a lot of other files for the release.
Ok cool. Is there a prefered tutorial for using cg? There is that one book, but i would like to try cg before investing money to get a book on it.
Poor college student syndrome
Poor college student syndrome
I learned Cg, now I use HLSL. The two are based on the same syntax and libraries. DirectX takes care of the compilation for you. Other problem was that Cg wouldn''t compile any fragment shaders on my Radeon 9200 but HLSL would.
Tom
Tom
I''m also using Cg. It''s very good and much easier than using ASM code. It''s just like normal C but with new data types such as vector floats and matrix floats and some graphics specific functions.
If you compile Cg code using the runtime method (you have to include header files and libraries) the runtime-compiler tries to improve the performance of your Cg shaders based on the hardware it runs on.
I bought NVidia''s "The Cg Tutorial" book and it is really helpful if you want to get into shader programming (using Cg), but you should already be familiar with C/C++. So you should get ahead with it even if you are a beginner (though I wouldn''t suggest beginners to start with shaders ) But I believe there are some tutorials on the net, too (check NVidia and Google for Cg/HLSL). adam17 already mentioned www.cgshaders.org, they have a good forum and some shader samples for you.
If you compile Cg code using the runtime method (you have to include header files and libraries) the runtime-compiler tries to improve the performance of your Cg shaders based on the hardware it runs on.
I bought NVidia''s "The Cg Tutorial" book and it is really helpful if you want to get into shader programming (using Cg), but you should already be familiar with C/C++. So you should get ahead with it even if you are a beginner (though I wouldn''t suggest beginners to start with shaders ) But I believe there are some tutorials on the net, too (check NVidia and Google for Cg/HLSL). adam17 already mentioned www.cgshaders.org, they have a good forum and some shader samples for you.
its taken me a while to learn how to use them, but let me tell you this, its taken me a LONG time to learn it. i bought the book when it came out in early may. im still having a hard time getting some basics. of course the reason for that could be i have not spent day after day grinding it into my head. o well.
quote:Original post by skow
Any reasion not to use it?
Yes there is a 'reasion' at least : with Cg you can't fully control the GL state changes. That's a good point as well as a bad point.
The good point is that Cg handles everything for you (well, almost everything ). The bad point is that you can't fully optimize your engine since you don't know which GL calls are performed inside the Cg functions.
[edited by - vincoof on October 13, 2003 3:37:33 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement