SlideShare une entreprise Scribd logo
1  sur  27
WebGL for Game
Development
Tony Parisi
http://www.tonyparisi.com
About Me
 Serial entrepreneur
 Founder, stealth game startup                                  Skybox Engine
                                               https://github.com/tparisi/Skybox
 Consulting architect and CTO
                                                             WebGL Book Code
 Web3D Co-Creator, VRML and X3D          https://github.com/tparisi/WebGLBook
 Author

  Contact Information
  tparisi@gmail.com
  Skype: auradeluxe
  http://twitter.com/auradeluxe         http://www.ton
  yparisi.com/
  Get the Book!
  Amazon
  http://www.amazon.com/dp/144932357X
  O’Reilly Books
  http://shop.oreilly.com/product/0636920024729.do
What is WebGL?
 The new 3D API standard
     OpenGL ES™ in a browser
     JavaScript API bindings
     Supported in nearly all modern browsers
     Supported on many devices
     Shipped since early 2011



                                 …and it’s Awesome.
                                                                  10/17/2012
                                                WebGL For Game Development
Who Controls WebGL?
 Part of the HTML5 family of technologies
   …not really.
   …well, really.
 Standard maintained by Khronos
  Grouphttp://www.khronos.org
 Major browser and system makers
 Solid, stable set of core contributors
 Serious conformance effort
                                                         10/17/2012
                                       WebGL For Game Development
Where Does WebGL Run?
 Chrome, Firefox, Safari, Opera
   NOT Internet Explorer
 iOS – iAds only
 Android – coverage spotty
 Blackberry – making big push with HTML5 platform
 500M+ seats




                                                            10/17/2012
                                          WebGL For Game Development
Why Use WebGL for Games?
 Rich internet experiences with true hardware-accelerated 3D
 No download
 Complete integration with page elements – use HTML5 for all
  your game UI
 (Mostly) cross-platform
 Rapid development
 Performance – it’s faster than 2D canvas
 Royalty-free - no licensing issues


                                                             10/17/2012
                                           WebGL For Game Development
Why Not Use WebGL For Games?
 Not supported in IE
 Not turned on by default in Safari
 Limited iOS
 General performance issues with mobile browser-based
  games
   Cross-platform and performance issues could be mitigated with a
    hybrid Native/JS strategy using libraries like AppMobi, Ludei
 Engines and tools still a mishmash



                                                                  10/17/2012
                                               WebGL For Game Development
JavaScript: NOT a Reason to Not
 Use WebGL For Games




From: Brendan Eich’s The State of JavaScript                           10/17/2012
http://brendaneich.github.com/Strange-Loop-2012/#/   WebGL For Game Development
Don’t Believe Me? Check This
Out




Brandon Jones’ Blog
http://blog.tojicode.com/2011/05/ios-rage-rendered-                     10/17/2012
with-webgl.html                                       WebGL For Game Development
How WebGL Works
 It’s a JavaScript drawing API
   Draw to a canvas element using a special context
   Low-Level drawing – buffers, primitives, textures and shaders
 There is no file format or object model




                                      Here’s a Sample.
                                                                    10/17/2012
                                                WebGL For Game Development
Building a Game
 Choosing a framework
 Drawing graphics
 Loading models
 Building a particle system
 Animation
 Interaction
 Integrating 2D and 3D
 Adding sound
 Making it robust
 Putting it all together
                                                 10/17/2012
                               WebGL For Game Development
Choosing a Framework
 Open source rendering engines/frameworks
     Three.js
     CubicVR
     SceneGL
     GLGE
 Emerging game engines
   Gladius
   KickJS
   Skybox
 Roll your own?
                                                          10/17/2012
                                        WebGL For Game Development
Three.js – A JavaScript 3D Engine
 Renders to 3D WebGL or 2D standard canvas
 Represents WebGL at a high level using standard 3D
  graphics concepts
 Feature rich
 Fast, robust, well maintained
 It’s a library, not a game engine, not a framework
  https://github.com/mrdoob/three.js/


                  Here’ s That Square Again.
                                                            10/17/2012
                                          WebGL For Game Development
