Questions tagged [opengl]

OpenGL is a graphics standard and API which targets the desktop and workstation markets. It is designed to be easy to accelerate with dedicated computer hardware, and hence most implementations give greatly improved performance over traditional software rendering. Currently, OpenGL is used for applications like CAD software and computer games. It is also cross-platform. The OpenGL standard is controlled by the Khronos group, which also controls OpenGL ES.

OpenGL (Open Graphics Library) is an API used to interact with GPUs (Graphics Processing Units). Originally developed by SGI (Silicon Graphics Inc.) in the early 90's, the current API is being developed by the Khronos Group.

OpenGL is platform independent and available for desktop, workstation and mobile devices. It is designed to provide hardware-accelerated rendering and is typically used for applications such as CAD software and computer games.

When posting in the tag, remember to always specify your target OpenGL version in order to get more precise answers. OpenGL ES (OpenGL for Embedded Systems) has its own tag - (with specific version tags for and .

Official Documentation

  • The Red Book - Tutorial GL
  • The Orange Book - Tutorial for GLSL
  • The Green Book - Tutorial for GLX
  • The Blue Book - API references for GL (out of print; replaced by online reference pages)
  • The White Book - Tutorial for WGL

Successor

Khronos Group announced API at GDC (Game Developers Conference) 2015. Vulkan, previously known as glNext or the "Next Generation OpenGL Initiative", is widely thought of as the successor to OpenGL and shares many similarities to the API. It is a complete redesign aimed to unify the OpenGL and OpenGL-ES API's into one common API that is not backwards compatible.

External resources

Release Dates

  • OpenGL 1.0 - January 1992
  • OpenGL 1.1 - January 1997
  • OpenGL 1.2.1 - October 1998
  • OpenGL 1.3 - August 2001
  • OpenGL 1.4 - July 2002
  • OpenGL 1.5 - July 2003
  • OpenGL 2.0 - September 2004
  • OpenGL 2.1 - July 2006
  • OpenGL 3.0 - August 2008
  • OpenGL 3.1 - March 2009
  • OpenGL 3.2 - August 2009
  • OpenGL 3.3 - March 2010
  • OpenGL 4.0 - March 2010
  • OpenGL 4.1 - July 2010
  • OpenGL 4.2 - August 2011
  • OpenGL 4.3 - August 2012
  • OpenGL 4.4 - July 2013
  • OpenGL 4.5 - August 2014
  • OpenGL 4.6 - July 2017
4339 questions
169
votes
3 answers

What is Vulkan and how does it differ from OpenGL?

Khronos Group (the standards body behind OpenGL) has just announced Vulkan : Vulkan is the new generation, open standard API for high-efficiency access to graphics and compute on modern GPUs. This ground-up design, previously referred to as the Next…
Anko
  • 13,453
  • 10
  • 57
  • 82
96
votes
9 answers

Why do we move the world instead of the camera?

I heard that in an OpenGL game what we do to let the player move is not to move the camera but to move the whole world around. For example here is an extract of this tutorial: OpenGL View matrix In real life you're used to moving the camera to alter…
danijar
  • 5,771
  • 10
  • 44
  • 65
88
votes
15 answers

What are some good learning resources for OpenGL?

I have been using the OpenGL ES on the iPhone for a while now and basically I feel pretty lost outside to the small set of commands I've seen in examples and adopted as my own. I would love to use OpenGL on other platforms and have a good…
DFectuoso
  • 916
  • 4
  • 11
  • 20
74
votes
7 answers

Good resources for learning modern OpenGL (3.0 or later)?

I stumble upon the search of a good resource to start with OpenGL (3.0 or later) . Well, I found a lot of books but none of them can be considered a good resource! Here two examples: OpenGL Programming Guide (7th edition)…
MatterGoal
  • 762
  • 1
  • 8
  • 13
66
votes
9 answers

Good GUI for OpenGL?

I am starting to learn OpenGL with FreeGLUT using the Superbible and the knowledge I have from my elementary graphics to brush up on my skills. To get more from this experience I want to integrate a GUI to overwrite the one FreeGLUT uses, now my…
Cristina
  • 400
  • 1
  • 9
  • 20
55
votes
1 answer

GLSL: How do I cast a float to an int?

In a GLSL fragment shader I am trying to cast a float into an int . The compiler raises an error: ERROR: 0:60: '=' : cannot convert from 'mediump float' to 'highp int' I tried raising the precision of the int : mediump float indexf = floor(2.0 *…
dugla
  • 1,015
  • 2
  • 12
  • 18
55
votes
1 answer

in/out keywords in GLSL

I don't really understand how to use the in / out keywords in GLSL, and google is being uncharacteristically unhelpful. What exactly do they do? How would I use them if, for example, I want to pass a varying variable set per vertex to the fragment…
Publius
  • 1,503
  • 2
  • 16
  • 23
54
votes
2 answers

After a succesful glLinkProgram, should I delete / detach my shaders?

After I have a linked program, and thinking about defensive programming, should I delete and detach the shaders used to link this program? If yes, is that going to free any resources? Or do these shader objects only going to be freed after a…
grprado
  • 705
  • 1
  • 5
  • 9
53
votes
5 answers

How to avoid texture bleeding in a texture atlas?

In my game there is a Minecraft-like terrain made out of cubes. I generate a vertex buffer from the voxel data and use a texture atlas for looks of different blocks: The problem is that the texture of distant cubes interpolates with adjacent tiles…
danijar
  • 5,771
  • 10
  • 44
  • 65
50
votes
6 answers

Is OpenGL appropriate for 2D games?

I have been teaching myself the OpenGL library for a while now, and want to start making a game. However, for an easier introduction, I want to start with something 2D, such as a top down Pokemon-style game. Is this a good plan, or is OpenGL made…
w4etwetewtwet
  • 1,047
  • 3
  • 10
  • 16
50
votes
5 answers

What is the purpose of glScissor?

I know that it is more efficient than stencil test, but am I right assuming that the same functionality could be achieved using projection transformations with viewport?
Kimi
  • 673
  • 1
  • 9
  • 15
49
votes
5 answers

Should I use textures not sized to a power of 2?

In the early days of OpenGL and DirectX, texture sizes were required to be powers of two. This meant interpolation of float values could be done very quickly, using shifting and such. Since OpenGL 2.0 (and preceding that, via an extension)…
Will
  • 7,057
  • 4
  • 40
  • 59
46
votes
6 answers

Why do we use 4x4 matrices to transform things in 3D?

To translate a vector by 10 unit in the X direction, why do we have to use a matrix? We can just add 10 to the mat[0][0], and we got the same result too.
ngoaho91
  • 734
  • 1
  • 5
  • 10
44
votes
3 answers

Why do tutorials use different approaches to OpenGL rendering?

http://www.sdltutorials.com/sdl-opengl-tutorial-basics http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/ These two tutorials use completely different approaches to get nearly the same result. The first uses things…
reynmar
  • 449
  • 5
  • 7
44
votes
10 answers

Is learning OpenGL 2.1 useless today?

I'm new to 3D OpenGL/DirectX world and I found out that OpenGL 4.1 and GLSL specifications were just released today. A friend of mine gave me the Red Book for OGL v2.1 but, as far as I've read, 3.x and 4.x differ a lot from 2.x and a lot of things…
jorge_codes
  • 2,308
  • 1
  • 19
  • 24
1
2 3
…
99 100