SlideShare a Scribd company logo
1 of 37
Download to read offline
The Power of WebGL 
Presented at the Fullstack Toronto conference, November 2014 
Michael Bond 
Derrick Weis 
and Ross McKegney 
Verold
Interactive 3D is the next big datatype on the web 
TEXT IMAGE AUDIO VIDEO 3D
Link
Graphics WebGL 
Processing WebCL / Workers / Emscripten 
Audio Web Audio 
Networking WebRTC 
Real-time + Devices Web Sockets
What is WebGL?
3D Graphics Acceleration 
● Gives browser direct access to your graphics card (GPU) 
● Offloads CPU so that it can continue with other things
WebGL API 
● JavaScript! 
● Modern API based on widely-used OpenGL for Embedded 
Systems
Pretty Pictures 
● Enables us to have scenes with realistic lighting, materials and 
animations
WebGL is low-level 
● Doesn’t know what a light or a camera is 
● Just knows about arrays of vertices, textures, and other data 
● Has to be told what to do with the data
Graphics Pipeline 
Vertices & Textures 
Stuff on the screen
OpenGL Shading Language (GLSL) 
● Load code using WebGL 
● Compiles and runs directly on the GPU 
● Purpose-built hardware runs really fast
Back in the day... 
GLSL 
ASM
Vertex Shader 
● Run on every single vertex 
● Positions each 3D vertex on the 2D screen
Fragment Shader 
● GPU fills in each triangle 
● Runs shader for every pixel 
● Texturing and lighting 
● Outputs a colour
I ain’t got time for this! 
● We want to work with higher level abstractions 
● Many graphics libraries out there 
○ Three.js 
○ Babylon.js 
○ CopperLicht 
○ etc.
Three.js 
● By far the most commonly used framework 
● Huge community of contributors
API 
● Gives you cameras, lights, materials, etc. 
● Don’t need to worry about shaders (but you can!) 
● Don’t need to deal with matrix math 
● All you need is THREE.Scene and THREE.Camera
THREE.Scene 
● Scene contains hierarchy of objects 
● Every object inherits from THREE.Object3D
Materials and Textures
WebGL + DOM
It’s Just a <canvas> 
● No plugins 
● Easy to integrate, framework agnostic 
● Can be used for anything: 
○ Small animated area of web page 
■ can render transparently over other items in DOM 
[link] 
○ Larger application or game 
○ Data visualizations 
○ Unlimited possibilities..
Component Entity Model 
● Attach components to any object or asset (Entity) 
● Modular, easy to reuse 
● Code + data 
● Integrate third party libraries easily 
○ Ammo.JS http://codepen.io/gentooist/pen/azzPyL
Causes the attached three 
object to pulsate (scale) 
based on abs(sin(time * 
speed)) 
http://vrld.co/UOZaoD
Fun with WebGL 
● High performance native libraries converted to Javascript via 
Emscripten 
○ Ammo.js (Bullet Physics Library) 
■ https://github.com/kripken/ammo.js/ 
○ Fun examples: 
■ Simple Ammo.js Example 
■ Delivery Simulator
Performance
Performance 
● Always needs to be a balance between JavaScript execution 
and WebGL rendering 
● Either can stall the other
JavaScript Performance 
Be good. 
● Minimize memory allocation every frame. 
● Don’t change an object’s virtual type on the fly 
● Not running code is always faster 
Use asm.js libraries or workers for intensive work when possible
WebGL Performance 
● Each WebGL API command is expensive 
○ Merge geometry 
○ Share materials and textures 
● Complex Fragment Shaders 
○ Disable unneeded material features 
○ Decrease number of lights, etc. 
○ Reduce screen resolution
Download Performance 
We want our apps to load fast! 
● Model triangles 
● Animation frame rate and length 
● Texture resolution 
● Texture format 
○ Download size: jpg < png < dds 
○ In-memory size: dds < jpeg < png
Links 
● All codepens from this talk 
○ http://codepen.io/collection/XWqyGD/
PUBLISH INTERACTIVE 3D 
TO THE OPEN WEB 
Michael Bond 
Lead Engine Developer 
michael.bond@verold.com 
Derrick Weis 
Platform Engineer 
derrick.weis@verold.com 
Ross McKegney 
CEO 
ross.mckegney@verold.com

