SlideShare a Scribd company logo
1 of 136
Download to read offline
Graphics and Libraries
Dominic Farolino
• twitter.com/domfarolino

• github.com/domfarolino

• dom@chromium.org
• Senior

• Chromium Committer

• WHATWG Editor
What is this talk?
@domfarolino
Rendering
@domfarolino
Graphics APIs
@domfarolino
OpenGL + Graphics Pipeline
@domfarolino
Pixel Buffering & V-Sync
@domfarolino
WebGL
@domfarolino
–some smart person
“Converting object description > 2D image plane representation”
Rendering
“Object Description”
“Object Description”
Geometric
serialization of
shape to be painted
“Object Description”
Geometric
serialization of
shape to be painted
= Vector graphic
–some smart person
“Converting vector graphic > 2D image plane representation”
Rendering
Raster vs Vector {ization}
Raster vs Vector {ization}
Raytracing
Raster vs Vector {ization}
Raytracing
Radiosity
Vectorization
Vectorization
Rasterization
Rasterization
Practical Difference
Practical Difference
• Rasterizations

• Complex shapes + filled areas

• Trouble producing smooth lines = blocky
Practical Difference
• Rasterizations

• Complex shapes + filled areas

• Trouble producing smooth lines = blocky
• Vectorizations

• Perfectly smooth lines

• Less versatile
How do we actually do this
stuff?
GFX APIs
Why?
DirectX
DirectX
• Released with Windows 95
DirectX
• Released with Windows 95
• Included in every version of Windows
DirectX
• Released with Windows 95
• Included in every version of Windows
• Tons of APIs
DirectX
• Released with Windows 95
• Included in every version of Windows
• Tons of APIs
• 3D GFX API (Direct3D)
DirectX
• Released with Windows 95
• Included in every version of Windows
• Tons of APIs
• 3D GFX API (Direct3D)
• 2D | |
DirectX
• Released with Windows 95
• Included in every version of Windows
• Tons of APIs
• 3D GFX API (Direct3D)
• 2D | |
• Input
DirectX
• Released with Windows 95
• Included in every version of Windows
• Tons of APIs
• 3D GFX API (Direct3D)
• 2D | |
• Input
• Audio
OpenGL
OpenGL
• Alternative to DirectX
OpenGL
• Alternative to DirectX
• Basically same functionality
OpenGL
• Alternative to DirectX
• Basically same functionality
• Pros:
OpenGL
• Alternative to DirectX
• Basically same functionality
• Pros:
• Very-cross platform
OpenGL
• Alternative to DirectX
• Basically same functionality
• Pros:
• Very-cross platform
• OPEN STANDARD (Khronos Group)
Graphics Card
Graphics Card
Graphics Card Drivers
Graphics Card
Graphics Card Drivers
Graphics APIs
Graphics Card
Graphics Card Drivers
Graphics APIs
Game Engines
Graphics Card
Graphics Card Drivers
Graphics APIs
Game Engines
You, the gamer!!
Graphics APIs
Game Engines
You, the gamer!!
Graphics APIs
Game Engines
You, the gamer!!
Physics
Graphics APIs
Game Engines
You, the gamer!!
A.I.Physics
Graphics APIs
Game Engines
You, the gamer!!
LightingA.I.Physics
Graphics APIs
Game Engines
You, the gamer!!
LightingA.I.Physics
Collision
Detection
Graphics APIs
Game Engines
You, the gamer!!
LightingA.I.Physics
Collision
Detection
Audio Manip.
Graphics APIs
Game Engines
You, the gamer!!
LightingA.I.Physics
Collision
Detection
Audio Manip.
Graphics APIs
Game Engines
You, the gamer!!
LightingA.I.Physics
Collision
Detection
Audio Manip.
SDL2
Graphics APIs
Game Engines
You, the gamer!!
LightingA.I.Physics
Collision
Detection
Audio Manip.
SDL2 SFML
Graphics APIs
Game Engines
You, the gamer!!
LightingA.I.Physics
Collision
Detection
Audio Manip.
SDL2 SFML GLFW
SDL(2)
SDL(2)
• Simple DirectMedia Layer 2
SDL(2)
• Simple DirectMedia Layer 2
• macOS, Linux, Android, iOS, Windows
SDL(2)
• Simple DirectMedia Layer 2
• macOS, Linux, Android, iOS, Windows
• Game development library
SDL(2)
• Simple DirectMedia Layer 2
• macOS, Linux, Android, iOS, Windows
• Game development library
• ⌨ + 🐭 + 📢 + 🕹 + 🖥
SDL(2)
• Simple DirectMedia Layer 2
• macOS, Linux, Android, iOS, Windows
• Game development library
• ⌨ + 🐭 + 📢 + 🕹 + 🖥
• Game engine??
SDL(2)
• Simple DirectMedia Layer 2
• macOS, Linux, Android, iOS, Windows
• Game development library
• ⌨ + 🐭 + 📢 + 🕹 + 🖥
• Game engine??
• Used in many game engines (Valve Source)
SDL(2)
• Simple DirectMedia Layer 2
• macOS, Linux, Android, iOS, Windows
• Game development library
• ⌨ + 🐭 + 📢 + 🕹 + 🖥
• Game engine??
• Used in many game engines (Valve Source)
Why SDL?
Why SDL?
• OpenGL doesn’t specify:
Why SDL?
• OpenGL doesn’t specify:
• Window creation
Why SDL?
• OpenGL doesn’t specify:
• Window creation
• Input handling
Why SDL?
• OpenGL doesn’t specify:
• Window creation
• Input handling
• More…
Vertices
(VBO)
Data of any format
Vertices
(VBO)
Data of any format
Vertex
Shader
(On the GPU)
Vertices
(VBO)
Data of any format
Vertex
Shader
(On the GPU)
Vertices
(VBO)
Data of any format
Vertex
Shader
(On the GPU)
Rasterization
(On the GPU)
Vertices
(VBO)
Data of any format
Vertex
Shader
(On the GPU)
Rasterization
(On the GPU)
Vertices
(VBO)
Data of any format
Vertex
Shader
(On the GPU)
Rasterization
(On the GPU)
Fragment
Shader
(On the GPU)
Fragment
Shader
(On the GPU)
Fragment
Shader
Blending and
sampling
(On the GPU)(On the GPU)
Fragment
Shader
Blending and
sampling
(On the GPU)
Final output
image!
(On the GPU)
Vertex Data
@domfarolino
Vertex Data
Vertex Data
Vertex Data
Interpreting Vertices
@domfarolino
Vertex Shader
Vertex Shader
Vertex Shader
Vertex Shader
Vertex Shader
Attach/Compile
Interpreting Color
@domfarolino
Fragment Shader
Fragment Shader
Fragment Shader
Example
Pixel buffering & V-Sync
@domfarolino
Getting rid of screen tears?
@domfarolino
Synchronizing Vertical Refresh
Rate
@domfarolino
V-Sync
@domfarolino
Slower FPS?
@domfarolino
Cool, but what about the web?
@domfarolino

