SlideShare ist ein Scribd-Unternehmen logo
1 von 34
OpenGL Basics
KOLIBER
What is OpenGL ? ( Open Graphics Library )
• Cross-language, Cross-Platform API for rendering 2D, 3D vector
graphics.
• The API is typically used to interact with a graphics processing unit
(GPU), to achieve hardware-accelerated rendering.
• Drivers: the people who make GPUs, are responsible for writing
implementations of the OpenGL rendering system. Their
implementations, commonly called "drivers“ , translate OpenGL API
commands into GPU commands
OpenGL usages
Games Animations and Videos
virtual realityCAD (Computer Aided Design )
Mobile phones
OpenGL platforms
Desktop Operation Systems
(OpenGL)
Embeded Devices (OpenGLES)
OpenGL platforms
Web based(WebGL)
OpenGL history
• 1991: Development started by SGI (Silicon Graphics INC. – ARB group (IBM ,
Microsoft , Nvidia , … ))
• 1992: OpenGL 1.0 launched (fixed functions/pipeline - legacy)
• 2000: OpenGL/ES 1.0 launched (embedded systems)
• 2004: OpenGL 2.0 released (programmable pipeline - GLSL/ shaders)
• 2005: OpenGL/SC 1.0 launched (safety critical)
• 2006: OpenGL 2.1 released (last release by SGI - to Khronos Group)
• 2008: OpenGL 3.0 released (first release by Khronos)
• 2016: Vulkan 1.0 launched (by Khronos – low driver overhead)
• 2017: OpenGL 4.6 released (last release by Khronos)
OpenGL history
OpenGL history
Deep into base !
OpenGL rendering pipeline
• At the first level OpenGL gets vertex array of our
model and our texture coordinates or ( color and
coordinates )
• At the second level OpenGL will translate , rotate ,
scale our vertices based on the transformation and
perspective matrices ( position calculator )
• At the third level OpenGL assembles our vertices
into triangles based on primitive type
• At the fourth level OpenGL rasterizes our triangles
into pixel format based on view port matrices and
• At the fifth level OpenGL will colorize and texturize
our pixels ( called fragment shader or pixel shader ) (
color chooser )
• At the sixth level OpenGL will test our pixels and do
some blending operations and at the end will write
pixels into framebuffer for showing in display
OpenGL rendering pipeline (Vertex/Fragment shader)
Vertex shader ( position calculator )
Fragment shader (color chooser )
Another simple view of OpenGL pipeline
OpenGL rendering pipeline (Triangle assembling)
Primitive types for triangle assembling at level two
OpenGL rendering pipeline (Testing) – OpenGL/SC
An important question ! (Texture mapping)
An important question ! (Texture mapping)
OpenGL texture mapping
OpenGL rendering pipeline (Vertex shader – Projection)
Deep into Vertex Shader!
Vertex Shaders (MVP)
• Model Matrix: Per model
(Model position)
• View Matrix: Camera
position
• Projection Matrix: Camera
projection (Orthographic,
Perspective, …)
• ModelView Matrix: Old
versions of OpenGL
(View*Model)
Vertex Shaders (MVP)
Transformation matrices (T)
• Scale
• Rotation
• Translation
• Scissors
• Reflection
• ...
PerspectiveRotate, Scale, Reflection, …
ScaleTranslation
Vertex Shader – Model Transformation Matrix
Vertex Shader – View Transformation Matrix
Vertex Shader – View Transformation Matrix (World transforms)
Camera (View) is fixed at Origin
Vertex Shader – Projection Transformation Matrix
• Perspective
• Orthographic
• …
Vertex Shader – Projection Transformation Matrix(Perspective)
• N: near
• F: far
• L: left
• T: top
• B: bottom
• R: right
Vertex Shader – Projection Transformation Matrix
Fragment Shader - Lighting
Let’s Code!
OpenGL libraries
• GL: OpenGL Core library ( rendering , drawing vertices , … ) (low level
API)
• GLU: OpenGL Utility library ( transforming , rotating , mathematical
operations over GPU , … ) (higher level API)
• GLUT: OpenGL Utility Toolkit library ( multiplatform window system
interface )
• GLFW: Graphics Library Frameword( multiplatform window system
interface ) (Handles joysticks, keyboard, mouse, …)
• SDL, FLTK, QT
• WGL, CGL, GLX
OpenGL libraries
OpenGL functions (gl.h)
• glVertex*(…)
• glColor*(…)
• glRotate*(…)
• glTranslate*(…)
• glScale*(…)
• glBegin(…)
• glEnd()
• glMatrixMode(…)
• glPushMatrix()
• glPopMatrix()
• glLoadIdentity()
• glOrtho(…)
• glFrustum(…)
• glEnable(…)
• glDisable(…)
• glLight*(…)
OpenGL functions (gl.h)(glFrustum)
Any question ?
Resources
• https://www.khronos.org/
• https://www.wikipedia.org/
• https://www.mesa3d.org/
• https://code.tutsplus.com/
• https://learnopengl.com
• https://open.gl/context
• http://www.songho.ca/opengl/gl_transform.html#example1
• http://in2gpu.com/2015/05/13/the-model-matrix/
• http://www.lighthouse3d.com/tutorials/glut-tutorial/keyboard-example-moving-
around-the-world/
• https://webglfundamentals.org/webgl/lessons/webgl-3d-camera.html

