Jump to content
  • Advertisement
Sign in to follow this  

CG and MSVC++ 2008

This topic is 2917 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, i would like to continue this thread as Im having similar problems..


Im trying to get started with cg programming. I realise that it will be complicated and specialised, but Im desperate to try and utilize the power of the graphics card to accelerate certain computational areas of a new system/game.
I have simplified certain aspects down to basic cellular automata type calculations that I beleive would be well suited to GPU and textures for input/output http://en.wikipedia.org/wiki/Cellular_automaton .

I believe I have performed the steps in the thread, such as linking the include and lib directories, putting in the .libs in additional dependencies etc, but i dont know if MSVC++ 2008 has fully integrated or not.

I take it visual studio 2008 is referred to as just '8' from the nvidia installer?

If i right click the cg file i have created (called cgfile.cg) and click properties it states custom build step and i put under additional dependencies 'cg.lib' and 'cggl.lib'. The project compiles, but i never see the cgfile.cg get built or anything and i havent put in a custom command line in the properties.
I would love to know if A) the file works, B) how to build the file C) how to call/run the compiled cg prog from c++

atm my interface looks like this: you should be able to make out the cg file code.

Click here to view full size


Share this post

Link to post
Share on other sites
I am not a CG user (but a heavy user of GLSL which is a similar GPU language), so I may be wrong, but I will guess that these two languages are very similar.

I think this is compiled by the hardware compiler on board the GPU at runtime, not by MSVC. I believe that MSVC doesn't know anything about .cg files, you essentially have to read in your .cg files as strings during runtime and upload the literal character arrays to the GPU to parse/compile it.

At least that is how it works for GLSL. You may need to implement some OpenCL/OpenGL/DirectX functionality into your project to get access to these shader compiling functions.

Hope that helps, but I may be wrong, so check around first.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!