Thursday, April 16, 2026

Synopsis


The following discusses different topics in Modern OpenGL Tutorials.
______________________________________________________________________________________________________________________________________________________________________
Introduction
The following discusses different topics in Modern OpenGL Tutorials.OpenGL is a graphics library that can be used to render interactive 2D and 3D graphics applications.OpenGL has wide range of applications.This tutorials attempts to teach basic to advanced concepts one at a time. The goal is to create an advanced , multifunctional library from scratch. The tutorials will be a set of C++ header (.h) files.This tutorial is primarily targeted for windows OS. Visual Studio development environment is used for writing, compiling and debugging the code.
______________________________________________________________________________________________________________________________________________________________________

Implementation - Initializing OpenGL Context
OpenGL is a drawing library that requires a context to draw upon. 
Creating OpenGL context in windows OS is not a trivial task. It's mainly because opengl32.lib supplied by windows OS supports OpenGL specification 1.1. 
The display card providers such as NVidia or Intel or AMD actually implement the latest and greatest OpenGL specification, including additional functionality and supply it as OpenGL Installable Client Driver or ICD.
______________________________________________________________________________________________________________________________________________________________________
Lesson01 : Initializing OpenGL Context
This lesson discusses  implementing the basic operations of creating a hosting window, Initializing it with OpenGL context, rendering it and handle mouse/keyboard inputs.
______________________________________________________________________________________________________________________________________________________________________
Primer: Vector
Vectors are widely used  in 3D calculations. A 3D vector is represented as [Vx, Vy,  Vz] where  Vx, Vy and Vz represent numbers in 3D cartesian space.
______________________________________________________________________________________________________________________________________________________________________
Primer: Matrices and Affine transformations
OpenGL uses matrix operations for a lot of purposes. For example, translations, scaling, rotations. Also computing of projection matrices, view matrices etc. The following discusses it in detail.
______________________________________________________________________________________________________________________________________________________________________
Implementation - BaseCamera and Camera Data
Camera is used for projections and animations. It holds camera data which is used for storing mouse and keyboard input information. Further, it stores computed transformation information such as pitch, yaw and roll angles, translation, scaleby as well as Model, View and Projection matrix information of the 3D object. 
______________________________________________________________________________________________________________________________________________________________________
Primer: Graphics Pipeline
A scene consists of  a set of  3D objects. Transformations such as translation, scaling and rotation as a result of Camera movement, mouse and keyboard input brings them into life. 
For example  the following diagram shows a multi color cube with  50 degrees pitch and 20 degrees yaw.____________________________________________________________________________________________________________________________________________________________________
Implementation:Vertex Buffer
In this post we shall deep dive and understand mechanics behind sending vertex data to the GPU. Vertex data is obtained from mesh objects such as cubemesh which will be discussed later. The vertex data consists of Position, Color, Normal, and Texture Coordinate of each vertex. They are basically stored into VBO, EBO buffers. Later they are packaged into VAO objects.
______________________________________________________________________________________________________________________________________________________________________
Implementation: 3D Mesh
In this post we shall deep dive and understand implementing a mesh.
______________________________________________________________________________________________________________________________________________________________________
Implementation:Shader programs
The following provide an overview of shader programs and their implementation in this tutorial.
______________________________________________________________________________________________________________________________________________________________________
Implementation: Pipeline
In this post we shall deep dive and understand mechanics behind rendering 3D objects on the screen.
So far we discussed  FrameBuffers,Vertex Array Object containing VBO and EBO buffers and  Program Object containing Vertex Shader and Fragment Shaders.
______________________________________________________________________________________________________________________________________________________________________
Implementation: CubeMesh and SingleColoredCube
In this post we shall deep dive and understand implementing a mesh and geometric object for cube shape. We will try to draw a single colored cube as shown above and rotate it along the three axes. The cube looks elongated because aspect ratio is not applied. 
______________________________________________________________________________________________________________________________________________________________________
Lesson02: Single Colored cube
In the previous posts the graphics pipeline and vertex processing were explained. Also, the implementation of the CubeMesh and SingleColoredCube were covered. 
In this post we will try to draw a single colored cube as shown above. The cube looks elongated because aspect ratio is not applied.
______________________________________________________________________________________________________________________________________________________________________
Implementation: Multi Colored Cube
In SingleColoredCube we saw that VBOs were used to draw the single colored cube using Position data. In this post we  will discuss how to draw a Multi Colored cube using VBOs with Position and Color data having unique color on each face. It looks as shown at the bottom. It looks elongated because aspect ratio is not applied.
______________________________________________________________________________________________________________________________________________________________________
Lesson03: Multi-Colored Cube
In the previous posts the graphics pipeline and vertex processing were explained. Also, the implementation of the CubeMesh and SingleColoredCube were covered. 
In this post we will try to draw a single colored cube as shown above. The cube looks elongated because aspect ratio is not applied.
______________________________________________________________________________________________________________________________________________________________________
Implementation:Indexed Cube with interpolated colors
 In this post we  will discuss how to draw an IndexedCube using VBOs and EBO with interpolated colors. It looks as shown above. It looks elongated because aspect ratio is not applied.
______________________________________________________________________________________________________________________________________________________________________
Lesson04:Indexed Cube with interpolated colors
In the previous posts the graphics pipeline and vertex processing were explained. Also, the implementation of the CubeMesh and IndexedCube were covered. 
In this post we will try to draw a cube with interpolated colors as shown above. The cube looks elongated because aspect ratio is not applied.
______________________________________________________________________________________________________________________________________________________________________
Implementation: Textured Cube
In the previous discussions, we covered sending vertex data - Position and color. In this post we will try to send texture vertex data. It's implemented in TexturedCube class.
______________________________________________________________________________________________________________________________________________________________________
Lesson05: Textured Cube
In the previous posts the graphics pipeline and vertex processing were explained. Also, the implementation of the TextureUtil and TexturedCube were covered. 
In this post we will try to draw a cube with brick texture as shown above. The cube looks elongated because aspect ratio is not applied.
______________________________________________________________________________________________________________________________________________________________________
Primer:Lighting
Lighting is an important factor to consider while rendering realistic 3D shapes.  The following discusses adapting lighting conditions while rendering 3D images.
______________________________________________________________________________________________________________________________________________________________________
Implementation: LightedTexCube
In previous examples, we saw that Position, Color, Texture data were sent to draw cubes. In this post we  will discuss how to implement  Phong lighting models and other lights such as Directional, Point and Spot Lights. For this surface normals needs to be sent as VBO data.
______________________________________________________________________________________________________________________________________________________________________
Lesson06: Lighting a Textured Cube interactively
In the previous posts drawing a textured cube were explained. Also, the implementation of the LightingUtil and LightedTexCube were covered. 
In this post we will try to draw a textured cube with lighting interactively. The cube looks as shown above. The cube looks elongated because aspect ratio is not applied.
______________________________________________________________________________________________________________________________________________________________________
Implementation: Drawing Text and Images
Modern OpenGL does not support drawing text or Images so it needs to be handled independently. There many popular libraries available such as freetype to render text in a scene.
______________________________________________________________________________________________________________________________________________________________________
Lesson07: Drawing Text and Images interactively.
As discussed in the  previous article, we saw how Text can be drawn in multiple fonts, sizes and colors and images can be placed side by side.
Also, the implementation of the TextMesh , TextureUtil  and TextImageSketcher were covered. 
In this post we will try to draw  text and image interactively.
______________________________________________________________________________________________________________________________________________________________________