Sim.js – A Simple Simulation
Framework for WebGL/Three.js
 Wraps common Three.js setup, teardown and handling
 Implements the run loop
   Uses requestAnimationFrame() (vs. setTimeout())
 Adds handlers for mouse and keyboard DOM events
 Provides foundation objects (Application, Base object and
  PubSub)
 Handles WebGL detection and context lost events
  https://github.com/tparisi/Sim.js


                                                                10/17/2012
                                              WebGL For Game Development
Drawing Graphics
 Primitive shapes
 Polygon meshes
 Points and lines
 Materials
 Textures
 Lights
 Transform hierarchy
 Shaders


                                          10/17/2012
                        WebGL For Game Development
Loading Models
 WebGL has no built-in file
  format
   Most formats are engine-
    specific
   Many WebGL frameworks
    support COLLADA
 Three.js has JSON format
  with blender exporter, OBJ
  file converter
 Overall, tools and exporters
  still primitive

                                                   10/17/2012
                                 WebGL For Game Development
Animating The Scene
 WebGL has no built-in
  animation support
 Three.js has some
  animation utilities
   Key frames
   Skins
   Morphs
 With JavaScript, we can
  build our own anyway
 Animate anything:
  transforms, textures, mater
  ials, lights…
                                                  10/17/2012
                                WebGL For Game Development
Implementing Interaction
 Mouse: DOM event
  handling plus Three.js
  picking support
 Keyboard handling is
  standard DOM




                                             10/17/2012
                           WebGL For Game Development
Creating Effects –
a Particle System
 Three.js has a basic built-in
  particle system
 But it’s very basic: no emitters
  or physics models
 You have to animate it all
  yourself




                                                       10/17/2012
                                     WebGL For Game Development
Integrating 2D and 3D
 WebGL’s secret weapon
   Breaks down window
    boundaries
   2D overlaid on 3D
   3D overlaid on 2D
   Canvas2D as a texture
   Video as a texture




                                              10/17/2012
                            WebGL For Game Development
Adding Sound
 Use new <audio> element
 Fairly well supported in
  browsers
 Other APIs (Moz, Chrome) not
  supported uniformly




                                                   10/17/2012
                                 WebGL For Game Development
Making It Robust
 Detecting WebGL support in the browser
 var canvas = document.createElement("canvas");

 var gl = null;
 var msg = "Your browser does not support WebGL.";
 try
 {
   gl = canvas.getContext("experimental-webgl");
 }
 catch (e)
 {
   msg = "Error creating WebGL Context!: " + e.toString();
 }
 if (!gl)
 {
   throw new Error(msg);
 }
                                                                               10/17/2012
                                                             WebGL For Game Development
Making It Robust
 Detecting a lost context
  RacingGame.prototype.handleContextLost = function(e)
  {
             this.restart();
  }

  RacingGame.prototype.addContextListener = function()
  {
             var that = this;

              this.renderer.domElement.addEventListener("webglcontextlost",
                                     function(e) {
                                                   that.handleContextLost(e);
                                                   },
                                     false);
  }

                                                                                  10/17/2012
                                                                WebGL For Game Development
Putting It All Together




                                            10/17/2012
                          WebGL For Game Development
More Stuff
 Physics
   Box2DJS http://box2d-js.sourceforge.net/
   JigLibJS2 http://brokstuk.com/jiglibjs2/
   Ammo https://github.com/kripken/ammo.js/
 Authoring Tools
   Need help…
   https://github.com/tparisi/3dsMaxWebGL
 Engines
   Need help…
   https://github.com/tparisi/Skybox
 Cross-compiler tools – very promising!                          10/17/2012
                                               WebGL For Game Development
   http://developer.mozilla.org/en-US/demos/detail/bananabread
