Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it viable to replace GLSL with CG?

http://http.developer.nvidia.com/Cg/TessellationControlShader.html

I have some questions regarding CG.

What OpenGL version does CG support? On their site they state

Opengl Functionality Requirements

OpenGL 1.0

Which seems a little bit odd to me. For me this means that I need to have at least OpenGL 1.0 to use all OpenGL features in CG. So litteraly all new OpenGL features are missing?

Also the compute shader seems to be missing

GeometryShader, PixelShader, TessellationEvaluationShader, VertexShader, FragmentProgram, GeometryProgram, TessellationControlProgram, TessellationEvaluationProgram, VertexProgram

Is CG now a viable alternative to replace GLSL 4.x? Can I write all shaders in CG that I could write in GLSL 4.3?

like image 927
Maik Klein Avatar asked Jan 20 '13 01:01

Maik Klein


2 Answers

Cg has been end-of-lifed by NVidia so it will not be developed going forward:

The Cg Toolkit is a legacy NVIDIA toolkit no longer under active development or support. Cg 3.1 is our last release and while we continue to make it available to developers, we do not recommend using it in new development projects because future hardware features may not be supported.

So I think the best answer would be No.

like image 29
Larry Weinberg Avatar answered Sep 19 '22 22:09

Larry Weinberg


Is CG now a viable alternative to replace GLSL 4.x? Can I write all shaders in CG that I could write in GLSL 4.3?

No. While some OpenGL 4.x features, such as tessellation, are exposed as of Cg 3.1, others are not.

Notable missing features in Cg 3.1 (and their OpenGL names) include:

  • compute shaders
  • atomic counters
  • shader-writeable storage blocks (shader storage blocks)
  • shader-writable textures (image load / store)
  • runtime shader function selection (shader subroutines)

In general, Cg tends to lag two or three years behind the latest OpenGL release.

like image 156
holocronweaver Avatar answered Sep 20 '22 22:09

holocronweaver