Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 731
Calmarius Avatar asked Dec 04 '13 13:12

Calmarius


People also ask

Does OpenGL use GLSL?

The OpenGL Shading Language (GLSL) is the principal shading language for OpenGL.

Does blender use GLSL?

Blender supports vertex and fragment shaders in GLSL (i.e. “GLSL programs”; not to be confused with the built-in “GLSL material” or “GLSL shading”).

What are shaders used for in OpenGL?

A Shader is a user-defined program designed to run on some stage of a graphics processor. Shaders provide the code for certain programmable stages of the rendering pipeline. They can also be used in a slightly more limited form for general, on-GPU computation.

Does unity use GLSL shaders?

Furthermore, Unity supports a version of GLSL similar to version 1.0. x for OpenGL ES 2.0 (the specification is available at the “Khronos OpenGL ES API Registry”); however, Unity's shader documentation [3] focuses on shaders written in Unity's own “surface shader” format and Cg/HLSL [4].


1 Answers

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.

like image 81
datenwolf Avatar answered Sep 22 '22 10:09

datenwolf