More Related Content

Similar to Low Level Graphics & OpenGL

ngGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and TokyongGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and Tokyo
notolab
 
Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012
Xamarin
 

Similar to Low Level Graphics & OpenGL (20)

Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech ArtPhillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
Phillip Heckinger (Microsoft): Empowering AR & VR with Tech Art
 
Write retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with AzureWrite retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with Azure
 
Game development -session on unity 3d
Game development -session on unity 3d Game development -session on unity 3d
Game development -session on unity 3d
 
Lets have a look at Apple's Metal Framework
Lets have a look at Apple's Metal FrameworkLets have a look at Apple's Metal Framework
Lets have a look at Apple's Metal Framework
 
iOS and Android Development with Unity3D
iOS and Android Development with Unity3DiOS and Android Development with Unity3D
iOS and Android Development with Unity3D
 
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
 
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3DJS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
 
Brewing Your Own Game Engie eng
Brewing Your Own Game Engie engBrewing Your Own Game Engie eng
Brewing Your Own Game Engie eng
 
Lecture 1 Introduction to VR Programming
Lecture 1 Introduction to VR ProgrammingLecture 1 Introduction to VR Programming
Lecture 1 Introduction to VR Programming
 
Knock Knock on GameDev Gate
Knock Knock on GameDev GateKnock Knock on GameDev Gate
Knock Knock on GameDev Gate
 
Knock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game developmentKnock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game development
 
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
 
De Re PlayStation Vita
De Re PlayStation VitaDe Re PlayStation Vita
De Re PlayStation Vita
 
Developing applications and games in Unity engine - Matej Jariabka, Rudolf Ka...
Developing applications and games in Unity engine - Matej Jariabka, Rudolf Ka...Developing applications and games in Unity engine - Matej Jariabka, Rudolf Ka...
Developing applications and games in Unity engine - Matej Jariabka, Rudolf Ka...
 
Ferguson VR Hackathon - May 6, 2017
Ferguson VR Hackathon - May 6, 2017Ferguson VR Hackathon - May 6, 2017
Ferguson VR Hackathon - May 6, 2017
 
ngGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and TokyongGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and Tokyo
 
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
 
Native Code is Dead AKA Cross Platform Development with Unity3D
Native Code is Dead AKA Cross Platform Development with Unity3DNative Code is Dead AKA Cross Platform Development with Unity3D
Native Code is Dead AKA Cross Platform Development with Unity3D
 
Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012
 

Recently uploaded

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 

Recently uploaded (20)

BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 

Low Level Graphics & OpenGL