Is it possible to draw anything in OpenGL 3+ without writing GLSL shaders? Will it run on older computers?

StackOverflow https://stackoverflow.com/questions/20376581

  •  29-08-2022
  •  | 
  •  

Question

I'm new to OpenGL3 and now I'm considering moving to OpenGL3 and port my old code. I started reading the few tutorials I found on the web just yesterday. I already have experience with the old OpenGL. What struck me that that almost everything I know about it is deprecated/removed/burninated from the core.

So I need some pointers to understand the new architecture.

I need to pass vertex buffers to the graphics hardware, it will be faster, it's okay. But from this point tutorials move on writing and compiling GLSL shaders. Does this mean that from now I'll need shaders to accomplish even the (previously) simplest tasks and care of all the gory details? Eg. drawing a gouraud shaded triangle but making sure that it's rendered perspectively correct (fragment shader). Or doing the perspective transformations themselves (vertex "shading").

I've never written shaders or used any advanced rendering before. So it's high time to learn GLSL anyway...

Will the code work on older computers? My first computer is 9 years old (bought in 2004) and still working, many 3D games of that age worked on it without problem... Does OpenGL3 require modern hardware?

Was it helpful?

Solution

Is it possible to draw anything in OpenGL 3+ without writing GLSL shaders?

No. You must use shaders to render using the programmable pipeline.

But from this point tutorials move on writing and compiling GLSL shaders. Does this mean that from now I'll need shaders to accomplish even the (previously) simplest tasks and care of all the gory details?

Yes. But that's a good thing, because it makes things sooo much simpler. Where you had to make a plethora of OpenGL state setting calls before, now all you have to do is write it down in a concise manner and can load it with a single glUseProgram call.

Also no serious OpenGL program ever (even with old fixed function pipeline) made use of OpenGL's built-in matrix manipulation functions. The matrices are required for other things as well, so just compute them yourself and load them.

Will the code work on older computers? My first computer is 9 years old (bought in 2004) and still working, many 3D games of that age worked on it without problem... Does OpenGL3 require modern hardware?

OpenGL-3 capable hardware hit the market in late 2006. Everything sold after 2003 support OpenGL-2 just fine. GLSL based shaders got introduced with OpenGL-2 and much of what's done in OpenGL-3 can be applied to OpenGL-2 just fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top