This is a collection of important OpenGL concepts you should be familiar with when working with ACGL:
- Shader: The modern OpenGL pipeline is programmable and the user has to provide simple programs for at least the vertex shading and the fragment shading step. Each Shader is one part of the pipeline (see ACGL::OpenGL::Shader class).
- Shader Program: A set of compatible Shaders that can build up the rendering pipeline (e.g. a vertex shader and a fragment shader) linked together are names a ShaderProgram. This class will be the main Shader-related class to work with. See ACGL::OpenGL::ShaderProgram.
- GLSL: The programming language in which Shaders are written. Very close to C but with some extra build-in functions and datatypes and without recursion.
Geometry to be rendered:
- Buffer: Basically just an array of unstructured data in GPU memory. See ACGL::OpenGL::Buffer
- Array Buffer (AB): A Buffer intended to hold geometry data. See ACGL::OpenGL::ArrayBuffer
- Attribute: A mesh consists of triangles, triangles consist of three vertices and each vertex can have attributes, e.g. the position, the normal, texture coordinate etc. What attributes those are and what they mean is up to the programmer. For each attribute the vertex shader features one 'in ' line.
- Element Array Buffer (EAB): In meshes, vertices are often used more than one time (means that multiple triangles share one vertex). This can be used to increase rendering speed and reduce storage size by storing the vertices once in an array buffer and define the connection and rendering order in an index. This is the element array buffer (the same is called index buffer in direct 3D). Usage of the EAB is optional! See ACGL::OpenGL::ElementArrayBuffer.
- VertexArrayObject (VAO): For rendering, OpenGL can pull the attributes defined by the user from multiple ABs at once indexed by an optional EAB. This configuration is stored in an vertex array object. It stores no data, just the meta data of how to use the unstructured buffers. This is the main class for rendering. Configure them once and call bind() & draw() for rendering each frame. See ACGL::OpenGL::VertexArrayObject. ACGL provides functions to build complete VAOs and some ABs in the background out of obj files.
Textures and Framebuffers:
- Texture: A texture is an image to put onto a mesh. It can also be used as a target to render into. There are multiple kinds of textures, 1D, 2D, 3D, arrays of textures etc. ACGL provides one class for each, e.g. ACGL::OpenGL::Texture2D. ACGL also provides functions to load textures from image files like png and ppm (but not from jpeg).
- TextureData: Just a storage class for raw image data with no OpenGL object attached. It's an intermediate representation to decouple image loading and OpenGL texture setup.
- Frame Buffer Object (FBO): To render into textures one has to render into a FBO to which the textures were attached first. To end rendering into custom frame buffers, one has to bind framebuffer 0. Rendering into multiple (same size) textures at once is possible. Textures can be used as depth buffers here too. See ACGL::OpenGL::FrameBufferObject.