The Bottom Line
 WebGL is solid for developing games
      OpenGL ES under the hood (it’s what’s running on your phone and tablet)
      Huge development, testing and conformance effort by browser writers
      Strong standards group maintaining it (www.khronos.org)
      In most browsers and growing number of devices
 A few enhancements will help
    Transferables, built-in matrices
 Production capability is still very crude
    Tools and frameworks are young and evolving
    Export from pro tools lacking
 The real issues facing game developers
      The JavaScript runtime is garbage-y, must take great care
      Device input – mouse lock API coming
      Audio and video API chaos
      Formats and delivery - streaming, compression, binary

                                                                                 10/17/2012
                                                              WebGL For Game Development
Let’s Go~
Contact Information
tparisi@gmail.com
Skype: auradeluxe
http://twitter.com/auradeluxe          http://www.ton
yparisi.com/
Get the Book!
Amazon
http://www.amazon.com/dp/144932357X
O’Reilly Books
http://shop.oreilly.com/product/0636920024729.do



Skybox Engine
https://github.com/tparisi/Skybox
WebGL Book Code
https://github.com/tparisi/WebGLBook

Contenu connexe

Tendances

CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklum Ukraine
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAriya Hidayat
 
Html5 features: location, history and offline apps
Html5 features: location, history and offline appsHtml5 features: location, history and offline apps
Html5 features: location, history and offline appsKonstantin Delchev
 
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersHTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersSascha Corti
 
Web Components the best marriage for a PWA
Web Components the best marriage for a PWAWeb Components the best marriage for a PWA
Web Components the best marriage for a PWAManuel Carrasco Moñino
 
GWT HJUG Presentation
GWT HJUG PresentationGWT HJUG Presentation
GWT HJUG PresentationDerrick Bowen
 
Intro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin ElementsIntro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin ElementsManuel Carrasco Moñino
 
Your Future HTML: The Evolution of Site Design with Web Components
Your Future HTML: The Evolution of Site Design with Web ComponentsYour Future HTML: The Evolution of Site Design with Web Components
Your Future HTML: The Evolution of Site Design with Web ComponentsKen Tabor
 
GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)firenze-gtug
 

Tendances (10)

CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
Html5 features: location, history and offline apps
Html5 features: location, history and offline appsHtml5 features: location, history and offline apps
Html5 features: location, history and offline apps
 
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersHTML5 Intoduction for Web Developers
HTML5 Intoduction for Web Developers
 
HTML5 Comprehensive Guide
HTML5 Comprehensive GuideHTML5 Comprehensive Guide
HTML5 Comprehensive Guide
 
Web Components the best marriage for a PWA
Web Components the best marriage for a PWAWeb Components the best marriage for a PWA
Web Components the best marriage for a PWA
 
GWT HJUG Presentation
GWT HJUG PresentationGWT HJUG Presentation
GWT HJUG Presentation
 
Intro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin ElementsIntro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin Elements
 
Your Future HTML: The Evolution of Site Design with Web Components
Your Future HTML: The Evolution of Site Design with Web ComponentsYour Future HTML: The Evolution of Site Design with Web Components
Your Future HTML: The Evolution of Site Design with Web Components
 
GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)
 

En vedette

En vedette (20)

Portafolio
PortafolioPortafolio
Portafolio
 
Mlwsc5
Mlwsc5Mlwsc5
Mlwsc5
 
Browser-Based Virtual Reality April 2015
Browser-Based Virtual Reality April 2015Browser-Based Virtual Reality April 2015
Browser-Based Virtual Reality April 2015
 
Up And Running With Web VR Fall 2014
Up And Running With Web VR Fall 2014Up And Running With Web VR Fall 2014
Up And Running With Web VR Fall 2014
 
Presentación INNOVATION
Presentación INNOVATIONPresentación INNOVATION
Presentación INNOVATION
 
De technologie staat verder dan u denkt
De technologie staat verder dan u denktDe technologie staat verder dan u denkt
De technologie staat verder dan u denkt
 
Aile nin önemi 2003
Aile nin önemi 2003Aile nin önemi 2003
Aile nin önemi 2003
 
Dog pile
Dog pileDog pile
Dog pile
 
