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
36
votes
2 answers

Develop using OpenGL 4.x on OSX Big Sur

According to Apple, OpenGL is no longer supported. However, it appears v4.1 of OpenGL was supported on many devices as of July 28, 2020. I have a 2020 Macbook Pro 16" model, which does not show up on the list provided above. While I am sure some…
DeveloperRyan
  • 837
  • 2
  • 9
  • 22
36
votes
3 answers

Organizing GLSL shaders in OpenGL engine

Which is better ? To have one shader program with a lot of uniforms specifying lights to use, or mappings to do (e.g. I need one mesh to be parallax mapped, and another one parallax/specular mapped). I'd make a cached list of uniforms for lazy…
Pythagoras of Samos
  • 3,051
  • 5
  • 29
  • 51
36
votes
5 answers

When are VBOs faster than "simple" OpenGL primitives (glBegin())?

After many years of hearing about Vertex Buffer Objects (VBOs), I finally decided to experiment with them (my stuff isn't normally performance critical, obviously...) I'll describe my experiment below, but to make a long story short, I'm seeing…
Drew Hall
  • 28,429
  • 12
  • 61
  • 81
36
votes
2 answers

Difference between format and internalformat

I did search and read stuff about this but couldn't understand it. What's the difference between a texture internal format and format in a call like glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); ? Let's assume…
Dean
  • 6,610
  • 6
  • 40
  • 90
36
votes
1 answer

glVertexAttribPointer raising GL_INVALID_OPERATION

I'm trying to put together a very basic OpenGL 3.2 (core profile) application. In the following code, which is supposed to create a VBO containing the vertex positions for a triangle, the call to glVertexAttribPointer fails and raises the OpenGL…
user269597
35
votes
2 answers

Visualising 4D objects in OpenGL

Do you know of any, actively developed, C/C++ library that can take a bunch (preferably a large amount) of 4D vertices, project them back into 3D space with respect to some arbitrary "4D camera" projection matrix and output regular 3D vertices that…
MasterM
  • 1,173
  • 1
  • 9
  • 15
35
votes
3 answers

Where can I find a good online OpenGL 3.0 tutorial that doesn't use any deprecated functionality?

I just purchased the fifth edition of the OpenGL SuperBible. I'm very pleased that they've avoided using deprecated functionality but their examples make use of GLTools. GLTools provides a slew of useful functions for rendering simple 3D objects and…
Jonba
  • 1,117
  • 2
  • 11
  • 12
35
votes
3 answers

Why does GL divide `gl_Position` by W for you rather than letting you do it yourself?

Note: I understand the basic math. I understand that the typical perspective function in various math libraries produces a matrix that converts z values from -zNear to -zFar back into -1 to +1 but only if the result is divided by w The specific…
gman
  • 100,619
  • 31
  • 269
  • 393
35
votes
1 answer

Packing arbitrary triangles into a finite box?

I need to pack triangles into a box as tightly as reasonable, as part of a 3D optimization (I'm stuffing alpha-using segments of different textures into a single different texture, for use with depth-sorting, so textures don't switch with every new…
Anne Quinn
  • 12,609
  • 8
  • 54
  • 101
35
votes
1 answer

Point Sprites for particle system

Are point sprites the best choice to build a particle system? Are point sprites present in the newer versions of OpenGL and drivers of the latest graphics cards? Or should I do it using vbo and glsl?
Javier Ramírez
  • 1,001
  • 2
  • 12
  • 23
35
votes
3 answers

What does the 'iv' in glGetShaderiv() stand for?

What does the iv at the end of glGetShaderiv() stand for?
David Limkys
  • 4,907
  • 5
  • 26
  • 38
35
votes
2 answers

jMonkey optimization similar to Java3D's

Edit: For having real-time drawing, started using lwjgl which is base of jmonkeyengine and jocl in an "interoperability" between opengl and opencl, now can calculate and draw 100k particles real-time. Maybe mantle version of jmonkey engine can cure…
huseyin tugrul buyukisik
  • 11,469
  • 4
  • 45
  • 97
35
votes
3 answers

glPixelStorei(GL_UNPACK_ALIGNMENT, 1) Disadvantages?

What are the disadvantages of always using alginment of 1? glPixelStorei(GL_UNPACK_ALIGNMENT, 1) glPixelStorei(GL_PACK_ALIGNMENT, 1) Will it impact performance on modern gpus?
ronag
  • 49,529
  • 25
  • 126
  • 221
34
votes
2 answers

glm::perspective explanation

I am trying to understand what the following code does: glm::mat4 Projection = glm::perspective(35.0f, 1.0f, 0.1f, 100.0f); Does it create a projection matrix? Clips off anything that is not in the user's view? I wasn't able to find anything on the…
Trt Trt
  • 5,330
  • 13
  • 53
  • 86
34
votes
3 answers

What is hardware cursor and how does it work?

Is there anyone who can explain how hardware cursor works precisely? How does it relate to the graphics I'm drawing on the screen? I'm using OpenGL to draw, how does hardware cursor relate to OpenGL graphics? EDIT: For those who may be interested in…
Luca Carlon
  • 9,546
  • 13
  • 59
  • 91