More Related Content

What's hot

WebRender (MadRust)
WebRender (MadRust)WebRender (MadRust)
WebRender (MadRust)Igalia
 
Html5 Canvas and Mobile Graphics
Html5 Canvas and Mobile GraphicsHtml5 Canvas and Mobile Graphics
Html5 Canvas and Mobile GraphicsEngin Hatay
 
DSD-INT 2018 Web-based realtime interactive groundwater modelling - Joling Mi...
DSD-INT 2018 Web-based realtime interactive groundwater modelling - Joling Mi...DSD-INT 2018 Web-based realtime interactive groundwater modelling - Joling Mi...
DSD-INT 2018 Web-based realtime interactive groundwater modelling - Joling Mi...Deltares
 
Introduction to QML
Introduction to QMLIntroduction to QML
Introduction to QMLAlan Uthoff
 
KDE 4.1 Plasma widgets
KDE 4.1 Plasma widgetsKDE 4.1 Plasma widgets
KDE 4.1 Plasma widgetsMarco Martin
 
Pixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shaderPixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shaderDenis Radin
 
Beating canvas 2 d in its own territory webgl+tesspathy
Beating canvas 2 d in its own territory  webgl+tesspathyBeating canvas 2 d in its own territory  webgl+tesspathy
Beating canvas 2 d in its own territory webgl+tesspathygree_tech
 
OpenVisConf - WebGL for graphics and data visualization
OpenVisConf - WebGL for graphics and data visualizationOpenVisConf - WebGL for graphics and data visualization
OpenVisConf - WebGL for graphics and data visualizationphilogb
 
Dockerfile for rust project
Dockerfile for rust projectDockerfile for rust project
Dockerfile for rust projectHien Nguyen
 
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...Ontico
 
Designing and coding for cloud-native applications using Python, Harjinder Mi...
Designing and coding for cloud-native applications using Python, Harjinder Mi...Designing and coding for cloud-native applications using Python, Harjinder Mi...
Designing and coding for cloud-native applications using Python, Harjinder Mi...Pôle Systematic Paris-Region
 
Quick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using JavascriptQuick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using JavascriptRobert Ellen
 
Offscreen canvas 2021 update
Offscreen canvas 2021 updateOffscreen canvas 2021 update
Offscreen canvas 2021 updateIgalia
 
Building desktop apps in java script with Electron
Building desktop apps in java script with ElectronBuilding desktop apps in java script with Electron
Building desktop apps in java script with ElectronAshley Davis
 
From rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journeyFrom rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journeyArno Schulz
 
W3C HTML5 KIG-HTML5 Game Performance Issue
W3C HTML5 KIG-HTML5 Game Performance IssueW3C HTML5 KIG-HTML5 Game Performance Issue
W3C HTML5 KIG-HTML5 Game Performance IssueChanghwan Yi
 
Writing native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptWriting native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptIgalia
 

What's hot (20)

WebRender (MadRust)
WebRender (MadRust)WebRender (MadRust)
WebRender (MadRust)
 
Html5 Canvas and Mobile Graphics
Html5 Canvas and Mobile GraphicsHtml5 Canvas and Mobile Graphics
Html5 Canvas and Mobile Graphics
 
DSD-INT 2018 Web-based realtime interactive groundwater modelling - Joling Mi...
DSD-INT 2018 Web-based realtime interactive groundwater modelling - Joling Mi...DSD-INT 2018 Web-based realtime interactive groundwater modelling - Joling Mi...
DSD-INT 2018 Web-based realtime interactive groundwater modelling - Joling Mi...
 