Stirling Henry Us Aust Corp Immi May 2010
Stirling Henry Us Aust Corp Immi May 2010Stirling Henry Us Aust Corp Immi May 2010
Stirling Henry Us Aust Corp Immi May 2010
 
The Technion Library as a physical environment - July 2012
The Technion Library as a physical environment - July 2012The Technion Library as a physical environment - July 2012
The Technion Library as a physical environment - July 2012
 
Perth Corporate Immigration Presentation July 2010
Perth Corporate Immigration Presentation July 2010Perth Corporate Immigration Presentation July 2010
Perth Corporate Immigration Presentation July 2010
 
2ª guerra mundial ppt sobre el desarrollo
2ª guerra mundial ppt sobre el desarrollo2ª guerra mundial ppt sobre el desarrollo
2ª guerra mundial ppt sobre el desarrollo
 
Hair ton cream presentation
Hair ton cream presentationHair ton cream presentation
Hair ton cream presentation
 
Anjni-Catalogue
Anjni-CatalogueAnjni-Catalogue
Anjni-Catalogue
 
1 archivos jar
1 archivos jar1 archivos jar
1 archivos jar
 
Propuesta capacitaciones design thinking lean
Propuesta capacitaciones design thinking leanPropuesta capacitaciones design thinking lean
Propuesta capacitaciones design thinking lean
 
Claims
ClaimsClaims
Claims
 
Presentación Corporativa Gyga
Presentación Corporativa Gyga Presentación Corporativa Gyga
Presentación Corporativa Gyga
 
Cover
CoverCover
Cover
 
Stirling Henry 2010 Brochure
Stirling Henry 2010 BrochureStirling Henry 2010 Brochure
Stirling Henry 2010 Brochure
 

Similaire à WebGL For Game Development 2012

WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013Tony Parisi
 
Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Seung Joon Choi
 
HTML5 & JavaScript Games
HTML5 & JavaScript GamesHTML5 & JavaScript Games
HTML5 & JavaScript GamesRobin Hawkes
 
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
 
HTML5 Games Status and issues
HTML5 Games Status and issuesHTML5 Games Status and issues
HTML5 Games Status and issuesJ.h. Liu
 
WebGL demos showcase
WebGL demos showcaseWebGL demos showcase
WebGL demos showcaseYukio Andoh
 
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
 
WebGL Crash Course
WebGL Crash CourseWebGL Crash Course
WebGL Crash CourseTony Parisi
 
Paris Android User Group - Build 3D web, mobile and desktop applications with...
Paris Android User Group - Build 3D web, mobile and desktop applications with...Paris Android User Group - Build 3D web, mobile and desktop applications with...
Paris Android User Group - Build 3D web, mobile and desktop applications with...Minko3D
 
HTML5DevConf 2013 (October): WebGL is a game changer!
HTML5DevConf 2013 (October): WebGL is a game changer!HTML5DevConf 2013 (October): WebGL is a game changer!
HTML5DevConf 2013 (October): WebGL is a game changer!Iker Jamardo
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esdavrous
 
Minko - Windows App Meetup Nov. 2013
Minko - Windows App Meetup Nov. 2013Minko - Windows App Meetup Nov. 2013
Minko - Windows App Meetup Nov. 2013Minko3D
 
Full stack development in Go
Full stack development in GoFull stack development in Go
Full stack development in GoYves Junqueira
 
GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day DNG Consulting
 
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArt
Interactive  3D graphics for web with three.js, Andrey Vedilin, DataArtInteractive  3D graphics for web with three.js, Andrey Vedilin, DataArt
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArtAlina Vilk
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkitPaul Jensen
 
Dev Fest X (Sapporo) WebGL
Dev Fest X (Sapporo) WebGLDev Fest X (Sapporo) WebGL
Dev Fest X (Sapporo) WebGLYukio Andoh
 
140716 : 同業前端聚會分享 - webgl 與 three.js
140716 : 同業前端聚會分享 - webgl 與 three.js140716 : 同業前端聚會分享 - webgl 與 three.js
140716 : 同業前端聚會分享 - webgl 與 three.jsangelliya00
 

Similaire à WebGL For Game Development 2012 (20)

WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013
 
Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Webgl 기술동향 2011.8
Webgl 기술동향 2011.8
 
HTML5 & JavaScript Games
HTML5 & JavaScript GamesHTML5 & JavaScript Games
HTML5 & JavaScript Games
 
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
 
HTML5 Games Status and issues
HTML5 Games Status and issuesHTML5 Games Status and issues
HTML5 Games Status and issues
 
WebGL demos showcase
WebGL demos showcaseWebGL demos showcase
WebGL demos showcase
 
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
 
WebGL Crash Course
WebGL Crash CourseWebGL Crash Course
WebGL Crash Course
 
Web components api + Vuejs
Web components api + VuejsWeb components api + Vuejs
Web components api + Vuejs
 
Paris Android User Group - Build 3D web, mobile and desktop applications with...
Paris Android User Group - Build 3D web, mobile and desktop applications with...Paris Android User Group - Build 3D web, mobile and desktop applications with...
Paris Android User Group - Build 3D web, mobile and desktop applications with...
 
HTML5 Game Development frameworks overview
HTML5 Game Development frameworks overviewHTML5 Game Development frameworks overview
HTML5 Game Development frameworks overview
 
HTML5DevConf 2013 (October): WebGL is a game changer!
HTML5DevConf 2013 (October): WebGL is a game changer!HTML5DevConf 2013 (October): WebGL is a game changer!
HTML5DevConf 2013 (October): WebGL is a game changer!
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
 
Minko - Windows App Meetup Nov. 2013
Minko - Windows App Meetup Nov. 2013Minko - Windows App Meetup Nov. 2013
Minko - Windows App Meetup Nov. 2013
 
Full stack development in Go
Full stack development in GoFull stack development in Go
Full stack development in Go
 
GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day
 
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArt
Interactive  3D graphics for web with three.js, Andrey Vedilin, DataArtInteractive  3D graphics for web with three.js, Andrey Vedilin, DataArt
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArt
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
Dev Fest X (Sapporo) WebGL
Dev Fest X (Sapporo) WebGLDev Fest X (Sapporo) WebGL
Dev Fest X (Sapporo) WebGL
 
140716 : 同業前端聚會分享 - webgl 與 three.js
140716 : 同業前端聚會分享 - webgl 與 three.js140716 : 同業前端聚會分享 - webgl 與 three.js
140716 : 同業前端聚會分享 - webgl 與 three.js
 

Plus de Tony Parisi

The New Fine Arts
The New Fine ArtsThe New Fine Arts
The New Fine ArtsTony Parisi
 
Face the Future: Computing in an Augmented World
Face the Future: Computing in an Augmented WorldFace the Future: Computing in an Augmented World
Face the Future: Computing in an Augmented WorldTony Parisi
 
Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Tony Parisi
 
WebVR: Developing for the Immersive Web
WebVR: Developing for the Immersive WebWebVR: Developing for the Immersive Web
WebVR: Developing for the Immersive WebTony Parisi
 
Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016Tony Parisi
 
WebVR Ecosystem and API Update
WebVR Ecosystem and API UpdateWebVR Ecosystem and API Update
WebVR Ecosystem and API UpdateTony Parisi
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive WebTony Parisi
 
The Immersive Web
The Immersive WebThe Immersive Web
The Immersive WebTony Parisi
 
Virtually Anyone
Virtually AnyoneVirtually Anyone
Virtually AnyoneTony Parisi
 
React-VR: An Early Experiment with React and WebGL for VR Development
React-VR: An Early Experiment with React and WebGL for VR DevelopmentReact-VR: An Early Experiment with React and WebGL for VR Development
React-VR: An Early Experiment with React and WebGL for VR DevelopmentTony Parisi
 
WebGL: The Next Generation
WebGL:  The Next GenerationWebGL:  The Next Generation
WebGL: The Next GenerationTony Parisi
 
Vrml, or There and Back Again
Vrml, or There and Back AgainVrml, or There and Back Again
Vrml, or There and Back AgainTony Parisi
 
