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
39
votes
7 answers

How to pass an std::string to glShaderSource?

I have the following code: glShaderSource(shader, 1, (const char **)data.c_str(), NULL); But it makes my program crash. How do I convert std::string into const char ** ? I also tried (const char **)& but it said "requires l-value" which I don't…
Rookie
  • 3,753
  • 5
  • 33
  • 33
39
votes
4 answers

gluLookAt explanation?

Trying to understand gluLookAt, especially the last 3 parameters. Can someone please explain ? gluLookAt(camera[0], camera[1], camera[2], /* look from camera XYZ */ 0, 0, 0, /* look at the origin */ 0, 1, 0); /* positive Y…
Johnnt Jazz
  • 391
  • 1
  • 3
  • 3
39
votes
4 answers

CMake could not find OpenGL in Ubuntu

I want to install VTK in Ubuntu. CMake sends me this error : CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) Call Stack…
guhur
  • 2,500
  • 1
  • 23
  • 33
39
votes
2 answers

How can I pass multiple textures to a single shader?

I am using freeglut, GLEW and DevIL to render a textured teapot using a vertex and fragment shader. This is all working fine in OpenGL 2.0 and GLSL 1.2 on Ubuntu 14.04. Now, I want to apply a bump map to the teapot. My lecturer evidently doesn't…
lofidevops
  • 15,528
  • 14
  • 79
  • 119
38
votes
4 answers

error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup, but this time it's NOT a Windows/Console problem!

So, the infamous error is back. The project is complaining that it can't find the main() method (that's what the error means, right). However I do have a main, and my project is a Console project, as it should be. It worked before, so I know it's…
OddCore
  • 1,534
  • 6
  • 19
  • 32
38
votes
3 answers

Vertex shader attribute mapping in GLSL

I'm coding a small rendering engine with GLSL shaders: Each Mesh (well, submesh) has a number of vertex streams (eg. position,normal,texture,tangent,etc) into one big VBO and a MaterialID. Each Material has a set of textures and properties (eg.…
Radu094
  • 28,068
  • 16
  • 63
  • 80
38
votes
5 answers

3d Accelerometer calculate the orientation

I have accelerometer values for the 3 axes (usually when there is only gravity contains data between -1.0 and 1.0 ): float Rx; float Ry; float Rz; I make some calculations, then I get the angles for each axis. float R = …
Roland Soós
  • 3,125
  • 4
  • 36
  • 49
38
votes
7 answers

How do I get the current color of a fragment?

I'm trying to wrap my head around shaders in GLSL, and I've found some useful resources and tutorials, but I keep running into a wall for something that ought to be fundamental and trivial: how does my fragment shader retrieve the color of the…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
38
votes
5 answers

When does the transition from clip space to screen coordinates happen?

I was studying the rendering pipeline and when I got to the clipping stage it was explained that from the view (eye or camera) space we have to pass to the clip space, also called normalized device space (NDC), that is a cubic space from -1 to 1.…
StrG30
  • 670
  • 1
  • 10
  • 20
38
votes
2 answers

GL_TRIANGLE_STRIP vs GL_TRIANGLE_FAN

I need an example of a polygon that can be done only by GL_TRIANGLE_STRIP and another polygon that can be done only by GL_TRIANGLE_FAN.
tiggares
  • 475
  • 1
  • 5
  • 10
38
votes
3 answers

What does it mean to normalize a value?

I'm currently studying lighting in OpenGL, which utilizes a function in GLSL called normalize. According to OpenGL docs, it says that it "calculates the normalized product of two vectors". However, it still doesn't explain what "normalized" mean. …
TheAmateurProgrammer
  • 9,252
  • 8
  • 52
  • 71
37
votes
2 answers

Pygame water ripple effect

I have Googled for it but there are no ready scripts - as opposed to the same effect on Flash. I have checked the algorithm on The Water Effect Explained and also tested an implementation of the Perlin Noise, which provides a good simulation of the…
planestepper
  • 3,277
  • 26
  • 38
37
votes
2 answers

What actually handles the drawing of the Windows Wallpaper?

I'm trying to work on a project where I can animate the windows 7 wallpaper, either with opengl/directx, or GDI. I looked into how the windows desktop windows are laid out, and i figured out the whole "Progman" -> "SHELLDLL_DefView" ->…
logisticalerror
  • 391
  • 3
  • 5
37
votes
1 answer

How do I compose a rotation matrix with human readable angles from scratch?

The one thing that has always hindered me from doing 3D programming is failing to understand how math works. I can go along with math fine in programming flow using methods and functions, then its all clear and logical to me, but in mathematical…
Tschallacka
  • 27,901
  • 14
  • 88
  • 133
36
votes
3 answers

What's the advantage of using GLuint instead of unsigned int?

I like to be more standard as possible, so why should I "constrain" my classes defining it's members as OpenGL types when I can use primitive types? Is there any advantage?
JSeven
  • 625
  • 1
  • 6
  • 12