Open data for good
Open data for goodOpen data for good
Open data for good
 
Introduction to QML
Introduction to QMLIntroduction to QML
Introduction to QML
 
KDE 4.1 Plasma widgets
KDE 4.1 Plasma widgetsKDE 4.1 Plasma widgets
KDE 4.1 Plasma widgets
 
Pixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shaderPixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shader
 
Beating canvas 2 d in its own territory webgl+tesspathy
Beating canvas 2 d in its own territory  webgl+tesspathyBeating canvas 2 d in its own territory  webgl+tesspathy
Beating canvas 2 d in its own territory webgl+tesspathy
 
OpenVisConf - WebGL for graphics and data visualization
OpenVisConf - WebGL for graphics and data visualizationOpenVisConf - WebGL for graphics and data visualization
OpenVisConf - WebGL for graphics and data visualization
 
Dockerfile for rust project
Dockerfile for rust projectDockerfile for rust project
Dockerfile for rust project
 
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
 
Designing and coding for cloud-native applications using Python, Harjinder Mi...
Designing and coding for cloud-native applications using Python, Harjinder Mi...Designing and coding for cloud-native applications using Python, Harjinder Mi...
Designing and coding for cloud-native applications using Python, Harjinder Mi...
 
Quick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using JavascriptQuick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using Javascript
 
Offscreen canvas 2021 update
Offscreen canvas 2021 updateOffscreen canvas 2021 update
Offscreen canvas 2021 update
 
Building desktop apps in java script with Electron
Building desktop apps in java script with ElectronBuilding desktop apps in java script with Electron
Building desktop apps in java script with Electron
 
NoSQL Talk at eBuddy
NoSQL Talk at eBuddyNoSQL Talk at eBuddy
NoSQL Talk at eBuddy
 
From rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journeyFrom rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journey
 
W3C HTML5 KIG-HTML5 Game Performance Issue
W3C HTML5 KIG-HTML5 Game Performance IssueW3C HTML5 KIG-HTML5 Game Performance Issue
W3C HTML5 KIG-HTML5 Game Performance Issue
 
Writing native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptWriting native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScript
 
Html5 2da parte
Html5 2da parteHtml5 2da parte
Html5 2da parte
 

Similar to The Power of WebGL: Interactive 3D on the Open Web

Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I💻 Anton Gerdelan
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentDavid Galeano
 
Drupal 3D - Intro to Using Web 3D with Drupal
Drupal 3D - Intro to Using Web 3D with DrupalDrupal 3D - Intro to Using Web 3D with Drupal
Drupal 3D - Intro to Using Web 3D with DrupalBrian Hay
 
Castle Game Engine and the joy of making and using a custom game engine
Castle Game Engine and the joy  of making and using a custom game engineCastle Game Engine and the joy  of making and using a custom game engine
Castle Game Engine and the joy of making and using a custom game engineMichalis Kamburelis
 
IntoWebGL - Unite Melbourne 2015
IntoWebGL - Unite Melbourne 2015IntoWebGL - Unite Melbourne 2015
IntoWebGL - Unite Melbourne 2015Ryan Alcock
 
Developing games and graphic visualizations in Pascal
Developing games and graphic visualizations in PascalDeveloping games and graphic visualizations in Pascal
Developing games and graphic visualizations in PascalMichalis Kamburelis
 
Summer Internship Project - Remote Render
Summer Internship Project - Remote RenderSummer Internship Project - Remote Render
Summer Internship Project - Remote RenderYen-Kuan Wu
 
Metail Skin Colour Authoring Tool
Metail Skin Colour Authoring ToolMetail Skin Colour Authoring Tool
Metail Skin Colour Authoring ToolDavid Gavilan
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicschangehee lee
 