The Coming Distribution War
The Coming Distribution WarThe Coming Distribution War
The Coming Distribution WarTony Parisi
 
VR Without Borders RIVER WebVR April 2015
VR Without Borders RIVER WebVR April 2015VR Without Borders RIVER WebVR April 2015
VR Without Borders RIVER WebVR April 2015Tony Parisi
 
glTF and the WebGL Art Pipeline March 2015
glTF and the WebGL Art Pipeline March 2015glTF and the WebGL Art Pipeline March 2015
glTF and the WebGL Art Pipeline March 2015Tony Parisi
 
An Introduction to Web VR January 2015
An Introduction to Web VR January 2015An Introduction to Web VR January 2015
An Introduction to Web VR January 2015Tony Parisi
 
The Web Eats Everything In Its Path Fall 2014
The Web Eats Everything In Its Path Fall 2014The Web Eats Everything In Its Path Fall 2014
The Web Eats Everything In Its Path Fall 2014Tony Parisi
 
Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Tony Parisi
 
WebGL, WebVR and the Metaverse
WebGL, WebVR and the MetaverseWebGL, WebVR and the Metaverse
WebGL, WebVR and the MetaverseTony Parisi
 
And Who Shall Control the Metaverse?
And Who Shall Control the Metaverse?And Who Shall Control the Metaverse?
And Who Shall Control the Metaverse?Tony Parisi
 

Plus de Tony Parisi (20)

The New Fine Arts
The New Fine ArtsThe New Fine Arts
The New Fine Arts
 
Face the Future: Computing in an Augmented World
Face the Future: Computing in an Augmented WorldFace the Future: Computing in an Augmented World
Face the Future: Computing in an Augmented World
 
Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17
 
WebVR: Developing for the Immersive Web
WebVR: Developing for the Immersive WebWebVR: Developing for the Immersive Web
WebVR: Developing for the Immersive Web
 
Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016
 
WebVR Ecosystem and API Update
WebVR Ecosystem and API UpdateWebVR Ecosystem and API Update
WebVR Ecosystem and API Update
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive Web
 
The Immersive Web
The Immersive WebThe Immersive Web
The Immersive Web
 
Virtually Anyone
Virtually AnyoneVirtually Anyone
Virtually Anyone
 
React-VR: An Early Experiment with React and WebGL for VR Development
React-VR: An Early Experiment with React and WebGL for VR DevelopmentReact-VR: An Early Experiment with React and WebGL for VR Development
React-VR: An Early Experiment with React and WebGL for VR Development
 
WebGL: The Next Generation
WebGL:  The Next GenerationWebGL:  The Next Generation
WebGL: The Next Generation
 
Vrml, or There and Back Again
Vrml, or There and Back AgainVrml, or There and Back Again
Vrml, or There and Back Again
 
The Coming Distribution War
The Coming Distribution WarThe Coming Distribution War
The Coming Distribution War
 
VR Without Borders RIVER WebVR April 2015
VR Without Borders RIVER WebVR April 2015VR Without Borders RIVER WebVR April 2015
VR Without Borders RIVER WebVR April 2015
 
glTF and the WebGL Art Pipeline March 2015
glTF and the WebGL Art Pipeline March 2015glTF and the WebGL Art Pipeline March 2015
glTF and the WebGL Art Pipeline March 2015
 
An Introduction to Web VR January 2015
An Introduction to Web VR January 2015An Introduction to Web VR January 2015
An Introduction to Web VR January 2015
 
The Web Eats Everything In Its Path Fall 2014
The Web Eats Everything In Its Path Fall 2014The Web Eats Everything In Its Path Fall 2014
The Web Eats Everything In Its Path Fall 2014
 
Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5
 
WebGL, WebVR and the Metaverse
WebGL, WebVR and the MetaverseWebGL, WebVR and the Metaverse
WebGL, WebVR and the Metaverse
 
And Who Shall Control the Metaverse?
And Who Shall Control the Metaverse?And Who Shall Control the Metaverse?
And Who Shall Control the Metaverse?
 

Dernier

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
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
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
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
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
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, ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

