KEMBAR78
What is OpenGL ? | PPTX
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/

What is OpenGL ?

  • 1.
    What is OpenGL? KOLIBER
  • 2.
    OpenGL ( OpenGraphics 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 • Developmentstarted 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 AnimationsandVideos 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 , … )
  • 6.
  • 7.
    OpenGL implementations • NvidiaOpenGL ( called nvidia driver – for nvidia GPUs ) • AMD OpenGL ( called amd driver – for amd GPUs ) • Mesa3D ( open source opengl implementation for Intel HD graphics )
  • 8.
  • 9.
    Some questions • Whatis 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 • CPUvs 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
  • 11.
  • 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 Vertexshader ( position calculator ) Fragment shader (color chooser ) Another simple view of OpenGL pipeline
  • 14.
    OpenGL rendering pipeline Primitivetypes for triangle assembling at level two
  • 15.
  • 16.
  • 17.
    Testing ? Some time’sOpenGL 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
  • 20.
  • 21.
    Resources • https://www.khronos.org/ • https://www.wikipedia.org/ •https://www.mesa3d.org/ • https://code.tutsplus.com/