OpenGL Essentials Training
3-day session

 
Overview
Understanding principles of 3D programming
Understanding drawing Primitives
Understanding transformation matrix and Coloring
Understanding Blending and Texture mapping
Understanding Shaders programming and Display List.
Understanding OpenGL integration with Qt
Duration
Three days - 24 hours (8 hours a day)
50% of lecture, 50% of practical labs.
Trainer

Audience
Professional 3D Software developers
Prerequisite
Knowledge of C programming
In particular, participants must be familiar with creating and dealing with
complex data types and structures, with pointers to such symbols, as well as
with function pointers.
Advance C training agenda is available at
http://www.minhinc.com/training/c/advance-c-agenda.php

and can be downloaded from
http://www.minhinc.com/training/advance-c-agenda.pdf

Knowledge of Object Oriented Concepts
Qt integration requires Oops concept like Abstraction, Inheritance,
Polymorphism knowledge.

Setup
Linux machine with GNU C++ compiler with Qt OpenGL version installed.
© www.minhinc.com
p1
Lecture
Lecture session will be course content presentation through the trainer.
Any source code example related to the topic will be demonstrated, it would
include executing the binaries. Complete lecture material can be downloaded from
http://www.minhinc.com/training/advance-gl-slides.pdf
Labs
Labs session would be completely hands on session where each example
(with example data and execution instruction) would be provided to the
students. Students can verify their results with the results provided in
the material.
Day 1 Morning

© www.MinhInc.com
p2
Day 1 Afternoon

     Lab
Day 2 Morning

© www.MinhInc.com
p3
Day 2 Afternoon

     Lab
Day 3 Morning

© www.MinhInc.com
p4
Day 3 Afternoon

     Lab
© www.MinhInc.com
p5
 
Day 1 Morning
  1. Introduction
Abstract : OpengGL library is a software interface to graphics hardware. It does not provides any windowing system.

- OpenGL provide 'C' programming interface to control graphics hardware.
- OpenGL does not provide any windowing system or way to control user input.
- OpenGL doesn't provide readymade 3D high level model, like automobile models. It instead provide basic point,line and polygon drawing primitives. GLU library uses glu basic primitives and provides high level mesh, Nurbs surface drawing algorthims.
- OpenGL is just an alogorithms which takes input from
 a) Vertex primitives
 b) Textures
in order to generate the framebuffer and then finally display buffer.
        ---------------              ------------
        | texture     |              | vertex   |
        | (pixel data)|              | primitives|
        ---------------              -------------
              |                              |
              |                              |
              +------------------------------+
                              |
                              .
                              .
                              |
                        ---------------
                        | Per Fragment|
                        | Operation   |
                        ---------------
                              |
                        ---------------
                        | Framebuffer |
                        | Operation   |
                        ---------------
                               |
                               v
                          Output data
OpenGL basic architecture is to initialize the various drawing states then draw the primtives
                       |
                       |
                       v
                ---------------
                |  Set the    |
                |   States    |
                |for Primitives|
                ---------------
                       |
                       |
                       v
                --------------
                |  Draw the   |
                | Primitives  |
                --------------
                       |
                       |
                       v

Day 1 Morning
  1. Introduction
Abstract:Graphics process unit (GPU) is a special hardware that does faster mathematical computations for matrixes.

GPU is a processing unit with its own physical memory. Vertex transformations and Fragment computations are done on GPU.

GPU processes code written in shaders language. Shaders are fed to GPU to make the computation. Most used shaders are
- Vertex shaders
- Fragment shaders

© www.minhinc.com
p6
Day 1 Morning
  1. Introduction

OpenGL is a 3D drawing c APIs developed by Silicon Graphics Inc. (SGI) in 1991. Where it inspired by available Iris 3D GL programming. First version 1.0 was released in 1992 without texture support.

1991-2006 - Silicon Graphics
2006 - Khronos Group

Various OpenGL major releases
OpenGL 1.0 (1992)
OpenGL 1.1 (1997)
 - Vertex arrays
 - Polygon offsets
 - Texture
  - Texture proxy
  - Texture objects
OpenGL 1.2(1998)
 - 3D textures
 - pixel formats
 - vertex array draw element range
OpengL 1.3 (2001)
 - Multisample
 - Multitexture
 - Transpose matrix
OpengGL 1.4 (2002)
 - Blend squaring
 - Depth textures and shadows
 - Fog coordinates
 - Multiple draw arrays
 - Stencil wrap
OpenGL 1.5 (2003)
 - Buffer objects
OpenGL 2.0 (2004)
--+---
Shader Programming Language introduced - GLSL 1.1
          |
- Shader programs
  +----
Fixed line functions implemetented through GLSL internally - Shader objects - Seprate stencil OpenGL 2.1 (2006) - GLSL 1.2 - Pixel buffer objects - sRGB textures OpenGL 3.0 (2008) - GLSL 1.3 - Framebuffer objects - Multisample renderbuffer objects - conditional rendering - array textures Deprecated features - color index mode - Begin/End primitve - Fixed function vertex processing - Bitmaps - Pixel drawing - Polygon stripple - Display Lists - Texture borders - Alpha test - Accumuation buffers - Evaluators
© www.minhinc.com
p7
 - Fixed function fragment processing
 - Shading language 1.10 and 1.20
OpenGL 3.1 (2009)
 - GLSL 1.40 with Instancing
 - Deprecated features removed except wide lines
 - Buffer textures
 - Rectangle textures
      /---->