GDCE 2015: Blueprint Components to C++
GDCE 2015: Blueprint Components to C++GDCE 2015: Blueprint Components to C++
GDCE 2015: Blueprint Components to C++Gerke Max Preussner
 
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 ...DevClub_lv
 
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 и Unity3DJSFestUA
 
Computer Graphics - Lecture 00 - Introduction
Computer Graphics - Lecture 00 - IntroductionComputer Graphics - Lecture 00 - Introduction
Computer Graphics - Lecture 00 - Introduction💻 Anton Gerdelan
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleDmytro Semenov
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkAlive Kuo
 
FIWARE Developers Week_BootcampWeBUI_presentation1
FIWARE Developers Week_BootcampWeBUI_presentation1FIWARE Developers Week_BootcampWeBUI_presentation1
FIWARE Developers Week_BootcampWeBUI_presentation1FIWARE
 
Minko - Flash Conference #5
Minko - Flash Conference #5Minko - Flash Conference #5
Minko - Flash Conference #5Minko3D
 
Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012philogb
 
O łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsO łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsThe Software House
 
GPU Programming: Chicago CocoaConf 2015
GPU Programming: Chicago CocoaConf 2015GPU Programming: Chicago CocoaConf 2015
GPU Programming: Chicago CocoaConf 2015Janie Clayton
 

Similar to The Power of WebGL: Interactive 3D on the Open Web (20)

Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game development
 
Drupal 3D - Intro to Using Web 3D with Drupal
Drupal 3D - Intro to Using Web 3D with DrupalDrupal 3D - Intro to Using Web 3D with Drupal
Drupal 3D - Intro to Using Web 3D with Drupal
 
Castle Game Engine and the joy of making and using a custom game engine
Castle Game Engine and the joy  of making and using a custom game engineCastle Game Engine and the joy  of making and using a custom game engine
Castle Game Engine and the joy of making and using a custom game engine
 
IntoWebGL - Unite Melbourne 2015
IntoWebGL - Unite Melbourne 2015IntoWebGL - Unite Melbourne 2015
IntoWebGL - Unite Melbourne 2015
 
Developing games and graphic visualizations in Pascal
Developing games and graphic visualizations in PascalDeveloping games and graphic visualizations in Pascal
Developing games and graphic visualizations in Pascal
 
Summer Internship Project - Remote Render
Summer Internship Project - Remote RenderSummer Internship Project - Remote Render
Summer Internship Project - Remote Render
 
Metail Skin Colour Authoring Tool
Metail Skin Colour Authoring ToolMetail Skin Colour Authoring Tool
Metail Skin Colour Authoring Tool
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphics
 
GDCE 2015: Blueprint Components to C++
GDCE 2015: Blueprint Components to C++GDCE 2015: Blueprint Components to C++
GDCE 2015: Blueprint Components to C++
 
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
 
Computer Graphics - Lecture 00 - Introduction
Computer Graphics - Lecture 00 - IntroductionComputer Graphics - Lecture 00 - Introduction
Computer Graphics - Lecture 00 - Introduction
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 
FIWARE Developers Week_BootcampWeBUI_presentation1
FIWARE Developers Week_BootcampWeBUI_presentation1FIWARE Developers Week_BootcampWeBUI_presentation1
FIWARE Developers Week_BootcampWeBUI_presentation1
 
Minko - Flash Conference #5
Minko - Flash Conference #5Minko - Flash Conference #5
Minko - Flash Conference #5
 
Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012
 
O łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsO łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.js
 
GPU Programming: Chicago CocoaConf 2015
GPU Programming: Chicago CocoaConf 2015GPU Programming: Chicago CocoaConf 2015
GPU Programming: Chicago CocoaConf 2015
 

Recently uploaded

英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
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.
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
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
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 