WebGL For Game Development 2012

  • 1. WebGL for Game Development Tony Parisi http://www.tonyparisi.com
  • 2. About Me  Serial entrepreneur  Founder, stealth game startup Skybox Engine https://github.com/tparisi/Skybox  Consulting architect and CTO WebGL Book Code  Web3D Co-Creator, VRML and X3D https://github.com/tparisi/WebGLBook  Author Contact Information tparisi@gmail.com Skype: auradeluxe http://twitter.com/auradeluxe http://www.ton yparisi.com/ Get the Book! Amazon http://www.amazon.com/dp/144932357X O’Reilly Books http://shop.oreilly.com/product/0636920024729.do
  • 3. What is WebGL?  The new 3D API standard  OpenGL ES™ in a browser  JavaScript API bindings  Supported in nearly all modern browsers  Supported on many devices  Shipped since early 2011 …and it’s Awesome. 10/17/2012 WebGL For Game Development
  • 4. Who Controls WebGL?  Part of the HTML5 family of technologies  …not really.  …well, really.  Standard maintained by Khronos Grouphttp://www.khronos.org  Major browser and system makers  Solid, stable set of core contributors  Serious conformance effort 10/17/2012 WebGL For Game Development
  • 5. Where Does WebGL Run?  Chrome, Firefox, Safari, Opera  NOT Internet Explorer  iOS – iAds only  Android – coverage spotty  Blackberry – making big push with HTML5 platform  500M+ seats 10/17/2012 WebGL For Game Development
  • 6. Why Use WebGL for Games?  Rich internet experiences with true hardware-accelerated 3D  No download  Complete integration with page elements – use HTML5 for all your game UI  (Mostly) cross-platform  Rapid development  Performance – it’s faster than 2D canvas  Royalty-free - no licensing issues 10/17/2012 WebGL For Game Development
  • 7. Why Not Use WebGL For Games?  Not supported in IE  Not turned on by default in Safari  Limited iOS  General performance issues with mobile browser-based games  Cross-platform and performance issues could be mitigated with a hybrid Native/JS strategy using libraries like AppMobi, Ludei  Engines and tools still a mishmash 10/17/2012 WebGL For Game Development
  • 8. JavaScript: NOT a Reason to Not Use WebGL For Games From: Brendan Eich’s The State of JavaScript 10/17/2012 http://brendaneich.github.com/Strange-Loop-2012/#/ WebGL For Game Development
  • 9. Don’t Believe Me? Check This Out Brandon Jones’ Blog http://blog.tojicode.com/2011/05/ios-rage-rendered- 10/17/2012 with-webgl.html WebGL For Game Development
  • 10. How WebGL Works  It’s a JavaScript drawing API  Draw to a canvas element using a special context  Low-Level drawing – buffers, primitives, textures and shaders  There is no file format or object model Here’s a Sample. 10/17/2012 WebGL For Game Development
  • 11. Building a Game  Choosing a framework  Drawing graphics  Loading models  Building a particle system  Animation  Interaction  Integrating 2D and 3D  Adding sound  Making it robust  Putting it all together 10/17/2012 WebGL For Game Development
  • 12. Choosing a Framework  Open source rendering engines/frameworks  Three.js  CubicVR  SceneGL  GLGE  Emerging game engines  Gladius  KickJS  Skybox  Roll your own? 10/17/2012 WebGL For Game Development
  • 13. Three.js – A JavaScript 3D Engine  Renders to 3D WebGL or 2D standard canvas  Represents WebGL at a high level using standard 3D graphics concepts  Feature rich  Fast, robust, well maintained  It’s a library, not a game engine, not a framework https://github.com/mrdoob/three.js/ Here’ s That Square Again. 10/17/2012 WebGL For Game Development
  • 14. Sim.js – A Simple Simulation Framework for WebGL/Three.js  Wraps common Three.js setup, teardown and handling  Implements the run loop  Uses requestAnimationFrame() (vs. setTimeout())  Adds handlers for mouse and keyboard DOM events  Provides foundation objects (Application, Base object and PubSub)  Handles WebGL detection and context lost events https://github.com/tparisi/Sim.js 10/17/2012 WebGL For Game Development
  • 15. Drawing Graphics  Primitive shapes  Polygon meshes  Points and lines  Materials  Textures  Lights  Transform hierarchy  Shaders 10/17/2012 WebGL For Game Development
  • 16. Loading Models  WebGL has no built-in file format  Most formats are engine- specific  Many WebGL frameworks support COLLADA  Three.js has JSON format with blender exporter, OBJ file converter  Overall, tools and exporters still primitive 10/17/2012 WebGL For Game Development
  • 17. Animating The Scene  WebGL has no built-in animation support  Three.js has some animation utilities  Key frames  Skins  Morphs  With JavaScript, we can build our own anyway  Animate anything: transforms, textures, mater ials, lights… 10/17/2012 WebGL For Game Development
  • 18. Implementing Interaction  Mouse: DOM event handling plus Three.js picking support  Keyboard handling is standard DOM 10/17/2012 WebGL For Game Development
  • 19. Creating Effects – a Particle System  Three.js has a basic built-in particle system  But it’s very basic: no emitters or physics models  You have to animate it all yourself 10/17/2012 WebGL For Game Development
  • 20. Integrating 2D and 3D  WebGL’s secret weapon  Breaks down window boundaries  2D overlaid on 3D  3D overlaid on 2D  Canvas2D as a texture  Video as a texture 10/17/2012 WebGL For Game Development
  • 21. Adding Sound  Use new <audio> element  Fairly well supported in browsers  Other APIs (Moz, Chrome) not supported uniformly 10/17/2012 WebGL For Game Development
  • 22. Making It Robust  Detecting WebGL support in the browser var canvas = document.createElement("canvas"); var gl = null; var msg = "Your browser does not support WebGL."; try { gl = canvas.getContext("experimental-webgl"); } catch (e) { msg = "Error creating WebGL Context!: " + e.toString(); } if (!gl) { throw new Error(msg); } 10/17/2012 WebGL For Game Development
  • 23. Making It Robust  Detecting a lost context RacingGame.prototype.handleContextLost = function(e) { this.restart(); } RacingGame.prototype.addContextListener = function() { var that = this; this.renderer.domElement.addEventListener("webglcontextlost", function(e) { that.handleContextLost(e); }, false); } 10/17/2012 WebGL For Game Development
  • 24. Putting It All Together 10/17/2012 WebGL For Game Development
  • 25. More Stuff  Physics  Box2DJS http://box2d-js.sourceforge.net/  JigLibJS2 http://brokstuk.com/jiglibjs2/  Ammo https://github.com/kripken/ammo.js/  Authoring Tools  Need help…  https://github.com/tparisi/3dsMaxWebGL  Engines  Need help…  https://github.com/tparisi/Skybox  Cross-compiler tools – very promising! 10/17/2012 WebGL For Game Development  http://developer.mozilla.org/en-US/demos/detail/bananabread
  • 26. The Bottom Line  WebGL is solid for developing games  OpenGL ES under the hood (it’s what’s running on your phone and tablet)  Huge development, testing and conformance effort by browser writers  Strong standards group maintaining it (www.khronos.org)  In most browsers and growing number of devices  A few enhancements will help  Transferables, built-in matrices  Production capability is still very crude  Tools and frameworks are young and evolving  Export from pro tools lacking  The real issues facing game developers  The JavaScript runtime is garbage-y, must take great care  Device input – mouse lock API coming  Audio and video API chaos  Formats and delivery - streaming, compression, binary 10/17/2012 WebGL For Game Development
  • 27. Let’s Go~ Contact Information tparisi@gmail.com Skype: auradeluxe http://twitter.com/auradeluxe http://www.ton yparisi.com/ Get the Book! Amazon http://www.amazon.com/dp/144932357X O’Reilly Books http://shop.oreilly.com/product/0636920024729.do Skybox Engine https://github.com/tparisi/Skybox WebGL Book Code https://github.com/tparisi/WebGLBook