core (only programming line functions) OpenGL 3.2 (2009)
-------
- GLSL 1.5
               \---->
compatibility (retaining fixed line functions) - Core(no deprecated function) and compatibility profiles(with deprecated functions) OpenGL 3.3 (2010) - GLSL 3.3 - Dual - source blending - Sample Objects - Texture swizzle - Instanced arrays - Vertex attributes 2.10.10.10 OpenGL 4.0 (2010) - GLSL 4.0 with tessalation on GPU, shaders with 64-bit precision - Buffer texture - Indirect drawing without multidraw OpenGL 4.1 (2010) - GLSL 4.1 developer-friendly debug output - compatibility with OpenGL ES 2.0 - Query and load binary blob for program objects OpenGL 4.2 (2011) - GLSL 4.20 Shaders with atomic counters - Allowing shaders to read and write images - Allowing incrementing/decrementing ad fetching of buffer object memory locations from shaders OpenGL 4.3 (2012) - GLSL 4.30 Compute shaders leveraging GPU parallelism - shader storage buffer objects OpenGL 4.4 (2013) - GLSL 4.40 Buffer Placement Control - Shader Variable Layout - Bindless Texture Extension - Sparse Texture Extension OpenGL 4.5 (2014) - GLSL 4.50 Direct State Access (DSA) - Flush Control - DX11 emulation features OpenGL 4.6 (2017) - GLSL 4.60 More efficient geometry processing and shader execution - polygon offset clamp - SPIR-V - anisotropic filtering Any functions introduced by venders gets vendor name, i.e NVI introduced constants are GL_NV_half_float, GL_HALF_FLOAT_NV and the function glVertex2hNV(). If these functions become ubiquitous then it is introduced as EXT or ARB (Archtecture review board) extension. Khronos group is new name for ARB group. OpenGL stack on Linux
© www.minhinc.com
p8
© www.minhinc.com
p9
 
Day 1 Morning
  2. Drawing Primitives

Day 1 Morning
  2. Drawing Primitives

Day 1 Morning
  2. Drawing Primitives

Day 1 Morning
  2. Drawing Primitives

Day 1 Morning
  2. Drawing Primitives

Day 1 Morning
  2. Drawing Primitives

© www.minhinc.com
p10
Day 1 Morning
  2. Drawing Primitives

Day 1 Morning
  2. Drawing Primitives

Day 1 Morning
  2. Drawing Primitives
© www.minhinc.com
p11
 
Day 1 Morning
  3. Viewing

Day 1 Morning
  3. Viewing

Day 1 Morning
  3. Viewing

Day 1 Morning
  3. Viewing

Day 1 Morning
  3. Viewing

Day 1 Morning
  3. Viewing

© www.minhinc.com
p12
Day 1 Morning
  3. Viewing

Day 1 Morning
  3. Viewing
© www.minhinc.com
p13
 
Day 1 Morning
  4. Color & Lighting

Day 1 Morning
  4. Color & Lighting

Day 1 Morning
  4. Color & Lighting

Day 1 Morning
  4. Color & Lighting

Day 1 Morning
  4. Color & Lighting
© www.minhinc.com
p14
 
Day 2 Morning
  5. Blending, Antialiasing, Fog and Polygon Offset

Day 2 Morning
  5. Blending, Antialiasing, Fog and Polygon Offset

Day 2 Morning
  5. Blending, Antialiasing, Fog and Polygon Offset

Day 2 Morning
  5. Blending, Antialiasing, Fog and Polygon Offset

Day 2 Morning
  5. Blending, Antialiasing, Fog and Polygon Offset
© www.minhinc.com
p15
 
Day 2 Morning
  6. Display List & Pixel Operation

Day 2 Morning
  6. Display List & Pixel Operation

Day 2 Morning
  6. Display List & Pixel Operation

Day 2 Morning
  6. Display List & Pixel Operation

Day 2 Morning
  6. Display List & Pixel Operation

© www.minhinc.com
p16
Day 2 Morning
  6. Display List & Pixel Operation

Day 2 Morning
  6. Display List & Pixel Operation
© www.minhinc.com
p17
 
Day 2 Morning
  7. Texture Mapping

Day 2 Morning
  7. Texture Mapping

Day 2 Morning
  7. Texture Mapping

Day 2 Morning
  7. Texture Mapping

Day 2 Morning
  7. Texture Mapping

Day 2 Morning
  7. Texture Mapping

© www.minhinc.com
p18
Day 2 Morning
  7. Texture Mapping

Day 2 Morning
  7. Texture Mapping
© www.minhinc.com
p19
 
Day 2 Afternoon
  8. Framebuffer, Tessallators & Quadrics

Day 2 Afternoon
  8. Framebuffer, Tessallators & Quadrics

Day 2 Afternoon
  8. Framebuffer, Tessallators & Quadrics

Day 2 Afternoon
  8. Framebuffer, Tessallators & Quadrics

Day 2 Afternoon
  8. Framebuffer, Tessallators & Quadrics

Day 2 Afternoon
  8. Framebuffer, Tessallators & Quadrics
© www.minhinc.com
p20
 
Day 2 Afternoon
  9. Evaluators and NURBS

Day 2 Afternoon
  9. Evaluators and NURBS
© www.minhinc.com
p21
© www.minhinc.com
p22
© www.minhinc.com
p23
© www.minhinc.com
p24