The Power of WebGL: Interactive 3D on the Open Web

  • 1. The Power of WebGL Presented at the Fullstack Toronto conference, November 2014 Michael Bond Derrick Weis and Ross McKegney Verold
  • 2. Interactive 3D is the next big datatype on the web TEXT IMAGE AUDIO VIDEO 3D
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 10. Graphics WebGL Processing WebCL / Workers / Emscripten Audio Web Audio Networking WebRTC Real-time + Devices Web Sockets
  • 12. 3D Graphics Acceleration ● Gives browser direct access to your graphics card (GPU) ● Offloads CPU so that it can continue with other things
  • 13. WebGL API ● JavaScript! ● Modern API based on widely-used OpenGL for Embedded Systems
  • 14. Pretty Pictures ● Enables us to have scenes with realistic lighting, materials and animations
  • 15. WebGL is low-level ● Doesn’t know what a light or a camera is ● Just knows about arrays of vertices, textures, and other data ● Has to be told what to do with the data
  • 16. Graphics Pipeline Vertices & Textures Stuff on the screen
  • 17. OpenGL Shading Language (GLSL) ● Load code using WebGL ● Compiles and runs directly on the GPU ● Purpose-built hardware runs really fast
  • 18. Back in the day... GLSL ASM
  • 19. Vertex Shader ● Run on every single vertex ● Positions each 3D vertex on the 2D screen
  • 20. Fragment Shader ● GPU fills in each triangle ● Runs shader for every pixel ● Texturing and lighting ● Outputs a colour
  • 21. I ain’t got time for this! ● We want to work with higher level abstractions ● Many graphics libraries out there ○ Three.js ○ Babylon.js ○ CopperLicht ○ etc.
  • 22. Three.js ● By far the most commonly used framework ● Huge community of contributors
  • 23. API ● Gives you cameras, lights, materials, etc. ● Don’t need to worry about shaders (but you can!) ● Don’t need to deal with matrix math ● All you need is THREE.Scene and THREE.Camera
  • 24. THREE.Scene ● Scene contains hierarchy of objects ● Every object inherits from THREE.Object3D
  • 27. It’s Just a <canvas> ● No plugins ● Easy to integrate, framework agnostic ● Can be used for anything: ○ Small animated area of web page ■ can render transparently over other items in DOM [link] ○ Larger application or game ○ Data visualizations ○ Unlimited possibilities..
  • 28. Component Entity Model ● Attach components to any object or asset (Entity) ● Modular, easy to reuse ● Code + data ● Integrate third party libraries easily ○ Ammo.JS http://codepen.io/gentooist/pen/azzPyL
  • 29. Causes the attached three object to pulsate (scale) based on abs(sin(time * speed)) http://vrld.co/UOZaoD
  • 30. Fun with WebGL ● High performance native libraries converted to Javascript via Emscripten ○ Ammo.js (Bullet Physics Library) ■ https://github.com/kripken/ammo.js/ ○ Fun examples: ■ Simple Ammo.js Example ■ Delivery Simulator
  • 32. Performance ● Always needs to be a balance between JavaScript execution and WebGL rendering ● Either can stall the other
  • 33. JavaScript Performance Be good. ● Minimize memory allocation every frame. ● Don’t change an object’s virtual type on the fly ● Not running code is always faster Use asm.js libraries or workers for intensive work when possible
  • 34. WebGL Performance ● Each WebGL API command is expensive ○ Merge geometry ○ Share materials and textures ● Complex Fragment Shaders ○ Disable unneeded material features ○ Decrease number of lights, etc. ○ Reduce screen resolution
  • 35. Download Performance We want our apps to load fast! ● Model triangles ● Animation frame rate and length ● Texture resolution ● Texture format ○ Download size: jpg < png < dds ○ In-memory size: dds < jpeg < png
  • 36. Links ● All codepens from this talk ○ http://codepen.io/collection/XWqyGD/
  • 37. PUBLISH INTERACTIVE 3D TO THE OPEN WEB Michael Bond Lead Engine Developer michael.bond@verold.com Derrick Weis Platform Engineer derrick.weis@verold.com Ross McKegney CEO ross.mckegney@verold.com