SlideShare uma empresa Scribd logo
1 de 103
HTML5 and other Modern Browser Game Tech Vincent Scheib Software Engineer, Chrome GPU team February 28, 2011 1
This is an Overview Overview & Motivation Browsers, Platforms Technology Survey Graphics, Audio, Networking, Storage… Libraries, Benchmarks 2
Overview & Motivation 3
My Perspective on the Last Decade & Web Tech 4 GPU Acceleration C++ in Browser Chrome OS
April 1 2010 – Quake II in HTML5 Ray Cromwell, Stefan Haustein, Joel Webber – Google - WebGL, canvas - Web Sockets - Local Storage - Audio Chrome & Safari 5
No Plugins 6 Not discussing: Flash, Java, Silverlight, Unity
Plugin Use / Installation% of Chrome Users 7 iOS * Data from users opting in to reporting usage statistics, 2010
Low Friction, Better Security 8
Browsers and Platforms 9
Browser Trends 10 IE Firefox Chrome
Mobile Trends Opera iPhone Nokia BlackBerry Android 11
Mobile Trends iPhone Android Nokia BlackBerry Opera iPhone Nokia BlackBerry Android 12
Mobile Native or Web App? iOS & Android Monetize Native Apps WebApp wrappers: PhoneGap, appMobi Performance Native has greater perf, but On Android, can call through to C++ from JS Forms Input HTML5 input forms produce correct input device Touch 13
Chrome Web Store – Distribution & Monetization 14
Chrome Web Store – Chrome Integration 15
Chrome Web Store Discovery, Distribution and Monetization on the Web 16 Web Apps 120 million users In-app payments coming soongoogle.com/checkout/inapp … And Monetization
The Browser is the Platform ChromeOS webOS 17
Browser Technologies 18
Canvas 2D 19
Canvas 2D –Examples 20
Canvas 2D – Overview Mostly Sprites Flash  Widely supported (mobile & desktop) IE9 brings GPU performance Javscript Shim Libraries run on old IE, e.g. ExplorerCanvas GPU upgrades Hundreds to Thousands of Draws @30fps Immediate Mode Popular 21
Canvas 2D – API Primitives rect, circle arcs, lines, bezier curves, text, images Drawing fill and stroke Effects shadows, gradients, image patterns, line styles, clipping, compositing operations Transforms rotate, scale, matrix transform (2x2 + translation) 22 Text
Canvas 2D – Simple Sample <canvas id="e" width="200" height="100"></canvas><script>  var context =document.getElementById("e").getContext("2d");  var cat = new Image();  cat.src = "images/cat.png";  cat.onload = function() {    context.drawImage(cat, 0, 0); };</script> 23
Canvas 2D – Fill and Stroke Sample // Draw eyesctx.fillRect(160, 130, 20, 80);ctx.fillRect(220, 130, 20, 80);// Draw mouthctx.beginPath();ctx.moveTo(100, 230); // Start smilectx.bezierCurveTo(100, 230, 200, 380, 300, 230);ctx.moveTo(219, 298); // Start tonguectx.bezierCurveTo(278, 351, 315, 315, 277, 258);ctx.lineWidth = 20;ctx.stroke(); (adapted from IE9 sample) 24
Canvas 2D – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: GO! 25 - caniuse.com, Feb 2011
Scalable Vector Graphics SVG 26
SVG – Examples 27
SVG – Overview Vector markup language Declarative or retainedprocedural API Tools (Illustrator, Inkscape) HTML5 Enables SVG Markup Inline with HTML Retained API GPU Acceleration Friendly - Retained data structures allow caching Little Groundswell Complex API? Retained? 28
SVG – Sample <!DOCTYPE html><html><body>    <svg id=“mySVG”>      <circle id="circle0"  cx="100" cy="75" r="50"              fill="grey"              stroke="black"              stroke-width="5“ onmousedown="alert('clicked');"gt;      <text x="60" y="155">Hello World</text>    </svg> ... 29
SVG – Sample  <script> var circle = document.createElementNS( 			"http://www.w3.org/2000/svg", "circle"); circle.setAttribute('cx', 90);  circle.setAttribute('cy', 90); circle.setAttribute('r', 30); circle.setAttribute('onmousedown', "alert('no, me!');"); document.getElementById("svg0").appendChild(circle);   </script> </body></html> 30
SVG – Links raphaeljs.com Ease of use, charts, etc. burst.bocoup.com Renders SVG into Canvas 2D 31
SVG – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: iOS GO! – Android: No 32 - caniuse.com, Feb 2011
Canvas 3D WebGL 33
WebGL – Examples 34
WebGL – Overview Open GL ES 2 Textures, Framebuffers, Blending Vertex and Fragment Shaders (GLSL) Khronos group specification 1.0 Q1 2011 Matrix libraries come separately What will Microsoft do? 35
WebGL – Libraries Many Higher Level Libraries C3DL Copperlicht GLGE O3D Processing.js SpiderGL SceneJS three.js WebGLU XB PointStream 36
WebGL Inspector (Ben Vanik) 37
WebGL – Sample Spinning Box 38
WebGL – Sample Spinning Box <script id="vshader" type="x-shader/x-vertex">      uniform mat4 u_modelViewProjMatrix;     uniform mat4 u_normalMatrix;     uniform vec3 lightDir;     attribute vec3 vNormal;     attribute vec4 vColor;     attribute vec4 vPosition;     varying float v_Dot;         varying vec4 v_Color;     void main() { gl_Position = u_modelViewProjMatrix * vPosition; v_Color = vColor;         vec4 transNormal = u_normalMatrix * vec4(vNormal, 1); v_Dot = max(dot(transNormal.xyz, lightDir), 0.0); 39
WebGL – Sample Spinning Box <script id="fshader" type="x-shader/x-fragment">      varying float v_Dot;     varying vec4 v_Color;     void main()     { gl_FragColor = vec4(v_Color.xyz * v_Dot, v_Color.a);     } </script> 40
WebGL – Sample Spinning Box gl = canvas.getContext(“webgl”, args); gl.createShader(shaderType); gl.shaderSource(shader, shaderScript.text); gl.compileShader(shader); var colors = new Uint8Array( [  0, 0, 1, 1,   0, 0, 1, 1,   0, 0, 1, 1,   0, 0, 1, 1, 			      1, 0, 0, 1,   1, 0, 0, 1,   1, 0, 0, 1,   1, 0, 0, 1,  			      //… gl.box.colorObject = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, gl.box.colorObject); gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); //… 41
WebGL – Sample Spinning Box function drawPicture(gl)    { reshape(gl); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Make a model/view matrix. gl.mvMatrix.makeIdentity(); gl.mvMatrix.rotate(20, 1,0,0); gl.mvMatrix.rotate(currentAngle, 0,1,0); //… gl.drawElements(	gl.TRIANGLES, gl.box.numIndices, gl.UNSIGNED_BYTE, 0); 42
WebGL – Demos NinePointFive Aquarium Google Body 43
WebGL – Availability Chrome – Firefox – Safari: Chrome  Shipped. Soon in FF4 & Safari Internet Explorer: No Mobile: Waiting on Firefox 4, other browsers in progress. 44 - caniuse.com, Feb 2011
aka – your render loop requestAnimationFrame 45
requestAnimationFrame – Overview Status Quo: Draw, Draw, Draw, Blindly!  setInterval(draw, 16) Browser Calls You (FireFox Beta 4, Chrome 10) function draw() {     //... Do Drawing Work, then ask to called again: window.requestAnimationFrame(draw); } // kick off first frame: window.requestAnimationFrame(draw); 46 setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16)
requestAnimationFrame – Availability Chrome – Firefox – Safari: Soon in Chrome 10, FF4 Use a Shim, future compatible:// shim layer with setTimeout fallback – Paul Irish window.requestAnimFrame = (function(){   return	window.requestAnimationFrame       	||  window.webkitRequestAnimationFrame 	||  window.mozRequestAnimationFrame    	||  window.oRequestAnimationFrame      	||  window.msRequestAnimationFrame     	||  	function(/* function */ callback, /* DOMElement */ element){ window.setTimeout(callback, 1000 / 60);   }; })(); 47
Cascading Style Sheets – 3D Transformations CSS 3D 48
CSS 3D – Examples CSS3D 49
CSS 3D – Overview Add 3D to Any Web Content Helps make cool HUD 50
CSS 3D – Sample <!DOCTYPE html><html><body>  <div style="-webkit-perspective: 400;"> <iframe src="http://www.gdconf.com/" width = 1024 height = 768     style="-webkit-transform: rotate3d(1,0,0, 15deg)"> </iframe> </div> </body></html> 51
CSS 3D – Availability Chrome – Firefox – Safari: Soon in Chrome, FF No, Safari GO! Internet Explorer: No Mobile: iOS GO! – Android: No 52 - caniuse.com, Feb 2011
Web Fonts 53
Web Fonts – Overview Game UI via HTML Serve Custom Fonts Easy Google Fonts API <link href='http://fonts…?family=Chewy‘rel='stylesheet' type='text/css'> In CSS: h1 { font-family: 'Chewy', arial, serif; } 54
Web Fonts – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Best in IE9 Mobile: Mostly…  55 - caniuse.com, Feb 2011
<audio> 56
<audio> – Overview Tags in HTML, or created by javascript 57
<audio> – Sample  var audio = new Audio(); audio.addEventListener("canplaythrough", function () { audio.play(); }); audio.src = “treasure.ogg”; 58
<audio> – Issues iOS >= 4 – only one sample at a time No one codec supported by all browsers.  Pick 2 from: MP3, Vorbis, WAV detect suitability before loading, with e.g. new Audio().canPlayType(“audio/ogg”); 59
<audio> – Future1 FireFox Audio Data API supports Read/Write samples var output = new Audio(); output.mozSetup(1, 44100); var samples = new Float32Array(22050); varlen = samples.length;        for (vari = 0; i < samples.length ; i++) {          samples[i] = Math.sin( i / 20 );        } output.mozWriteAudio(samples); 60
<audio> – Future2 Web Audio API Node graph Low latency Spatialization, 3d Reverb Native implementation performance 61
<audio> – Links SoundManager 2 Flash fallback www.schillmania.com/projects/soundmanager2 62
<audio> – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: (With limits) 63 - caniuse.com, Feb 2011
<video> 64
<video> – Overview Source for textures in <canvas> 2D or WebGLvideoElement.play();   videoElement.addEventListener("timeupdate",updateTexture, true);     function updateTexture() {   gl.bindTexture(gl.TEXTURE_2D, cubeTexture);       gl.texImage2D(gl.TEXTURE_2D, 0, videoElement, true);   gl.generateMipmap(gl.TEXTURE_2D);   } Demo 65
<video> – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: GO! 66 - caniuse.com, Feb 2011
WebSockets 67
WebSockets – Overview Low latency, persistent, full duplex  Upgrades from HTTP handshake UTF8 Simple var socket = new WebSocket(“ws://server.com”); socket.onopen = function(event) { socket.send(“Hello Server”); } socket.onmessage = function(event) {  alert(“Server says: “ + event.data); 68
WebSockets - Future FireFox and Opera Behind Flag Standard for protocol upgrade Binary Peer to Peer Unreliable (vs TCP) 69
WebSockets – Links socket.io Higher level library Transport on WebSockets, Flash, Ajax, … github.com/gimite/web-socket-js Shim implementation on top of Flash 70
Web Sockets – Availability Chrome – Firefox – Safari: Yes, Still Stabilizing, Some Behind a Flag Internet Explorer: In HTML5 Labs Mobile: iOS Stabilizing, Android? 71 - caniuse.com, Feb 2011
Javascript on your Server Node.JS 72
Node.JS – Overview Ease of Same Language and Client & Server Simple, lots of uptake Tools / Plugins WebSockets, manage connections, render server side, just lots... Visual Debugger 73
GeoLocation 74
GeoLocation – Sample Mobile, and Desktops too navigator.geolocation.getCurrentPosition(      function (location) { doSomething(location.coords.latitude,  location.coords.longitude);  }); 75
GeoLocation – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: GO! 76 - caniuse.com, Feb 2011
DeviceOrientationDeviceMotionEvent 77
DeviceOrientation – Overview iOS >= 4.2 Chrome on Mac 78
DeviceOrientation – Sample window.addEventListener("devicemotion", function(event) {           // event.acceleration,          // event.accelerationIncludingGravity,           // event.rotationRate,           // event.interval       }, true); 79
DeviceOrientation – Availability Chrome – Firefox – Safari: Yes, but not on all devices Internet Explorer: ? Mobile: Only iOS >= 4.2 80
Some options… Saving Data on the Client 81
82
Web Storage – Overview Local Storage & Session Storage 5MB of key value pair strings localStorage["levels-unlocked"] = 5 // or .getItem() / .setItem() localStorage.removeItem() localStorage.clear(); // Dump everything Widely supported Non Transactional No good recourse if over limit 83
Web Storage – Availability Chrome – Firefox – Safari: GO! Internet Explorer: GO! Mobile: GO! 84 - caniuse.com, Feb 2011
File API: Directories & Systems – Availability Chrome: Yes for Apps and Extensions Firefox – Safari: No Internet Explorer: No Mobile: No 85
Application Cache – Overview Cache HTML pages and Resources Manifest File 	CACHE MANIFEST 	index.html 	stylesheet.css 	images/logo.png 	scripts/main.js 86
Application Cache – Availability Chrome – Firefox – Safari: GO! Internet Explorer: No Mobile: GO! 87 - caniuse.com, Feb 2011
window.navigator.onLinedocument.body.addEventListener(“online”, callback); Offline 88
Multithreading Javascript Web Workers 89
Web Workers – Sample html5rocks.com/tutorials/workers/basics/ main.js (main thread): var worker = new Worker('doWork.js'); worker.addEventListener('message',  	function(e) { console.log('Worker said: ', e.data); }, false); worker.postMessage('Hello World'); // Send data to our worker. doWork.js (the worker): self.addEventListener('message', function(e) { self.postMessage(e.data + “? ” + e.data + “!”); }, false); // Output “Worker said: Hello World? Hello World!” 90
Web Workers – Availability Chrome – Firefox – Safari: GO! Internet Explorer: No Mobile: No 91 - caniuse.com, Feb 2011
C++ for your web app Native Client 92
Native Client – Overview Machine Code Served to Browser C/C++, Mono(C#), others NoPlugins Legacy C++ Codebase in your Web App Performance Cross Platform 93 A Web Page Full of text, lots of interesting stuff, links, blah blah. Don’t read all the links, all this text. JS A Web Page Full of text, lots of interesting stuff, links, blah blah. Don’t read all the links, all this text. C++
Native Client – Security Static analysis & Sandboxing Restricted instructions Isolate code Custom Toolchain 94 Browser NaCl v8 JS C++ Browser Plugin Operating System Operating System
Native Client – Availability Chrome: Behind flag Open Source 95
How much time is left? Whew 96
GPU Acceleration Chrome 9 WebGL shipped February 3rd Chrome Developer & Canary Video, 3D CSS, Canvas 2D, Compositing Firefox 4 Beta WebGL, Video, 2D CSS, Canvas 2D, SVG, Compositing IE 9 Beta “all graphics and text rendering” 97
Benchmarks Needed JSGameBench, Facebook “over 125 million people visit Facebook using HTML5 capable browsers just from their mobile phone” Sprite performance, options (WebGL, <canvas>, <img>, <div>, …) 1000-4000 @30fps on GPU 50-200 mid range desktops 20-30 iOS & Android 98
Libraries Canvas 2D ImpactJS, Akihabara WebGL GLGE, C3DL, Copperlicht, SpiderGL, SceneJS, O3D, Processing.js and XB PointStream, WebGLU Document Object Model (DOM) Rocket Engine, Zynga Germany (was Aves Engine) Physics Box2DWeb, Jiglib 3D 99
What’s Missing Mouse Capture Gamepads Audio input Webcam input 100
More! At GDC Google Sessions Today and Tomorrow Cloud Services, WebGL, Native Client, YouTube APIs Android AndroidAndroidAndroidAndroid Google Booth Sketchup,Web Store, WebGL Native Client, AppEngine, Android Other HTML5 Sessions WebGL News and Technology Updates (Khronos), Thursday Getting Your Games onto the BlackBerry PlayBook Tablet, Thursday HTML5: The New UI Library for Games, Friday 101
Thanks Alexis Deveria, caniuse.com feature tables Athena's Pix [flickr], overview image Chris Pruett Daniel Galpin Darius Kazemi Geoff Blair Gregg Tavares Mark DeLoura Mark Pilgrim (diveintohtml5.org) Matt Hackett 102
Q&A 103 code.google.com/games @GoogleGameDev

Mais conteúdo relacionado

Mais procurados

Creating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web ComponentsCreating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web ComponentsRachael L Moore
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important PartsSergey Bolshchikov
 
Building Rich Internet Applications with HTML5 and WebGL
Building Rich Internet Applications with HTML5 and WebGLBuilding Rich Internet Applications with HTML5 and WebGL
Building Rich Internet Applications with HTML5 and WebGLTony Parisi
 
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJLeonardo Balter
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To PracticeSergey Bolshchikov
 
I Can't Believe It's Not Flash
I Can't Believe It's Not FlashI Can't Believe It's Not Flash
I Can't Believe It's Not FlashThomas Fuchs
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Remy Sharp
 
Developing Web Graphics with WebGL
Developing Web Graphics with WebGLDeveloping Web Graphics with WebGL
Developing Web Graphics with WebGLTony Parisi
 
Scalable vector ember
Scalable vector emberScalable vector ember
Scalable vector emberMatthew Beale
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeLaurence Svekis ✔
 
What Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsWhat Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsDoris Chen
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponentsMartin Hochel
 
HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]
HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]
HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]Aaron Gustafson
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
WordCamp ABQ 2013: Making the leap from Designer to Designer/Developer
WordCamp ABQ 2013: Making the leap from Designer to Designer/DeveloperWordCamp ABQ 2013: Making the leap from Designer to Designer/Developer
WordCamp ABQ 2013: Making the leap from Designer to Designer/Developermy easel
 

Mais procurados (20)

Creating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web ComponentsCreating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web Components
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
Building Rich Internet Applications with HTML5 and WebGL
Building Rich Internet Applications with HTML5 and WebGLBuilding Rich Internet Applications with HTML5 and WebGL
Building Rich Internet Applications with HTML5 and WebGL
 
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
I Can't Believe It's Not Flash
I Can't Believe It's Not FlashI Can't Believe It's Not Flash
I Can't Believe It's Not Flash
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
 
Developing Web Graphics with WebGL
Developing Web Graphics with WebGLDeveloping Web Graphics with WebGL
Developing Web Graphics with WebGL
 
Scalable vector ember
Scalable vector emberScalable vector ember
Scalable vector ember
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your code
 
Hardboiled Web Design
Hardboiled Web DesignHardboiled Web Design
Hardboiled Web Design
 
The Devil and HTML5
The Devil and HTML5The Devil and HTML5
The Devil and HTML5
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
What Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsWhat Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 Apps
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]
HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]
HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Html5
Html5Html5
Html5
 
WordCamp ABQ 2013: Making the leap from Designer to Designer/Developer
WordCamp ABQ 2013: Making the leap from Designer to Designer/DeveloperWordCamp ABQ 2013: Making the leap from Designer to Designer/Developer
WordCamp ABQ 2013: Making the leap from Designer to Designer/Developer
 

Destaque

Do More With Message Queue
Do More With Message QueueDo More With Message Queue
Do More With Message QueueHean Hong Leong
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKXMike Willbanks
 
WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?James Russell
 
Martin sustrik future_of_messaging
Martin sustrik future_of_messagingMartin sustrik future_of_messaging
Martin sustrik future_of_messagingSkills Matter Talks
 

Destaque (6)

Message Broker System and RabbitMQ
Message Broker System and RabbitMQMessage Broker System and RabbitMQ
Message Broker System and RabbitMQ
 
Do More With Message Queue
Do More With Message QueueDo More With Message Queue
Do More With Message Queue
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKX
 
Message queueing
Message queueingMessage queueing
Message queueing
 
WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?
 
Martin sustrik future_of_messaging
Martin sustrik future_of_messagingMartin sustrik future_of_messaging
Martin sustrik future_of_messaging
 

Semelhante a HTML5 and Other Modern Browser Game Tech

Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Patrick Chanezon
 
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersAccelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersTodd Anglin
 
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG
JavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVGJavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVG
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVGPatrick Chanezon
 
Mobile Java with GWT: Still "Write Once, Run Everywhere"
Mobile Java with GWT: Still "Write Once, Run Everywhere"Mobile Java with GWT: Still "Write Once, Run Everywhere"
Mobile Java with GWT: Still "Write Once, Run Everywhere"Alex Theedom
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008Association Paris-Web
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Sadaaki HIRAI
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4alexsaves
 
Web Development for Mobile: GTUG Talk at Google
Web Development for Mobile: GTUG Talk at GoogleWeb Development for Mobile: GTUG Talk at Google
Web Development for Mobile: GTUG Talk at GoogleEstelle Weyl
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Estelle Weyl
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAriya Hidayat
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるSadaaki HIRAI
 
Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)Adam Lu
 
Sergey Ilinsky Presentation Ample Sdk
Sergey Ilinsky Presentation Ample SdkSergey Ilinsky Presentation Ample Sdk
Sergey Ilinsky Presentation Ample SdkAjax Experience 2009
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsBinary Studio
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introductionbeforeach
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Jamie Matthews
 
WebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonWebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonTony Parisi
 

Semelhante a HTML5 and Other Modern Browser Game Tech (20)

Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?
 
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersAccelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
 
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG
JavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVGJavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVG
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG
 
Mobile Java with GWT: Still "Write Once, Run Everywhere"
Mobile Java with GWT: Still "Write Once, Run Everywhere"Mobile Java with GWT: Still "Write Once, Run Everywhere"
Mobile Java with GWT: Still "Write Once, Run Everywhere"
 
GWT Extreme!
GWT Extreme!GWT Extreme!
GWT Extreme!
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
Web Development for Mobile: GTUG Talk at Google
Web Development for Mobile: GTUG Talk at GoogleWeb Development for Mobile: GTUG Talk at Google
Web Development for Mobile: GTUG Talk at Google
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
 
Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)
 
WebGL Awesomeness
WebGL AwesomenessWebGL Awesomeness
WebGL Awesomeness
 
Sergey Ilinsky Presentation Ample Sdk
Sergey Ilinsky Presentation Ample SdkSergey Ilinsky Presentation Ample Sdk
Sergey Ilinsky Presentation Ample Sdk
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphics
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introduction
 
Shifting Gears
Shifting GearsShifting Gears
Shifting Gears
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
 
WebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonWebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was Won
 

Último

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

HTML5 and Other Modern Browser Game Tech

  • 1. HTML5 and other Modern Browser Game Tech Vincent Scheib Software Engineer, Chrome GPU team February 28, 2011 1
  • 2. This is an Overview Overview & Motivation Browsers, Platforms Technology Survey Graphics, Audio, Networking, Storage… Libraries, Benchmarks 2
  • 4. My Perspective on the Last Decade & Web Tech 4 GPU Acceleration C++ in Browser Chrome OS
  • 5. April 1 2010 – Quake II in HTML5 Ray Cromwell, Stefan Haustein, Joel Webber – Google - WebGL, canvas - Web Sockets - Local Storage - Audio Chrome & Safari 5
  • 6. No Plugins 6 Not discussing: Flash, Java, Silverlight, Unity
  • 7. Plugin Use / Installation% of Chrome Users 7 iOS * Data from users opting in to reporting usage statistics, 2010
  • 8. Low Friction, Better Security 8
  • 10. Browser Trends 10 IE Firefox Chrome
  • 11. Mobile Trends Opera iPhone Nokia BlackBerry Android 11
  • 12. Mobile Trends iPhone Android Nokia BlackBerry Opera iPhone Nokia BlackBerry Android 12
  • 13. Mobile Native or Web App? iOS & Android Monetize Native Apps WebApp wrappers: PhoneGap, appMobi Performance Native has greater perf, but On Android, can call through to C++ from JS Forms Input HTML5 input forms produce correct input device Touch 13
  • 14. Chrome Web Store – Distribution & Monetization 14
  • 15. Chrome Web Store – Chrome Integration 15
  • 16. Chrome Web Store Discovery, Distribution and Monetization on the Web 16 Web Apps 120 million users In-app payments coming soongoogle.com/checkout/inapp … And Monetization
  • 17. The Browser is the Platform ChromeOS webOS 17
  • 21. Canvas 2D – Overview Mostly Sprites Flash Widely supported (mobile & desktop) IE9 brings GPU performance Javscript Shim Libraries run on old IE, e.g. ExplorerCanvas GPU upgrades Hundreds to Thousands of Draws @30fps Immediate Mode Popular 21
  • 22. Canvas 2D – API Primitives rect, circle arcs, lines, bezier curves, text, images Drawing fill and stroke Effects shadows, gradients, image patterns, line styles, clipping, compositing operations Transforms rotate, scale, matrix transform (2x2 + translation) 22 Text
  • 23. Canvas 2D – Simple Sample <canvas id="e" width="200" height="100"></canvas><script>  var context =document.getElementById("e").getContext("2d");  var cat = new Image();  cat.src = "images/cat.png";  cat.onload = function() {    context.drawImage(cat, 0, 0); };</script> 23
  • 24. Canvas 2D – Fill and Stroke Sample // Draw eyesctx.fillRect(160, 130, 20, 80);ctx.fillRect(220, 130, 20, 80);// Draw mouthctx.beginPath();ctx.moveTo(100, 230); // Start smilectx.bezierCurveTo(100, 230, 200, 380, 300, 230);ctx.moveTo(219, 298); // Start tonguectx.bezierCurveTo(278, 351, 315, 315, 277, 258);ctx.lineWidth = 20;ctx.stroke(); (adapted from IE9 sample) 24
  • 25. Canvas 2D – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: GO! 25 - caniuse.com, Feb 2011
  • 28. SVG – Overview Vector markup language Declarative or retainedprocedural API Tools (Illustrator, Inkscape) HTML5 Enables SVG Markup Inline with HTML Retained API GPU Acceleration Friendly - Retained data structures allow caching Little Groundswell Complex API? Retained? 28
  • 29. SVG – Sample <!DOCTYPE html><html><body> <svg id=“mySVG”> <circle id="circle0" cx="100" cy="75" r="50" fill="grey" stroke="black" stroke-width="5“ onmousedown="alert('clicked');"gt; <text x="60" y="155">Hello World</text> </svg> ... 29
  • 30. SVG – Sample <script> var circle = document.createElementNS( "http://www.w3.org/2000/svg", "circle"); circle.setAttribute('cx', 90); circle.setAttribute('cy', 90); circle.setAttribute('r', 30); circle.setAttribute('onmousedown', "alert('no, me!');"); document.getElementById("svg0").appendChild(circle); </script> </body></html> 30
  • 31. SVG – Links raphaeljs.com Ease of use, charts, etc. burst.bocoup.com Renders SVG into Canvas 2D 31
  • 32. SVG – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: iOS GO! – Android: No 32 - caniuse.com, Feb 2011
  • 35. WebGL – Overview Open GL ES 2 Textures, Framebuffers, Blending Vertex and Fragment Shaders (GLSL) Khronos group specification 1.0 Q1 2011 Matrix libraries come separately What will Microsoft do? 35
  • 36. WebGL – Libraries Many Higher Level Libraries C3DL Copperlicht GLGE O3D Processing.js SpiderGL SceneJS three.js WebGLU XB PointStream 36
  • 37. WebGL Inspector (Ben Vanik) 37
  • 38. WebGL – Sample Spinning Box 38
  • 39. WebGL – Sample Spinning Box <script id="vshader" type="x-shader/x-vertex"> uniform mat4 u_modelViewProjMatrix; uniform mat4 u_normalMatrix; uniform vec3 lightDir; attribute vec3 vNormal; attribute vec4 vColor; attribute vec4 vPosition; varying float v_Dot; varying vec4 v_Color; void main() { gl_Position = u_modelViewProjMatrix * vPosition; v_Color = vColor; vec4 transNormal = u_normalMatrix * vec4(vNormal, 1); v_Dot = max(dot(transNormal.xyz, lightDir), 0.0); 39
  • 40. WebGL – Sample Spinning Box <script id="fshader" type="x-shader/x-fragment"> varying float v_Dot; varying vec4 v_Color; void main() { gl_FragColor = vec4(v_Color.xyz * v_Dot, v_Color.a); } </script> 40
  • 41. WebGL – Sample Spinning Box gl = canvas.getContext(“webgl”, args); gl.createShader(shaderType); gl.shaderSource(shader, shaderScript.text); gl.compileShader(shader); var colors = new Uint8Array( [ 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, //… gl.box.colorObject = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, gl.box.colorObject); gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); //… 41
  • 42. WebGL – Sample Spinning Box function drawPicture(gl) { reshape(gl); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Make a model/view matrix. gl.mvMatrix.makeIdentity(); gl.mvMatrix.rotate(20, 1,0,0); gl.mvMatrix.rotate(currentAngle, 0,1,0); //… gl.drawElements( gl.TRIANGLES, gl.box.numIndices, gl.UNSIGNED_BYTE, 0); 42
  • 43. WebGL – Demos NinePointFive Aquarium Google Body 43
  • 44. WebGL – Availability Chrome – Firefox – Safari: Chrome Shipped. Soon in FF4 & Safari Internet Explorer: No Mobile: Waiting on Firefox 4, other browsers in progress. 44 - caniuse.com, Feb 2011
  • 45. aka – your render loop requestAnimationFrame 45
  • 46. requestAnimationFrame – Overview Status Quo: Draw, Draw, Draw, Blindly! setInterval(draw, 16) Browser Calls You (FireFox Beta 4, Chrome 10) function draw() { //... Do Drawing Work, then ask to called again: window.requestAnimationFrame(draw); } // kick off first frame: window.requestAnimationFrame(draw); 46 setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16) setInterval(draw, 16)
  • 47. requestAnimationFrame – Availability Chrome – Firefox – Safari: Soon in Chrome 10, FF4 Use a Shim, future compatible:// shim layer with setTimeout fallback – Paul Irish window.requestAnimFrame = (function(){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(/* function */ callback, /* DOMElement */ element){ window.setTimeout(callback, 1000 / 60); }; })(); 47
  • 48. Cascading Style Sheets – 3D Transformations CSS 3D 48
  • 49. CSS 3D – Examples CSS3D 49
  • 50. CSS 3D – Overview Add 3D to Any Web Content Helps make cool HUD 50
  • 51. CSS 3D – Sample <!DOCTYPE html><html><body> <div style="-webkit-perspective: 400;"> <iframe src="http://www.gdconf.com/" width = 1024 height = 768 style="-webkit-transform: rotate3d(1,0,0, 15deg)"> </iframe> </div> </body></html> 51
  • 52. CSS 3D – Availability Chrome – Firefox – Safari: Soon in Chrome, FF No, Safari GO! Internet Explorer: No Mobile: iOS GO! – Android: No 52 - caniuse.com, Feb 2011
  • 54. Web Fonts – Overview Game UI via HTML Serve Custom Fonts Easy Google Fonts API <link href='http://fonts…?family=Chewy‘rel='stylesheet' type='text/css'> In CSS: h1 { font-family: 'Chewy', arial, serif; } 54
  • 55. Web Fonts – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Best in IE9 Mobile: Mostly… 55 - caniuse.com, Feb 2011
  • 57. <audio> – Overview Tags in HTML, or created by javascript 57
  • 58. <audio> – Sample var audio = new Audio(); audio.addEventListener("canplaythrough", function () { audio.play(); }); audio.src = “treasure.ogg”; 58
  • 59. <audio> – Issues iOS >= 4 – only one sample at a time No one codec supported by all browsers. Pick 2 from: MP3, Vorbis, WAV detect suitability before loading, with e.g. new Audio().canPlayType(“audio/ogg”); 59
  • 60. <audio> – Future1 FireFox Audio Data API supports Read/Write samples var output = new Audio(); output.mozSetup(1, 44100); var samples = new Float32Array(22050); varlen = samples.length; for (vari = 0; i < samples.length ; i++) { samples[i] = Math.sin( i / 20 ); } output.mozWriteAudio(samples); 60
  • 61. <audio> – Future2 Web Audio API Node graph Low latency Spatialization, 3d Reverb Native implementation performance 61
  • 62. <audio> – Links SoundManager 2 Flash fallback www.schillmania.com/projects/soundmanager2 62
  • 63. <audio> – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: (With limits) 63 - caniuse.com, Feb 2011
  • 65. <video> – Overview Source for textures in <canvas> 2D or WebGLvideoElement.play(); videoElement.addEventListener("timeupdate",updateTexture, true); function updateTexture() { gl.bindTexture(gl.TEXTURE_2D, cubeTexture); gl.texImage2D(gl.TEXTURE_2D, 0, videoElement, true); gl.generateMipmap(gl.TEXTURE_2D); } Demo 65
  • 66. <video> – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: GO! 66 - caniuse.com, Feb 2011
  • 68. WebSockets – Overview Low latency, persistent, full duplex Upgrades from HTTP handshake UTF8 Simple var socket = new WebSocket(“ws://server.com”); socket.onopen = function(event) { socket.send(“Hello Server”); } socket.onmessage = function(event) { alert(“Server says: “ + event.data); 68
  • 69. WebSockets - Future FireFox and Opera Behind Flag Standard for protocol upgrade Binary Peer to Peer Unreliable (vs TCP) 69
  • 70. WebSockets – Links socket.io Higher level library Transport on WebSockets, Flash, Ajax, … github.com/gimite/web-socket-js Shim implementation on top of Flash 70
  • 71. Web Sockets – Availability Chrome – Firefox – Safari: Yes, Still Stabilizing, Some Behind a Flag Internet Explorer: In HTML5 Labs Mobile: iOS Stabilizing, Android? 71 - caniuse.com, Feb 2011
  • 72. Javascript on your Server Node.JS 72
  • 73. Node.JS – Overview Ease of Same Language and Client & Server Simple, lots of uptake Tools / Plugins WebSockets, manage connections, render server side, just lots... Visual Debugger 73
  • 75. GeoLocation – Sample Mobile, and Desktops too navigator.geolocation.getCurrentPosition( function (location) { doSomething(location.coords.latitude, location.coords.longitude); }); 75
  • 76. GeoLocation – Availability Chrome – Firefox – Safari: GO! Internet Explorer: Soon in IE9 Mobile: GO! 76 - caniuse.com, Feb 2011
  • 78. DeviceOrientation – Overview iOS >= 4.2 Chrome on Mac 78
  • 79. DeviceOrientation – Sample window.addEventListener("devicemotion", function(event) { // event.acceleration, // event.accelerationIncludingGravity, // event.rotationRate, // event.interval }, true); 79
  • 80. DeviceOrientation – Availability Chrome – Firefox – Safari: Yes, but not on all devices Internet Explorer: ? Mobile: Only iOS >= 4.2 80
  • 81. Some options… Saving Data on the Client 81
  • 82. 82
  • 83. Web Storage – Overview Local Storage & Session Storage 5MB of key value pair strings localStorage["levels-unlocked"] = 5 // or .getItem() / .setItem() localStorage.removeItem() localStorage.clear(); // Dump everything Widely supported Non Transactional No good recourse if over limit 83
  • 84. Web Storage – Availability Chrome – Firefox – Safari: GO! Internet Explorer: GO! Mobile: GO! 84 - caniuse.com, Feb 2011
  • 85. File API: Directories & Systems – Availability Chrome: Yes for Apps and Extensions Firefox – Safari: No Internet Explorer: No Mobile: No 85
  • 86. Application Cache – Overview Cache HTML pages and Resources Manifest File CACHE MANIFEST index.html stylesheet.css images/logo.png scripts/main.js 86
  • 87. Application Cache – Availability Chrome – Firefox – Safari: GO! Internet Explorer: No Mobile: GO! 87 - caniuse.com, Feb 2011
  • 90. Web Workers – Sample html5rocks.com/tutorials/workers/basics/ main.js (main thread): var worker = new Worker('doWork.js'); worker.addEventListener('message', function(e) { console.log('Worker said: ', e.data); }, false); worker.postMessage('Hello World'); // Send data to our worker. doWork.js (the worker): self.addEventListener('message', function(e) { self.postMessage(e.data + “? ” + e.data + “!”); }, false); // Output “Worker said: Hello World? Hello World!” 90
  • 91. Web Workers – Availability Chrome – Firefox – Safari: GO! Internet Explorer: No Mobile: No 91 - caniuse.com, Feb 2011
  • 92. C++ for your web app Native Client 92
  • 93. Native Client – Overview Machine Code Served to Browser C/C++, Mono(C#), others NoPlugins Legacy C++ Codebase in your Web App Performance Cross Platform 93 A Web Page Full of text, lots of interesting stuff, links, blah blah. Don’t read all the links, all this text. JS A Web Page Full of text, lots of interesting stuff, links, blah blah. Don’t read all the links, all this text. C++
  • 94. Native Client – Security Static analysis & Sandboxing Restricted instructions Isolate code Custom Toolchain 94 Browser NaCl v8 JS C++ Browser Plugin Operating System Operating System
  • 95. Native Client – Availability Chrome: Behind flag Open Source 95
  • 96. How much time is left? Whew 96
  • 97. GPU Acceleration Chrome 9 WebGL shipped February 3rd Chrome Developer & Canary Video, 3D CSS, Canvas 2D, Compositing Firefox 4 Beta WebGL, Video, 2D CSS, Canvas 2D, SVG, Compositing IE 9 Beta “all graphics and text rendering” 97
  • 98. Benchmarks Needed JSGameBench, Facebook “over 125 million people visit Facebook using HTML5 capable browsers just from their mobile phone” Sprite performance, options (WebGL, <canvas>, <img>, <div>, …) 1000-4000 @30fps on GPU 50-200 mid range desktops 20-30 iOS & Android 98
  • 99. Libraries Canvas 2D ImpactJS, Akihabara WebGL GLGE, C3DL, Copperlicht, SpiderGL, SceneJS, O3D, Processing.js and XB PointStream, WebGLU Document Object Model (DOM) Rocket Engine, Zynga Germany (was Aves Engine) Physics Box2DWeb, Jiglib 3D 99
  • 100. What’s Missing Mouse Capture Gamepads Audio input Webcam input 100
  • 101. More! At GDC Google Sessions Today and Tomorrow Cloud Services, WebGL, Native Client, YouTube APIs Android AndroidAndroidAndroidAndroid Google Booth Sketchup,Web Store, WebGL Native Client, AppEngine, Android Other HTML5 Sessions WebGL News and Technology Updates (Khronos), Thursday Getting Your Games onto the BlackBerry PlayBook Tablet, Thursday HTML5: The New UI Library for Games, Friday 101
  • 102. Thanks Alexis Deveria, caniuse.com feature tables Athena's Pix [flickr], overview image Chris Pruett Daniel Galpin Darius Kazemi Geoff Blair Gregg Tavares Mark DeLoura Mark Pilgrim (diveintohtml5.org) Matt Hackett 102
  • 103. Q&A 103 code.google.com/games @GoogleGameDev

Notas do Editor

  1. - New and Upcoming tech- Why care - Zero friction – available in browser, no plugins - Forward looking – Some tech ready today, more coming - Mobile – Many platforms, ubiquity
  2. - No Flash on iOS browser- Security an issue with plugins
  3. - Important metric is how many users will play, if a plugin is installed already or not
  4. -Plugins worst – full permission for any web page
  5. -Lots of options on desktop-iOS limited!-Webkit on several
  6. -WebKit over 50%-HTML5 support pervasive
  7. -WebKit over 50%-HTML5 support pervasive
  8. - Android allows C++/Java from JS- Rich input if correct forms used- Android has simple touch, iOSmultitouch
  9. 120M Chrome users
  10. - Synced between browsers- Easy offline- Permissions cleared at “install” time
  11. CWS is a new platform for distributing games and apps on the webTargeted at 120M Chrome usersMonetization currently includes in-store payments and adsIn-app payments solution is coming soon and is a perfect fit for gamesSign up for early betaMore details at the booth
  12. - 2D context, widely supported (IE9)- Procedural images- Dynamic OK, but not designed specifically for “animated frames”
  13. -Simple 2D- Physics- Shooters (typing shooter) “Z-type”-Retro Sprite “Onslaught”- MMO Scrabble “Word Squared”-3D (mostly flat, though textured possible to)
  14. -DrawImage takes Sub Regions as well
  15. - Implementations around for 5 years, standard started 10 years ago
  16. -EXTERNAL Javascript tool-Capturevis HUD-Step Draw Calls-State-Texture state-Texture Browser-Shader programs, view parameters-View shaders-View data buffers as well
  17. -Optional to use Google API, but easy
  18. -Larger API
  19. -Larger API
  20. -Editor’s Draft
  21. -W3C Editors Draft of Spec
  22. -3 component accelerations, rotations-interval in milliseconds
  23. -Session storage clears at end of session
  24. -HTML5
  25. -Copies message data between processes-No DOM access
  26. -Plugins have full access to OS-JS safely sandboxed, browser offers security-NaCl does the same for C++