Skip to main content
gamedev.net
🔒 Locked

Question about Cg

Started by dead_roses 2 replies 400+ views
Original Post
dead_roses
dead_roses
Hey I have been using OpenGL for a while and decided I wanted to move on to more advanced effects. Ive decided to use Cg and was wondering if it is compatible with all GPUs? for example ATI''s GPUs. I have an nvidia card but part of the reason I went for OpenGL was so I could develope for multiple platforms so I was just wondering if it is possible to use Cg with an ATI card. I am downloading the toolkit now but i have a 56k connection so its taking a while. Also If you can use it with other cards is there some sort of file that you must include with your application in order to allow it to be used by cards that are not Nvidia? Thanks for any help, i know this has probably been asked before, but the search engine isnt working. Mostly I just want to get use to it so I will better understand the different effects it provides and then once OpenGL 2.0 comes out ill switch to that. thx again for any replies. Also I looked over their site, and couldn''t find anything on it, im sure its in the instruction manual that comes with the toolkit but just thought Id ask here to get a quicker answer.
"I don''t care what you think unless it is about me"
Yann L
Yann L
quote:

Ive decided to use Cg and was wondering if it is compatible with all GPUs? for example ATI''s GPUs


Depends. There is no inherent manufacturer dependence in Cg, only a dependence of certain OpenGL extensions. If your card (whatever manufacturer) supports those extensions, then it will support Cg.

For non nvidia cards, you need at least ARB_vertex_program support (for vertex shaders), and ARB_fragment_program (for pixel shaders). The later one is only supported on the new Radeon 9700 line.

For nvidia hardware, you have a little more choice: NV_register_combiner*, NV_vertex_program*, NV_texture_shader* are supported as well. But they will all restrict your Cg program in one way or the other, due to hardware limitations. The best bet is to use DX9-level hardware, supporting ARB_vertex_program and ARB_fragment_program.

quote:

Also If you can use it with other cards is there some sort of file that you must include with your application in order to allow it to be used by cards that are not Nvidia?


Not if you pre-compile your Cg code, in that case you don''t include anything special. If you want runtime compilation, then you need to include the Cg dll (that''s for all cards, incl. nvidia).
sjelkjd
sjelkjd
I''ve been having problems with the fragment programs generated by Cg on a Radeon 9700. It seems that any line with fancy swizzling(like "MUL R1.xyz, R1.w, R1.xyzx;") causes the program to exceed native resources. Does anyone know much about compatibility between Cg and the capabilities of the Radeon? I''d like to write shaders that run on all DX9 cards.
dead_roses
dead_roses
Thanks for the replies. I guess I will spend some time reading over the manual once my download finnishes. thx again.
"I don''t care what you think unless it is about me"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.