Weitere ähnliche Inhalte

Was ist angesagt?

Opengl presentation
Opengl presentationOpengl presentation
Opengl presentationelnaqah
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.Girish Ghate
 
Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGLMegha V
 
Graphics programming in open gl
Graphics programming in open glGraphics programming in open gl
Graphics programming in open glArvind Devaraj
 
Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3SIMONTHOMAS S
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016Mark Kilgard
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determinationPatel Punit
 
Graphics in C programming
Graphics in C programmingGraphics in C programming
Graphics in C programmingKamal Acharya
 
OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android Arvind Devaraj
 
Shader Programming With Unity
Shader Programming With UnityShader Programming With Unity
Shader Programming With UnityMindstorm Studios
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c versionMarwa Al-Rikaby
 
Graphics software
Graphics softwareGraphics software
Graphics softwareMohd Arif
 
Anti- aliasing computer graphics
Anti- aliasing computer graphicsAnti- aliasing computer graphics
Anti- aliasing computer graphicsSafayet Hossain
 

Was ist angesagt? (20)

Open gl
Open glOpen gl
Open gl
 
Opengl presentation
Opengl presentationOpengl presentation
Opengl presentation
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
 
Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGL
 
Graphics programming in open gl
Graphics programming in open glGraphics programming in open gl
Graphics programming in open gl
 
Introduction to 2D/3D Graphics
Introduction to 2D/3D GraphicsIntroduction to 2D/3D Graphics
Introduction to 2D/3D Graphics
 
Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determination
 
Graphics in C programming
Graphics in C programmingGraphics in C programming
Graphics in C programming
 
OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android
 
Shader Programming With Unity
Shader Programming With UnityShader Programming With Unity
Shader Programming With Unity
 
Introduction to graphics programming in c
Introduction to graphics programming in cIntroduction to graphics programming in c
Introduction to graphics programming in c
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c version
 
Graphics software
Graphics softwareGraphics software
Graphics software
 
Visual Studio IDE
Visual Studio IDEVisual Studio IDE
Visual Studio IDE
 
Computer graphics realism
Computer graphics realismComputer graphics realism
Computer graphics realism
 
OpenGL L01-Primitives
OpenGL L01-PrimitivesOpenGL L01-Primitives
OpenGL L01-Primitives
 
Anti- aliasing computer graphics
Anti- aliasing computer graphicsAnti- aliasing computer graphics
Anti- aliasing computer graphics
 

Ähnlich wie OpenGL basics

OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading LanguageJungsoo Nam
 
OpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the AndroidOpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the AndroidDroidConTLV
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
CS 354 Programmable Shading
CS 354 Programmable ShadingCS 354 Programmable Shading
CS 354 Programmable ShadingMark Kilgard
 
OpenGL Transformation
OpenGL TransformationOpenGL Transformation
OpenGL TransformationSandip Jadhav
 
CG simple openGL point & line-course 2
CG simple openGL point & line-course 2CG simple openGL point & line-course 2
CG simple openGL point & line-course 2fungfung Chen
 
Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glchangehee lee
 
Clean architecture for shaders unite2019
Clean architecture for shaders unite2019Clean architecture for shaders unite2019
Clean architecture for shaders unite2019Abhilash Majumder
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptxssuser255bf1
 
lectureAll-OpenGL-complete-Guide-Tutorial.pdf
lectureAll-OpenGL-complete-Guide-Tutorial.pdflectureAll-OpenGL-complete-Guide-Tutorial.pdf
lectureAll-OpenGL-complete-Guide-Tutorial.pdfSanjeevSaharan5
 
02 direct3 d_pipeline
02 direct3 d_pipeline02 direct3 d_pipeline
02 direct3 d_pipelineGirish Ghate
 
Hardware Shaders
Hardware ShadersHardware Shaders
Hardware Shadersgueste52f1b
 

Ähnlich wie OpenGL basics (20)

OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading Language
 
OpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the AndroidOpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the Android
 
Programmable Piplelines
Programmable PiplelinesProgrammable Piplelines
Programmable Piplelines
 
Chapter-3.pdf
Chapter-3.pdfChapter-3.pdf
Chapter-3.pdf
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
CS 354 Programmable Shading
CS 354 Programmable ShadingCS 354 Programmable Shading
CS 354 Programmable Shading
 
OpenGL Transformation
OpenGL TransformationOpenGL Transformation
OpenGL Transformation
 
Introduction to OpenGL.ppt
Introduction to OpenGL.pptIntroduction to OpenGL.ppt
Introduction to OpenGL.ppt
 
CG simple openGL point & line-course 2
CG simple openGL point & line-course 2CG simple openGL point & line-course 2
CG simple openGL point & line-course 2
 
september11.ppt
september11.pptseptember11.ppt
september11.ppt
 
Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_gl
 
Clean architecture for shaders unite2019
Clean architecture for shaders unite2019Clean architecture for shaders unite2019
Clean architecture for shaders unite2019
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx
 
2D graphics
2D graphics2D graphics
2D graphics
 
18csl67 vtu lab manual
18csl67 vtu lab manual18csl67 vtu lab manual
18csl67 vtu lab manual
 
Android native gl
Android native glAndroid native gl
Android native gl
 
lectureAll-OpenGL-complete-Guide-Tutorial.pdf
lectureAll-OpenGL-complete-Guide-Tutorial.pdflectureAll-OpenGL-complete-Guide-Tutorial.pdf
lectureAll-OpenGL-complete-Guide-Tutorial.pdf
 
02 direct3 d_pipeline
02 direct3 d_pipeline02 direct3 d_pipeline
02 direct3 d_pipeline
 
OpenGL Interaction
OpenGL InteractionOpenGL Interaction
OpenGL Interaction
 
Hardware Shaders
Hardware ShadersHardware Shaders
Hardware Shaders
 

Kürzlich hochgeladen

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 

Kürzlich hochgeladen (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

OpenGL basics

  • 2. What is OpenGL ? ( Open Graphics Library ) • Cross-language, Cross-Platform API for rendering 2D, 3D vector graphics. • The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering. • Drivers: the people who make GPUs, are responsible for writing implementations of the OpenGL rendering system. Their implementations, commonly called "drivers“ , translate OpenGL API commands into GPU commands
  • 3. OpenGL usages Games Animations and Videos virtual realityCAD (Computer Aided Design ) Mobile phones
  • 4. OpenGL platforms Desktop Operation Systems (OpenGL) Embeded Devices (OpenGLES)
  • 6. OpenGL history • 1991: Development started by SGI (Silicon Graphics INC. – ARB group (IBM , Microsoft , Nvidia , … )) • 1992: OpenGL 1.0 launched (fixed functions/pipeline - legacy) • 2000: OpenGL/ES 1.0 launched (embedded systems) • 2004: OpenGL 2.0 released (programmable pipeline - GLSL/ shaders) • 2005: OpenGL/SC 1.0 launched (safety critical) • 2006: OpenGL 2.1 released (last release by SGI - to Khronos Group) • 2008: OpenGL 3.0 released (first release by Khronos) • 2016: Vulkan 1.0 launched (by Khronos – low driver overhead) • 2017: OpenGL 4.6 released (last release by Khronos)
  • 10. OpenGL rendering pipeline • At the first level OpenGL gets vertex array of our model and our texture coordinates or ( color and coordinates ) • At the second level OpenGL will translate , rotate , scale our vertices based on the transformation and perspective matrices ( position calculator ) • At the third level OpenGL assembles our vertices into triangles based on primitive type • At the fourth level OpenGL rasterizes our triangles into pixel format based on view port matrices and • At the fifth level OpenGL will colorize and texturize our pixels ( called fragment shader or pixel shader ) ( color chooser ) • At the sixth level OpenGL will test our pixels and do some blending operations and at the end will write pixels into framebuffer for showing in display
  • 11. OpenGL rendering pipeline (Vertex/Fragment shader) Vertex shader ( position calculator ) Fragment shader (color chooser ) Another simple view of OpenGL pipeline
  • 12. OpenGL rendering pipeline (Triangle assembling) Primitive types for triangle assembling at level two
  • 13. OpenGL rendering pipeline (Testing) – OpenGL/SC
  • 14. An important question ! (Texture mapping)
  • 15. An important question ! (Texture mapping) OpenGL texture mapping
  • 16. OpenGL rendering pipeline (Vertex shader – Projection)
  • 17. Deep into Vertex Shader!
  • 18. Vertex Shaders (MVP) • Model Matrix: Per model (Model position) • View Matrix: Camera position • Projection Matrix: Camera projection (Orthographic, Perspective, …) • ModelView Matrix: Old versions of OpenGL (View*Model)
  • 20. Transformation matrices (T) • Scale • Rotation • Translation • Scissors • Reflection • ... PerspectiveRotate, Scale, Reflection, … ScaleTranslation
  • 21. Vertex Shader – Model Transformation Matrix
  • 22. Vertex Shader – View Transformation Matrix
  • 23. Vertex Shader – View Transformation Matrix (World transforms) Camera (View) is fixed at Origin
  • 24. Vertex Shader – Projection Transformation Matrix • Perspective • Orthographic • …
  • 25. Vertex Shader – Projection Transformation Matrix(Perspective) • N: near • F: far • L: left • T: top • B: bottom • R: right
  • 26. Vertex Shader – Projection Transformation Matrix
  • 27. Fragment Shader - Lighting
  • 29. OpenGL libraries • GL: OpenGL Core library ( rendering , drawing vertices , … ) (low level API) • GLU: OpenGL Utility library ( transforming , rotating , mathematical operations over GPU , … ) (higher level API) • GLUT: OpenGL Utility Toolkit library ( multiplatform window system interface ) • GLFW: Graphics Library Frameword( multiplatform window system interface ) (Handles joysticks, keyboard, mouse, …) • SDL, FLTK, QT • WGL, CGL, GLX
  • 31. OpenGL functions (gl.h) • glVertex*(…) • glColor*(…) • glRotate*(…) • glTranslate*(…) • glScale*(…) • glBegin(…) • glEnd() • glMatrixMode(…) • glPushMatrix() • glPopMatrix() • glLoadIdentity() • glOrtho(…) • glFrustum(…) • glEnable(…) • glDisable(…) • glLight*(…)
  • 34. Resources • https://www.khronos.org/ • https://www.wikipedia.org/ • https://www.mesa3d.org/ • https://code.tutsplus.com/ • https://learnopengl.com • https://open.gl/context • http://www.songho.ca/opengl/gl_transform.html#example1 • http://in2gpu.com/2015/05/13/the-model-matrix/ • http://www.lighthouse3d.com/tutorials/glut-tutorial/keyboard-example-moving- around-the-world/ • https://webglfundamentals.org/webgl/lessons/webgl-3d-camera.html