SlideShare a Scribd company logo
1 of 21
What is OpenGL ?
KOLIBER
OpenGL ( Open Graphics Library )
• Is a cross-language, cross-platformAPI for rendering 2D and 3D
vector graphics.The API is typically used to interact with a graphics
processing unit (GPU), to achieve hardware-accelerated rendering
• 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 History
• Development started by SGI (Silicon Graphics INC.) at 1991 (
developers groups name was ARB ( IBM , Microsoft , Nvidia , … )
• First release at 1992 ( OpenGL 1.0 )
• Last release by SGI at 2 July 2006 ( OpenGL 2.1 )
• Maintainer changed at July 2006 ( from SGI to Khronos Group( SGI ,
ATI , Nvidia , … ) )
• First big release by Khronos at 11 Agust 2008 ( OpenGL 3.0 )
• Last release by Khronos at 31 July 2017 ( OpenGL 4.6 )
OpenGL usages
Games Animations andVideos
virtual realityCAD (Computer Aided Design )
Mobile phones
OpenGL Libraries
• gl: OpenGL Core library ( rendering , drawing vertices , … )
• glu: OpenGL Utility library ( transforming , rotating , mathematical
operations over GPU , … )
• glut: OpenGL Utility Toolkit library ( multiplatform window system
interface )
• wgl,cgl,glx: Advance window system interface for OS (windows ,
*unix , mac , … )
OpenGL Libraries
OpenGL implementations
• Nvidia OpenGL ( called nvidia driver – for nvidia GPUs )
• AMD OpenGL ( called amd driver – for amd GPUs )
• Mesa3D ( open source opengl implementation for Intel HD graphics )
Deep into base !
Some questions
• What is GPU ?
Like CPUs , GPUs are processors , but for huge processes like
rendering
• What is Rendering ?
Rendering means the process of translating 2D or 3D geometry to raster
Image
• Is GPU only for rendering ?
Of course not , GPGPU ( general purpose graphics processing
unit ) , is the use of a GPU to perform computation in
applications traditionally handled by the CPU
Some questions
• CPU vs GPU ?
As we know CPUs are devided by brands (Intel , AMD , …) , ISAs
(CISC , RISC , ZISC , MISC , …) , … , GPUs can be devided by
parameters such brands ( Nvidia , Intel , AMD , … ) ,
Architectures (Kepler , Maxwell , Pascal ,Volta , … ) and etc
• Can we write an application for GPU ?
Like CPUs that have compiler ( translating high-level language
to assembly ( clang , gcc , cc , … ) ) and assembler ( translate
assembly to machine code ( nasm , yasm , … ) ) , GPUs are
programmable , too and have compiler ( nvcc , hcc , … ) and
assembler ( gcnasm , asfermi , … )
• What is OpenGL for ?
For writing applications with interacting to GPU for rendering , we
need deep knowledge about our GPU Architecture and hardware to
create a simple application , renders a model , so OpenGL is a higher
level API for simple interacting with GPU
Deep into OpenGL !
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 shader ( position calculator )
Fragment shader (color chooser )
Another simple view of OpenGL pipeline
OpenGL rendering pipeline
Primitive types for triangle assembling at level two
Rasterization ?
Rasterization ?
Testing ?
Some time’s OpenGL may fail to
rendering correctly like this picture
The DepthTest is a per-sample
processing operation performed
after the Fragment Shader for
detecting incorrect frames and
discarding them .
An important question !
How can you render this simple wall ? How many
triangles you need to render it ? 100 ? 1000 ? Millions ?
Oh is wrong to use Millions of triangles for rendering a
simple wall !
So how can you ?
Of course ! Textures 
You can use a simple rectangle and map this image on
it ( called texture mapping )
An important question !
OpenGL texture mapping
Any question ?
Resources
• https://www.khronos.org/
• https://www.wikipedia.org/
• https://www.mesa3d.org/
• https://code.tutsplus.com/

More Related Content

What's hot

Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGLGary Yeh
 
Open Graphics Library
Open Graphics  Library Open Graphics  Library
Open Graphics Library Azmeen Gadit
 
3D Transformation
3D Transformation3D Transformation
3D TransformationSwatiHans10
 
Graphics programming in open gl
Graphics programming in open glGraphics programming in open gl
Graphics programming in open glArvind Devaraj
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)Timbal Mayank
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notessmruti sarangi
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer GraphicsAdri Jovin
 
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPTHOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPTAhtesham Ullah khan
 
