Jump to content

  • Log In with Google      Sign In   
  • Create Account

Traditional OpenGL vs GLSL vs CG


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 superwave   Members   -  Reputation: 200

Like
0Likes
Like

Posted 30 January 2013 - 10:11 AM

Hi,

 

I was just wondering which of the three is best right now?

 

I used traditional OpenGL like glBegin...glEnd. 

 

Last semester, I tried GLSL, which I think is more flexible, however, not so intuitive and very time consuming (Maybe I am not proficient)

 

One student recommend CG programming.

 

How do you think? 

 

Cheers



Sponsor:

#2 mhagain   Crossbones+   -  Reputation: 8278

Like
2Likes
Like

Posted 30 January 2013 - 11:21 AM

What you're calling "traditional OpenGL" is actually deprecated functionality that is no longer likely to be supported in hardware.

 

It's important to remember that glBegin/glEnd pairs (also known as immediate mode) was always the slowest path, even in the pre-GLSL days, when use of vertex arrays would be what you would want if performance mattered to you.  Vertex arrays, by the way, are a feature going all the way back to GL1.1 in 1997 (they were even available under GL1.0 - even earlier - as an extension) so they should not be considered any kind of "new way of doing things" either.

 

It's also important to realize that you're actually talking about two different things here.  GLSL is not a replacement for glBegin/glEnd pairs and it's perfectly possible to use GLSL with glBegin/glEnd.  GLSL is a replacement for glTexEnv calls (as well as a few other things unrelated to glBegin/glEnd), and when you start trying to express any kind of moderately complex texturing setup using glTexEnv/etc you'll quickly see how much simpler a shader-based approach is (and that's not even saying anything about those things that glTexEnv/etc just flat-out cannot do).

 

Cg is just another shading language so that's a matter of personal preference (so long as you're sticking with OpenGL) more than anything else.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 BornToCode   Members   -  Reputation: 948

Like
1Likes
Like

Posted 30 January 2013 - 11:21 AM

GLSL works only on OpenGL, like HLSL only works for DirectX. CG is made and managed by NVIDIA and it works in Both OpenGL and DirectX. The best way to look at this is if you are making an engine where you will have both DirectX and OpenGL for your rendering and one to have a single shader code based then by all mean use CG. But if your engine is going to be specific then use either HLSL if you are going to use DirectX or use GLSL if you are going to use OpenGL.



#4 superwave   Members   -  Reputation: 200

Like
0Likes
Like

Posted 30 January 2013 - 03:30 PM

Thanks a lot. I will follow your words and ready for GLSL!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS