DDd wrote:
What are the main differences between both languages, and is the code generated by CG to GLSL efficient? I guess my question is: Is it worth it spending time learning CG if you already know GLSL? I can see how it would be efficient to just have to code one set of instructions to generate several target profiles plus hlsl code.
The differences between the languages themselves are just syntax - once you know one, you can pick up the others in a day or two.
The compilation model is a little different, mostly because CG must support multiple backends. On ATI cards, GLSL can be slightly more efficient, but on NVidia cards GLSL is implemented on top of CG (you can see this in the debug output), and should be pretty the same. This might be changing as OpenGL 3.0 shows up this September, but it might stay the same.