computer graphics
computer graphicscomputer graphics
computer graphicsMegabi Mamo
 
Graphics software
Graphics softwareGraphics software
Graphics softwareMohd Arif
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation pptGichelle Amon
 
4. THREE DIMENSIONAL DISPLAY METHODS
4.	THREE DIMENSIONAL DISPLAY METHODS4.	THREE DIMENSIONAL DISPLAY METHODS
4. THREE DIMENSIONAL DISPLAY METHODSSanthiNivas
 
Input devices in computer graphics
Input devices in computer graphicsInput devices in computer graphics
Input devices in computer graphicsAnu Garg
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.Mohd Arif
 

What's hot (20)

Open gl
Open glOpen gl
Open gl
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Open Graphics Library
Open Graphics  Library Open Graphics  Library
Open Graphics Library
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
 
Graphics programming in open gl
Graphics programming in open glGraphics programming in open gl
Graphics programming in open gl
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notes
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPTHOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
 
computer graphics
computer graphicscomputer graphics
computer graphics
 
Graphics software
Graphics softwareGraphics software
Graphics software
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation ppt
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
4. THREE DIMENSIONAL DISPLAY METHODS
4.	THREE DIMENSIONAL DISPLAY METHODS4.	THREE DIMENSIONAL DISPLAY METHODS
4. THREE DIMENSIONAL DISPLAY METHODS
 
3D Transformation
3D Transformation 3D Transformation
3D Transformation
 
Input devices in computer graphics
Input devices in computer graphicsInput devices in computer graphics
Input devices in computer graphics
 
Z buffer
Z bufferZ buffer
Z buffer
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 

Similar to What is OpenGL ?

OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading LanguageJungsoo Nam
 
High performance graphics and computation - OpenGL ES and RenderScript
High performance graphics and computation - OpenGL ES and RenderScript High performance graphics and computation - OpenGL ES and RenderScript
High performance graphics and computation - OpenGL ES and RenderScript BlrDroid
 
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
 
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specificationsGFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specificationsPrabindh Sundareson
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesPooya Eimandar
 
Compute API –Past & Future
Compute API –Past & FutureCompute API –Past & Future
Compute API –Past & FutureOfer Rosenberg
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGLJungsoo Nam
 
Shader Programming With Unity
Shader Programming With UnityShader Programming With Unity
Shader Programming With UnityMindstorm Studios
 
SIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGLSIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGLMark Kilgard
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalMasatsugu HASHIMOTO
 
CS 354 Programmable Shading
CS 354 Programmable ShadingCS 354 Programmable Shading
CS 354 Programmable ShadingMark Kilgard
 
OpenGL ES and Mobile GPU
OpenGL ES and Mobile GPUOpenGL ES and Mobile GPU
OpenGL ES and Mobile GPUJiansong Chen
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
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
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).pptHIMANKMISHRA2
 

Similar to What is OpenGL ? (20)

OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading Language
 
High performance graphics and computation - OpenGL ES and RenderScript
High performance graphics and computation - OpenGL ES and RenderScript High performance graphics and computation - OpenGL ES and RenderScript
High performance graphics and computation - OpenGL ES and RenderScript
 
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
 
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specificationsGFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
 
(2) gui drawing
(2) gui drawing(2) gui drawing
(2) gui drawing
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game Engines
 
Compute API –Past & Future
Compute API –Past & FutureCompute API –Past & Future
Compute API –Past & Future
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL
 
Shader Programming With Unity
Shader Programming With UnityShader Programming With Unity
Shader Programming With Unity
 
Android native gl
Android native glAndroid native gl
Android native gl
 
Graphics Libraries
Graphics LibrariesGraphics Libraries
Graphics Libraries
 
2D graphics
2D graphics2D graphics
2D graphics
 
SIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGLSIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGL
 
(2) gui drawing
(2) gui drawing(2) gui drawing
(2) gui drawing
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_Final
 
