Questions tagged [opengl]

OpenGL (Open Graphics Library) is a graphics standard and API which is platform independent and available for desktop, workstation and mobile devices. It is designed to provide hardware-accelerated rendering, and hence gives greatly improved performance over traditional software rendering. OpenGL is used for applications like CAD software and computer games. The OpenGL standard, as well as OpenGL ES, is controlled by the Khronos group.

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.

The tag should only be used for questions about desktop OpenGL. OpenGL ES (OpenGL for Embedded Systems) and WebGL have their own tags - and . When posting in the tag, remember to always specify your target OpenGL version in order to get more precise answers. The tags , , and exist for this purpose.

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 will not be backwards compatible.

External resources

Unofficial Tutorials

Books

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 31, 2017
37973 questions
49
votes
4 answers

How to calculate Tangent and Binormal?

Talking about bump mapping, specular highlight and these kind of things in OpenGL Shading Language (GLSL) I have: An array of vertices (e.g. {0.2,0.5,0.1, 0.2,0.4,0.5, ...}) An array of normals (e.g. {0.0,0.0,1.0, 0.0,1.0,0.0, ...}) The position of…
user464230
  • 876
  • 2
  • 11
  • 21
49
votes
2 answers

Why does my OpenGL Phong shader behave like a flat shader?

I've been learning OpenGL for the past couple of weeks and I've run into some trouble implementing a Phong shader. It appears to do no interpolation between vertexes despite my use of the smooth qualifier. Am I missing something here? To give credit…
Jonba
  • 1,117
  • 2
  • 11
  • 12
48
votes
2 answers

VBOs with std::vector

I've written a model loader in C++ an OpenGL. I've used std::vectors to store my vertex data, but now I want to pass it to glBufferData(), however the data types are wildly different. I want to know if there's a way to convert between std::vector to…
Bojangles
  • 99,427
  • 50
  • 170
  • 208
48
votes
2 answers

Use of Vertex Array Objects and Vertex Buffer Objects

I am trying to understand these two, how to use them and how they are related. Let's say I want to create a simple terrain and a textured cube. For both objects I have the array of triangles vertices and for the cube I have an array containing the…
ali
  • 10,927
  • 20
  • 89
  • 138
48
votes
1 answer

What does ARB mean in the opengl functions?

This should be easy one, I just haven't found any reference to that.
Newbie
47
votes
5 answers

Overlaying on a 3D fullscreen application

I want to display some custom graphics on top of a 3rd party fullscreen Windows application. Have you played any Steam games? It has an executable, GameOverlayUI.exe that lets you access Steam windows from within a game. (The GUI elements look…
aib
  • 45,516
  • 10
  • 73
  • 79
47
votes
3 answers

How to initialize a glm::mat4 with an array?

I'm using the OpenGL Mathematics Library (glm.g-truc.net) and want to initialize a glm::mat4 with a float-array. float aaa[16]; glm::mat4 bbb(aaa); This doesn't work. I guess the solution is trivial, but I don't know how to do it. I couldn't find a…
j00hi
  • 5,420
  • 3
  • 45
  • 82
46
votes
6 answers

ImportError: No module named OpenGL.GL

I'm trying to run NeHe's tutorial here using Python 2.7.3, but It's throwing the error ImportError: No module named OpenGL.GL So how do I fix that? This is the code: from OpenGL.GL import *
CyanPrime
  • 5,096
  • 12
  • 58
  • 79
45
votes
4 answers

how to enable vertical sync in opengl?

How do you enable vertical sync? Is it something simple like glEnable(GL_VSYNC)? (though there's no such thing as GL_VSYNC or anything like it in the options that glEnable accepts). or is there no standard way to do this in opengl?
hasen
  • 161,647
  • 65
  • 194
  • 231
45
votes
2 answers

What is the difference between OpenGL and XRender in KDE Desktop Effects?

In KDE environment when you go to Desktop Effects and in the Advanced tab there is an option named "Compositing type" which can be set to OpenGL or XRender. What is the difference between these two options? What's the use case of each option?
Nejat
  • 31,784
  • 12
  • 106
  • 138
45
votes
4 answers

Using OpenGL with Python

So, I only know how to use Python, but I also know how to model in 3d. I've heard of OpenGL and I really want to learn how to use, because it seems very useful (I want to create simple games with it...). I found PyOpenGL, Python bindings for OpenGL,…
Antoni4040
  • 2,297
  • 11
  • 44
  • 56
45
votes
1 answer

Efficient off-screen rendering of QPainterPaths (OpenGL and non-OpenGL solution required)

In my application, I paint a street map using QPainter on a widget made by QPainterPaths that contain precalculated paths to be drawn the widget is currently a QWidget, not a QGLWidget, but this might change. I'm trying to move the painting…
leemes
  • 44,967
  • 21
  • 135
  • 183
44
votes
7 answers

Initializing OpenGL without GLUT

every introduction and sample that I can find seems to use GLUT or some other framework to "initialize" OpenGL. Is there a way of initializing OpenGL with just what is available in GL and GLU? If not, then what is GLUT doing that is not possible…
TholePin
44
votes
2 answers

ffmpeg video to opengl texture

I'm trying to render frames grabbed and converted from a video using ffmpeg to an OpenGL texture to be put on a quad. I've pretty much exhausted google and not found an answer, well I've found answers but none of them seem to have worked. Basically,…
Infiniti Fizz
  • 1,726
  • 4
  • 24
  • 40
44
votes
5 answers

OpenGL vs OpenGL ES 2.0 - Can an OpenGL Application Be Easily Ported?

I am working on a gaming framework of sorts, and am a newcomer to OpenGL. Most books seem to not give a terribly clear answer to this question, and I want to develop on my desktop using OpenGL, but execute the code in an OpenGL ES 2.0 environment. …
Heat Miser
  • 19,438
  • 7
  • 35
  • 38