OpenGL Essentials Training

Similar documents
OpenGL SUPERBIBLE. Fifth Edition. Comprehensive Tutorial and Reference. Richard S. Wright, Jr. Nicholas Haemel Graham Sellers Benjamin Lipchak

OpenGL Status - November 2013 G-Truc Creation

E.Order of Operations

CS450/550. Pipeline Architecture. Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012

Grafica Computazionale: Lezione 30. Grafica Computazionale. Hiding complexity... ;) Introduction to OpenGL. lezione30 Introduction to OpenGL

Programming Guide. Aaftab Munshi Dan Ginsburg Dave Shreiner. TT r^addison-wesley

CHAPTER 1 Graphics Systems and Models 3

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

Lecture 2. Shaders, GLSL and GPGPU

Module 13C: Using The 3D Graphics APIs OpenGL ES

Introduction. What s New in This Edition

Dave Shreiner, ARM March 2009

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Graphics Pipeline & APIs

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

CS770/870 Spring 2017 Open GL Shader Language GLSL

CS770/870 Spring 2017 Open GL Shader Language GLSL

API Background. Prof. George Wolberg Dept. of Computer Science City College of New York

Free Downloads OpenGL ES 3.0 Programming Guide

Graphics Pipeline & APIs

OpenGL. Toolkits.

Rasterization Overview

CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS SPRING 2016 DR. MICHAEL J. REALE

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Introduction to the OpenGL Shading Language

Computer Graphics: Programming, Problem Solving, and Visual Communication

Lecture 13: OpenGL Shading Language (GLSL)

WebGL (Web Graphics Library) is the new standard for 3D graphics on the Web, designed for rendering 2D graphics and interactive 3D graphics.

Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012

Introduction to Shaders.

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Programming Graphics Hardware

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

20 Years of OpenGL. Kurt Akeley. Copyright Khronos Group, Page 1

Working with Metal Overview

An Overview GLUT GLSL GLEW

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

Pipeline Operations. CS 4620 Lecture 14

CS 428: Fall Introduction to. OpenGL primer. Andrew Nealen, Rutgers, /13/2010 1

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

GPU Memory Model. Adapted from:

OpenGL on Android. Lecture 7. Android and Low-level Optimizations Summer School. 27 July 2015

Lecture 2. Determinants. Ax = 0. a 11 x 1 + a 12 x a 1n x n = 0 a 21 x 1 + a 22 x a 2n x n = 0

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

Ciril Bohak. - INTRODUCTION TO WEBGL

Graphics Processing Unit Architecture (GPU Arch)

HE COMPLETE OPENGL PROGI FOR WINDOW WIND

Discrete Techniques. 11 th Week, Define a buffer by its spatial resolution (n m) and its depth (or precision) k, the number of

Shaders CSCI 4239/5239 Advanced Computer Graphics Spring 2014

CS475/CS675 - Computer Graphics. OpenGL Drawing

COMP371 COMPUTER GRAPHICS

DEFERRED RENDERING STEFAN MÜLLER ARISONA, ETH ZURICH SMA/

The OpenGL R Graphics System: A Specification (Version 1.3)

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

CS451Real-time Rendering Pipeline

Shaders CSCI 4229/5229 Computer Graphics Fall 2017

Buffers, Textures, Compositing, and Blending. Overview. Buffers. David Carr Virtual Environments, Fundamentals Spring 2005 Based on Slides by E.

last time put back pipeline figure today will be very codey OpenGL API library of routines to control graphics calls to compile and load shaders

Rendering Objects. Need to transform all geometry then

Mali Demos: Behind the Pixels. Stacy Smith

LECTURE 02 OPENGL API

Early History of APIs. PHIGS and X. SGI and GL. Programming with OpenGL Part 1: Background. Objectives

World Coordinate System

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

Normalized Device Coordinate System (NDC) World Coordinate System. Example Coordinate Systems. Device Coordinate System

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

Metal Feature Set Tables

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Mobile Graphics Ecosystem. Tom Olson OpenGL ES working group chair

Programming with OpenGL Part 1: Background

Next Generation OpenGL Neil Trevett Khronos President NVIDIA VP Mobile Copyright Khronos Group Page 1

Graphics Hardware. Instructor Stephen J. Guy

Buffers. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

The Application Stage. The Game Loop, Resource Management and Renderer Design

Evolution of GPUs Chris Seitz

CSE4030 Introduction to Computer Graphics

Achieving High-performance Graphics on Mobile With the Vulkan API

Shaders. Slide credit to Prof. Zwicker

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University

Shaders (some slides taken from David M. course)

TSBK03 Screen-Space Ambient Occlusion

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

Graphics Hardware, Graphics APIs, and Computation on GPUs. Mark Segal

Supplement to Lecture 22

CISC 3620 Lecture 7 Lighting and shading. Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping

CS 4620 Program 3: Pipeline

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Advanced Rendering Techniques

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics

Texture Mapping and Special Effects

Computer Graphics. Bing-Yu Chen National Taiwan University

1.2.3 The Graphics Hardware Pipeline

Scanline Rendering 2 1/42

Introduction to OpenGL ES 3.0

The Rendering Pipeline (1)

