Jump to content
  • Advertisement
Sign in to follow this  
ATC

Cg Shader Language?

This topic is 2274 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

I've been a DirectX guy for quite a few years, but now that I'm working on a platform/API-agnostic engine, I'm getting my feet wet with OpenGL concepts and programming, learning to take my knowledge of DirectX and "convert" it to the OpenGL world. Sometimes this is rather hard! I find that the programming itself is the easiest part, whilst design decisions are the most difficult. And I'm stuck on yet another design decision!

I know that Cg shader language is compatible with DirectX and OpenGL... This sounds quite appealing, as HLSL and GLSL are specific to DirectX and OpenGL, respectively. However, this wonderful rose seems to have its thorn too... I've been told that Cg is barely (or not at all) supported by nVidia anymore. Another person said "[it] was a good language, but never quite lived up to its expectations". I've also read in quite a few places that Cg doesn't even work correctly with most new cards, and only works well with older hardware... Is any of this true, or are these opinions/facts themselves incorrect and/or outdated?

I'd really like to know if Cg is competitive with HLSL and GLSL, as it was intended to be? Does it support modern shading features and new hardware? Is nVidia/Microsoft continuing to support and improve the language the way HLSL and GLSL are continuously supported/expanded? The reason I'd like to know is because I'm considering the idea of supporting Cg in my engine if it can indeed be every bit as good as the "native" shading languages of D3D and OGL...and work just as well with new hardware and modern shading techniques.

Any help or useful information you can give about this will be greatly appreciated and +1'ed!!!

Regards,

ATC

Share this post


Link to post
Share on other sites
Advertisement
Cg is obsolete.

GLSL and HLSL are very close conceptually, and it'd probably not be too much trouble to port from one to the other, or to even write some tools so that one source file in a third language could generate code for both -- perhaps using something as simple as a macro pre-processor or something like perl, sed or awk.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!