CS 354 Programmable Shading
CS 354 Programmable ShadingCS 354 Programmable Shading
CS 354 Programmable Shading
 
OpenGL ES and Mobile GPU
OpenGL ES and Mobile GPUOpenGL ES and Mobile GPU
OpenGL ES and Mobile GPU
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
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
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).ppt
 

Recently uploaded

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 

Recently uploaded (20)

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 

What is OpenGL ?

  • 1. What is OpenGL ? KOLIBER
  • 2. OpenGL ( Open Graphics Library ) • Is a cross-language, cross-platformAPI for rendering 2D and 3D vector graphics.The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering • 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 History • Development started by SGI (Silicon Graphics INC.) at 1991 ( developers groups name was ARB ( IBM , Microsoft , Nvidia , … ) • First release at 1992 ( OpenGL 1.0 ) • Last release by SGI at 2 July 2006 ( OpenGL 2.1 ) • Maintainer changed at July 2006 ( from SGI to Khronos Group( SGI , ATI , Nvidia , … ) ) • First big release by Khronos at 11 Agust 2008 ( OpenGL 3.0 ) • Last release by Khronos at 31 July 2017 ( OpenGL 4.6 )
  • 4. OpenGL usages Games Animations andVideos virtual realityCAD (Computer Aided Design ) Mobile phones
  • 5. OpenGL Libraries • gl: OpenGL Core library ( rendering , drawing vertices , … ) • glu: OpenGL Utility library ( transforming , rotating , mathematical operations over GPU , … ) • glut: OpenGL Utility Toolkit library ( multiplatform window system interface ) • wgl,cgl,glx: Advance window system interface for OS (windows , *unix , mac , … )
  • 7. OpenGL implementations • Nvidia OpenGL ( called nvidia driver – for nvidia GPUs ) • AMD OpenGL ( called amd driver – for amd GPUs ) • Mesa3D ( open source opengl implementation for Intel HD graphics )
  • 9. Some questions • What is GPU ? Like CPUs , GPUs are processors , but for huge processes like rendering • What is Rendering ? Rendering means the process of translating 2D or 3D geometry to raster Image • Is GPU only for rendering ? Of course not , GPGPU ( general purpose graphics processing unit ) , is the use of a GPU to perform computation in applications traditionally handled by the CPU
  • 10. Some questions • CPU vs GPU ? As we know CPUs are devided by brands (Intel , AMD , …) , ISAs (CISC , RISC , ZISC , MISC , …) , … , GPUs can be devided by parameters such brands ( Nvidia , Intel , AMD , … ) , Architectures (Kepler , Maxwell , Pascal ,Volta , … ) and etc • Can we write an application for GPU ? Like CPUs that have compiler ( translating high-level language to assembly ( clang , gcc , cc , … ) ) and assembler ( translate assembly to machine code ( nasm , yasm , … ) ) , GPUs are programmable , too and have compiler ( nvcc , hcc , … ) and assembler ( gcnasm , asfermi , … ) • What is OpenGL for ? For writing applications with interacting to GPU for rendering , we need deep knowledge about our GPU Architecture and hardware to create a simple application , renders a model , so OpenGL is a higher level API for simple interacting with GPU
  • 12. 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
  • 13. OpenGL rendering pipeline Vertex shader ( position calculator ) Fragment shader (color chooser ) Another simple view of OpenGL pipeline
  • 14. OpenGL rendering pipeline Primitive types for triangle assembling at level two
  • 17. Testing ? Some time’s OpenGL may fail to rendering correctly like this picture The DepthTest is a per-sample processing operation performed after the Fragment Shader for detecting incorrect frames and discarding them .
  • 18. An important question ! How can you render this simple wall ? How many triangles you need to render it ? 100 ? 1000 ? Millions ? Oh is wrong to use Millions of triangles for rendering a simple wall ! So how can you ? Of course ! Textures  You can use a simple rectangle and map this image on it ( called texture mapping )
  • 19. An important question ! OpenGL texture mapping
  • 21. Resources • https://www.khronos.org/ • https://www.wikipedia.org/ • https://www.mesa3d.org/ • https://code.tutsplus.com/