EECS 487: Interactive Computer Graphics

Introduction to 2D Graphics

Computer graphics 2: Graduate seminar in computational aesthetics

Transcription:

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 http://www.linkedin.com/in/pravinkumarsinha 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 Lecture - Introduction GPUs Shaders Hardware acceleration OpenGL History and evolution Graphics terminologies, i.e. Display list, Resolution, Modeling, Geometry Representation, Evaluators, Primitives, Pixel Operations, Rasterization, Fragment Operation) Command Syntax State machine Rendering Pipeline OpenGL, OpenGLES, GLX and WebGL GLU and GLEW GLUT, GLFW and OpenGL utility Toolkit Lecture - Drawing Primitives Describing points, lines and polygon State management Normal vector Vertex array Attribute groups Inline functions glu library function Buffer Objects Example, building sphere, cylinder, cone Lecture - Viewing Transformations Viewing and Modeling transformations Projection and Viewport transformations Grand coordinate systems Fix coordinate systems Managing Local coordinate systems Manipulating Matrix Stacks. - ModelView matrix - Project matrix Example, Building a solar system Lecture - Color & Lighting RGBA and Color index mode Color and Shading mode Creating Light source Selecting lighting model Defining material properties www.minhinc.com p2

Day 1 Afternoon Lab Draw a cylinder using normal glvertex Draw a cylinder using vertex array Validate if transformations are not associative. i.e translation+roation not same to rotation+translaton Add a moon to mars in solar system Draw sphere using glu library. Add and move light source near and far. Let add lighting support in solar system through sun. Day 2 Morning Lecture - Blending, Antialiasing, Fog and Polygon Offset The source and destination factors in blending Three dimensional blending with the Depth Buffer Antialiasing Geometric Primitives with Multisampling Fog equations Polygon Offset Lecture - Display List & Pixel Operation Creating and executing a display list Executing multiple display lists Managing state variable with display lists Bitmaps and Fonts Images Imaging pipeline - Pixel Packing and Unpacking, 32 and 64 bit - Controlling Pixel-Storage Modes, 32-64 bit - Pixel-Transfer Operations - Pixel Mapping Using Buffer Objects with Pixel Rectangle Data - Using Buffer Objects in Transfer and Retrieve Pixel Data Lecture - Texture Mapping Steps in texture mapping Specifying the texture - Texture Proxy, Texture Array - Mipmaps:Multiple Level Filtering Texture Object Texture Functions - Texture combiner function Multitexturing The texture matrix stack Depth texture www.minhinc.com p3

Day 2 Afternoon Lecture - Framebuffer, Tessallators & Quadrics Color Buffer Depth Buffer Stencil Buffer Accumulation Buffer Polygon tessallation Quadrics:Rendering Spheres, Cylinders and disks Lecture - Evaluators and NURBS Evaluators The GLU NURBS Interfaces Lab Draw alphabet using DisplayList and Bitmap Apply texture on earth in Solar System Day 3 Morning Lecture - GLSL Shader Programming GLSL versions Syntax (Data types, statements, Functions and Sub routines) Various Shaders (vertex, fragment, geometry) and relations to Graphics Pipeline Creating Shader Inter Shader Communication Accessing Texture maps in shaders www.minhinc.com p4

Day 3 Afternoon Lecture - OpenGL integration with Qt gl functions through Qt -QOpenGLFunctions Framebuffer operations Vertex -QOpenGLVertexArrayObject -QSurfaceFormat -QOpenGLContext -QOpenGLFramebufferObject -QOpenGLFramebufferObjectFormat Window -QOpenGLWidget -initialzegl,resizegl,paintgl functions -painting 2D and 3D together Shader programming -QOpenGLShader -QOpenGLShaderProgram www.minhinc.com p5

Gl Essentials Gl Essenstials- Training Course www.minhinc.com p6

DISCLAIMER This document is edited on Cent OS 5 using Open Office 3.1.1 Draw Package. CentOS is freely download from centos.org/download Open Office 3.1.1 can be obtained through yum or through openoffice.org Text of this document is written in Bembo Std Otf(13 pt) font. Code parts are written in Consolas (10 pts) font. This training material is provided through Minh, Inc.,, B'lore, India Pdf version of this document is available at http://www.minhinc.com/training/advance-gl-slides.pdf For suggestion(s) or complaint(s) write to us at training@minhinc.com Document modified on 07/2018 Document contains 13 pages. www.minhinc.com p7

Day 1 Morning 1. Introduction OpenGL - Introduction GPUs, Shaders, Hadrdware Acceleration OpenGL History and evolution 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 1. Introduction OpenGL - Introduction Day 1 Morning GPUs, Shaders, Hadrdware Acceleration OpenGL History and evolution 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 p8

1. Introduction OpenGL - Introduction GPUs, Shaders, Hadrdware Acceleration Day 1 Morning OpenGL History and evolution 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 - Fixed function fragment processing - Shading language 1.10 and 1.20 OpenGL 3.1 (2009) www.minhinc.com p9

- 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 p10

www.minhinc.com p11

Left Blank www.minhinc.com p12

Minh, Inc. A SOFTWARE RESEARCH FIRM