0

I have used Opengl for a semester, but in a traditional way, like: glBegin...glEnd.

I heard someone said the GLSL is the future of OpenGL, I was just wondering do I need jump into GLSL instead of the traditional OpenGL?

Moreover, whether GLSL only works well for good GPU?

lightrek
  • 951
  • 3
  • 14
  • 30
  • 1
    glBegin/glEnd (also sometimes known as immediate mode) has been deprecated. If you are just starting out with graphics programming I would suggest just jumping straight into shaders (glsl) which are programs that run on the programmable processors of the GPU. The history is somewhat long. You can read more about it here: http://www.arcsynthesis.org/gltut/History%20of%20Graphics%20Hardware.html In general, this is an awesome resource for getting started: http://www.arcsynthesis.org/gltut/index.html Have fun. – Aeluned Jan 30 '13 at 17:30
  • Thank you for detailed instruction! – lightrek Jan 30 '13 at 21:23

2 Answers2

4

Short answer: Yes, you do need to update your OpenGL usage as you will generally get lousy performance from glBegin/glEnd and limit what you can do by constraining yourself to the old fixed pipe behavior.

Long answer:

You're mixing up two different problems. One of them is immediate mode (glBegin glVertex ... glEnd, etc.) vs. batched mode (glVertexPointer, etc.). To get full performance out of modern GPUs you need to used batches. See this SO discussion: When are VBOs faster than "simple" OpenGL primitives (glBegin())?.

The other one is fixed pipe vs. programmable shaders (glEnable states, etc.. vs. GLSL). This can be a performance issue in many cases, but more importantly it's a flexibility issue. With GLSL you have far more control over how things are rendered, so you can accomplish things that weren't really possible using the fixed pipe -- at least not at a usable frame rate. Programmable shaders are also a better reflection of how modern GPUs really work -- in fact if you use the fixed pipe it is probably just being emulated with a shader under the hood.

Community
  • 1
  • 1
Nathan Monteleone
  • 5,430
  • 29
  • 43
3

GLSL is not the future of OpenGL, it's the current way of programming. As Aeluned states, glBegin and glEnd are deprecated (and not even supported in OpenGL ES.)

And what do you mean by good GPU? Even Intel integrated graphic cards support shaders, using GLSL is not slower just for being GLSL. You might get a slow performance when doing heavy stuff, but if you implement the fixed pipeline I think you will get the same performance.

I'd say learning GLSL is the way to go.

Luke B.
  • 1,258
  • 1
  • 17
  • 28