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 '90s, 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 .

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 backward 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
737 questions
28
votes
2 answers

What is fwidth and how does it work?

The OpenGL documentation states that fwidth returns the sum of the absolute value of derivatives in x and y. What does this mean in less mathematical terms, and is there a way to visualize it? Based on my understanding of the function, fwidth(p) has…
ApoorvaJ
  • 597
  • 1
  • 5
  • 8
26
votes
1 answer

What does "st" mean in the context of OpenGL?

I've seen the term st come up a few times when looking at other OpenGL fragment shaders. However, I don't know what it stands for or what it's used for. Here's an example: uniform vec2 u_resolution; vec2 st = gl_FragCoord.xy/u_resolution; I can…
Edward Loveall
  • 363
  • 1
  • 3
  • 7
15
votes
1 answer

OpenGL compatibility, naming conventions and ARB vs EXT

I thought I had formed a general understanding of how OpenGL naming conventions and extensions worked, until I stumbled upon a case that confused me. Here's my understanding so far: No suffix -- e.g. glGenBuffers(). This function is a part of the…
ApoorvaJ
  • 597
  • 1
  • 5
  • 8
8
votes
3 answers

Understanding VAO and VBO

I'm reading through Learn OpenGL to refresh the basic concepts as I haven't touched in quite some time. Specifically I still think I cannot quite understand the meaning of VAO and VBO, the book mainly proceeds through examples it doesn't really give…
user8469759
  • 556
  • 1
  • 6
  • 17
7
votes
1 answer

Confused about z-axis behaviour

I'm a newcomer to OpenGL and I was playing around with drawing triangles with different z-coordinates. From what I understand, the z axis point out of the screen, and the -z axis points into the screen. When I draw a square with 3 corners at a 0.0…
Chara
  • 283
  • 1
  • 11
7
votes
0 answers

Cannot use more than a couple of MB in a shader storage buffer

I am implementing a simple ray tracer with OpenGL. I have a shader storage buffer with all the triangles so I can test them for intersections in a compute shader. It works fine up to a certain buffer size. But if I have more than a certain amount,…
gartenriese
  • 171
  • 2
6
votes
2 answers

When does it make sense to use drawRangeElements

I am trying to understand when it makes sense to use the glDrawRangeElements function. The OpenGL wiki says: for optimization purposes, it is useful for implementations to know the range of indexed rendering data So, as I interpret it, if I had…
Startec
  • 781
  • 6
  • 19
6
votes
2 answers

OpenGL set a vertex element stride of zero

Problem X: I need to provide "compensation" streams for attributes that are not plugged by the mesh data, but the shader requires them. (In d3d not matching the input layout is a hard error) Solution Y: In D3D I've created a 16 bytes buffer…
v.oddou
  • 623
  • 4
  • 9
6
votes
3 answers

Turn an enclosed region into a triangle mesh

I have a (2d) region defined as a list of vertices that I'm currently drawing as a line loop in opengl. I want to draw this region solidly. I started by using triangle fan, but that doesn't work if the region has vertices positioned at the same…
Sushisource
  • 163
  • 4
6
votes
1 answer

Why is there so many macros in OpenGL?

I would just like to know why are there so many things defined as macros that point to memory addresses in OpenGL? I see them all over the place. For example when I go to choose parameters for a function such as glDrawArrays(), I have to choose a…
mbl
  • 291
  • 1
  • 8
6
votes
1 answer

Artefacts on top and bottom of utah teapot

I am implementing a simple Phong shader in OpenGL GLSL, and the test object is the utah teapot. However on the bottom I get a solid red circle, and on the top there is are sharp sectors that are coloured incorrectly. Is there any way to fix these…
Jonathan.
  • 161
  • 2
6
votes
2 answers

Always rotate in the direction of mouse movement

In my SharpGL application I do a very simple, mouse controlled rotation of the scene. gl.Rotate(cameraRotation.X, cameraRotation.Y, 0.0f); where cameraRotation.Y += MousePosition.X - previousMousePositionX; cameraRotation.X += MousePosition.Y -…
Patrick
  • 61
  • 1
  • 3
6
votes
1 answer

How to render the wireframe of a cube without the diagonals on the faces?

I'm developing with OpenGL 4.1 and have good understanding of the modern pipeline. I was thinking on doing it with GL_LINE_LOOP for each face, but I think this will require several draw calls which certainly is not optimal. What could be a better…
BRabbit27
  • 969
  • 1
  • 10
  • 21
5
votes
1 answer

Do operating programs such as Microsoft Office or Windows Explorer use OpenGL to draw?

I have a server and my only monitor is plugged into its graphics card. My question is - do all programs (Windows explorer, Excel whatever) draw their output using the graphics card and more specifically an API such as OpenGL? The output is coming…
Startec
  • 781
  • 6
  • 19
5
votes
2 answers

Why does rotation about an arbitrary axis have degree of freedom 6

I have been trying to figure out why does rotation about an arbitrary axis have degree of freedom 6. I know that it takes two points, each take 3 values to determine in a 3-D space. But what about the rotation angle? Wouldn't that make the degree of…
Louis Kuang
  • 151
  • 2
1
2 3 4 5 6 7