SlideShare a Scribd company logo
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

More Related Content

What's hot

CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
Ciklum Ukraine
 

What's hot (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)
 

Viewers also liked

Aile nin önemi 2003
Aile nin önemi 2003Aile nin önemi 2003
Aile nin önemi 2003
Ozan Yılmaz
 
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
tim_denney
 
Hair ton cream presentation
Hair ton cream presentationHair ton cream presentation
Hair ton cream presentation
Dr. Hani Malkawi
 
Claims
ClaimsClaims
Claims
aec111
 
Stirling Henry 2010 Brochure
Stirling Henry 2010 BrochureStirling Henry 2010 Brochure
Stirling Henry 2010 Brochure
tim_denney
 

Viewers also liked (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
 

Similar to WebGL For Game Development 2012

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
philogb
 
HTML5 Games Status and issues
HTML5 Games Status and issuesHTML5 Games Status and issues
HTML5 Games Status and issues
J.h. Liu
 
WebGL demos showcase
WebGL demos showcaseWebGL demos showcase
WebGL demos showcase
Yukio Andoh
 
WebGL Crash Course
WebGL Crash CourseWebGL Crash Course
WebGL Crash Course
Tony Parisi
 
Minko - Windows App Meetup Nov. 2013
Minko - Windows App Meetup Nov. 2013Minko - Windows App Meetup Nov. 2013
Minko - Windows App Meetup Nov. 2013
Minko3D
 
Dev Fest X (Sapporo) WebGL
Dev Fest X (Sapporo) WebGLDev Fest X (Sapporo) WebGL
Dev Fest X (Sapporo) WebGL
Yukio Andoh
 

Similar to 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
 

More from Tony Parisi

More from 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?
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 

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