SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
BUILD RICH APPLICATIONS IN HTML5
AND WEBGL
TONY PARISI
NOVEMBER 12, 2013
ABOUT ME
 serial entrepreneur

 founder, Vizi (stealth startup)
 consulting architect and CTO
 co-creator, VRML and X3D web standards
 co-designer, glTF
 author, speaker instructor
 contact information

book source code
https://github.com/tparisi/WebGLBook
https://github.com/tparisi/Programming3DApplications

tparisi@gmail.com
skype: auradeluxe
http://twitter.com/auradeluxe
http://www.tonyparisi.com/
http://www.learningwebgl.com/

2 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
RIP: 1995-2013

Image:

3 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

Eric Dye

http://www.tonyparisi.com/
LONG LIVE…

4 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
HTML5: THE BROWSER AS PLATFORM
 graphics APIs– Canvas, WebGL, SVG
 CSS3 – animations, transitions, transforms and filter effects
 hardware-accelerated compositing
‒ all elements blend seamlessly on page

 JavaScript performance and language enhancements
 and a whole lot more…
‒ first-class streaming media types - <audio>, <video>
‒ device input
‒ location and mobile-inspired features
‒ database, local storage, file system
‒ networking – sockets and real-time connections (WebRTC)
‒ multi-threading (Workers)

5 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
WebGL: REAL-TIME 3D RENDERING

 the 3D API standard
‒ OpenGL ES™ in a browser
‒ JavaScript API bindings
‒ supported in all modern browsers
‒ shipped since early 2011

…and it’s
awesome.

supported in
•
•
•
•

desktop Safari, Firefox, Chrome, Opera, IE
Android – mobile Chrome, mobile Firefox
FireOS (Kindle Fire HDX)
Blackberry, Tizen, Firefox OS

•

Surface (Windows 8.1)

• iOS mobile Safari – iAds only
• 500M+ seats -> 1B
6 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

100,000 Stars Google Experiment

http://www.tonyparisi.com/
WebGL APPLICATIONS
advertising and media

data visualization
7 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

products and e-commerce

page graphics
http://www.tonyparisi.com/
JUST HOW RICH?

Epic Games’ Unreal Citadel Running in Firefox
http://www.unrealengine.com/html5/

60FPS

ported in 5 days

Unreal native C++ engine -> JavaScript

8 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

Emscripten + asm.js
http://www.tonyparisi.com/
HOW WebGL WORKS

 it’s a JavaScript drawing API
‒ draw to a canvas element using a special context (“webgl”)
‒ low-level drawing – buffers, primitives, textures and shaders
‒ accelerated by graphics hardware (GPU)
‒ can draw 2D as well as 3D graphics

 integrates seamlessly with other page content
 there is no file format; no markup language; no DOM.
 libraries and frameworks are key to fast ramp up and productive development

9 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
A SIMPLE WebGL PROGRAM

1.

create a <canvas> element

2.

obtain a drawing context

3.

initialize the viewport

4.

create one or more buffers

5.

create one or more matrices

6.

create one or more shaders

7.

initialize the shaders

8.

draw one or more primitives

10 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
CREATE THE CANVAS, CONTEXT AND VIEWPORT
function initWebGL(canvas) {
var gl = null;
var msg = "Your browser does not support WebGL, " +
"or it is not enabled by default.";
try
{
gl = canvas.getContext(“webgl");
}
catch (e)
{
msg = "Error creating WebGL Context!: " + e.toString();
}

detect WebGL

if (!gl)
{
alert(msg);
throw new Error(msg);
}
return gl;

set WebGL drawing region

}
function initViewport(gl, canvas)
{
gl.viewport(0, 0, canvas.width, canvas.height);
}

11 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
BUFFERS AND TYPED ARRAYS
var vertexBuffer;
vertexBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
var verts = [
// Front face
-1.0, -1.0, 1.0,
1.0, -1.0, 1.0,
1.0, 1.0, 1.0,
-1.0, 1.0, 1.0,
// Back face
-1.0, -1.0, -1.0,
-1.0, 1.0, -1.0,
1.0, 1.0, -1.0,
1.0, -1.0, -1.0,
…

WebGL drawing functions use buffers
of data

Typed Arrays:
new low-level data type stores
arrays of floats and ints compactly

];
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verts), gl.STATIC_DRAW);
12 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
SHADERS
var vertexShaderSource =
"
"
"
"
"
"
"
"
"
"
"
"

attribute vec3 vertexPos;n" +
attribute vec2 texCoord;n" +
uniform mat4 modelViewMatrix;n" +
uniform mat4 projectionMatrix;n" +
varying vec2 vTexCoord;n" +
void main(void) {n" +
// Return the transformed and projected vertex valuen" +
gl_Position = projectionMatrix * modelViewMatrix * n" +
vec4(vertexPos, 1.0);n" +
// Output the texture coordinate in vTexCoordn" +
vTexCoord = texCoord;n" +
}n";

var fragmentShaderSource =
" precision mediump float;n" +
" varying vec2 vTexCoord;n" +
" uniform sampler2D uSampler;n" +
" void main(void) {n" +
" // Return the pixel color: always output whiten" +
" gl_FragColor = texture2D(uSampler, vec2(vTexCoord.s, vTexCoord.t));n" +
"}n";
13 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

the vertex shader transforms modelspace positions into screen space

the fragment shader outputs a
color value for each pixel

http://www.tonyparisi.com/
DRAWING
function draw(gl, obj) {
// clear the background (with black)
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.enable(gl.DEPTH_TEST);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);

clear the canvas

// set the shader to use
gl.useProgram(shaderProgram);

set the shader

// connect up the shader parameters: vertex position, texture coordinate,
// projection/model matrices and texture
// set up the buffers
gl.bindBuffer(gl.ARRAY_BUFFER, obj.buffer);
gl.vertexAttribPointer(shaderVertexPositionAttribute, obj.vertSize, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, obj.texCoordBuffer);
gl.vertexAttribPointer(shaderTexCoordAttribute, obj.texCoordSize, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, obj.indices);
gl.uniformMatrix4fv(shaderProjectionMatrixUniform, false, projectionMatrix);
gl.uniformMatrix4fv(shaderModelViewMatrixUniform, false, modelViewMatrix);
gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, webGLTexture);
gl.uniform1i(shaderSamplerUniform, 0);
// draw the object
gl.drawElements(obj.primtype, obj.nIndices, gl.UNSIGNED_SHORT, 0);
}
14 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

set up buffers for vertices
and texture coordinates

pass transform and
projection matrices
to the shader
set the texture and pass to the shader
draw the object
http://www.tonyparisi.com/
A WebGL CLIENT-SIDE STACK

 rendering – Three.js library
 animation – Three.js, Tween.js libraries
 application functionality – game engine/framework
‒ setup/teardown
‒ interaction – picking, rollovers, rotating models
‒ behaviors
‒ run loop and event dispatching

 content creation pipeline
‒ 3D tools e.g. Autodesk Maya
‒ COLLADA, glTF formats; conversion tools

15 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
Three.js: A JAVASCRIPT 3D ENGINE
https://github.com/mrdoob/three.js/

 the most popular WebGL library
renderer = new THREE.WebGLRenderer( { canvas: canvas, antialias: true } );
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 45, canvas.width /
canvas.height, 1, 4000 );
scene.add(camera);

can render to WebGL,
2D canvas, SVG and CSS3

var light = new THREE.DirectionalLight( 0xffffff, 1.5);
scene.add( light );
var mapUrl ="../images/webgl-logo-256.jpg“;
var map = THREE.ImageUtils.loadTexture(mapUrl );
var material = new THREE.MeshPhongMaterial({ map: map });

represents WebGL at a
high level using standard
3D graphics concepts

var geometry = new THREE.CubeGeometry(2, 2, 2);
cube = new THREE.Mesh(geometry, material);
scene.add( cube );
16 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
3D ANIMATION
 requestAnimationFrame()
http://www.paulirish.com/2011/requestanimationframe-for-smartanimating/

 with JavaScript we can animate anything: materials, lights,
textures…. Shaders
 Three.js has support for key frames, morphs and skins
 Tween.js – simple tweening library
https://github.com/sole/tween.js/
var tween = new TWEEN.Tween( { x: 50, y: 0 } )
.to( { x: 400 }, 2000 )
.easing( TWEEN.Easing.Elastic.InOut )
.start();
function animate() {
requestAnimationFrame( animate );
TWEEN.update();
}
17 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

create and
run tween
call TWEEN.update()
each frame to update values
http://www.tonyparisi.com/
WebGL PIPELINE TOOLS

 WebGL has no file format; no markup language; no DOM.
‒ apps/libraries must define their own formats

 a lot of people are still creating content by writing code
 existing 3D formats proprietary, incomplete or ill-suited for web/mobile
delivery
 help is on the way: glTF
‒ a “JPEG for 3D”

‒ bridges the gap between existing 3D formats/tools and today’s GL
based APIs
‒ compact, efficient to load representation
‒ JSON scene description and high-level objects
‒ binary vector and animation data

 a common publishing format for content tools
‒ open specification; open process

glTF Three.js Loader Prototype

‒ Khronos Group initiative within the COLLADA working group
‒ F. Robinet (lead), R. Arnaud, P. Cozzi, T. Parisi
‒ https://github.com/KhronosGroup/glTF
‒ http://gltf.gl/
18 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
WebGL ENGINES AND FRAMEWORKS
 Provide application-level functionality
‒ setup/teardown
‒ interaction – picking, rollovers, rotating
models
‒ behaviors
‒ run loop and event dispatching
‒ FSM objects (states)
‒ physics, dynamics, collision, …
‒ view models, camera controllers, …

game engines/IDEs

libraries/frameworks

PlayCanvas http://www.playcanvas.com/

Three.js
http://threejs.org/

Turbulenz https://turbulenz.com/
SceneJS
Goo Enginehttp://www.gootechnologies.com/

http://scenejs.org/

Artillery Engine https://artillery.com/

BabylonJS

Verold http://verold.com/
Sketchfab https://sketchfab.com/
Unreal… ?
http://www.extremetech.com/gaming/151900unreal-engine-3-ported-to-javascript-and-webglworks-in-any-modern-browser

http://www.babylonjs.com/

Voodoo.js
http://www.voodoojs.com/

tQuery
http://jeromeetienne.github.io/tquery/

Vizi
https://github.com/tparisi/Vizi

19 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
CSS3: ADVANCED PAGE EFFECTS

 CSS transitions
 CSS animations
 CSS 3D transforms

 CSS filter effects
 CSS custom filters

20 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
CSS3 TRANSITIONS
source: http://www.kirupa.com/html5/all_about_css_transitions.htm

 allow gradual changes to CSS properties over time
new CSS3 properties
currently require vendorspecific prefixes

#box img {
-webkit-transition: transform .5s ease-in;
-webkit-transform: translate3d(0, -350px, 0);
}
#box img:hover {
-webkit-transition: transform .5s ease-in;
-webkit-transform: translate3d(0, 0px, 0);
cursor: pointer;
}

-webkit-transition: all .5s ease-in -.1s;

21 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

shortcut for

specify property to
transition, duration of
transition, easing
function

transition-property: all;
transition-duration: .5s;
transition-timing-function: ease-in;
transition-delay: .1s;
http://www.tonyparisi.com/
CSS3 ANIMATIONS
source: http://www.kirupa.com/html5/all_about_css_animations.htm

 allow fine control over animation behavior with key frames
#bigcloud {
animation: bobble 2s infinite;
}
@keyframes bobble {
0% {
transform: translate3d(50px, 40px, 0px);
animation-timing-function: ease-in;
}
50% {
transform: translate3d(50px, 50px, 0px);
animation-timing-function: ease-out;
}
100% {
transform: translate3d(50px, 40px, 0px);
}
}
22 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

each key frame contains a transform

control timing with
ease in/out functions
keys are used to interpolate
transform values
http://www.tonyparisi.com/
CSS3 3D TRANSFORMS

 translate, rotate, scale page elements with perspective
browser will render element in 3D perspective

.bk-list li {

perspective: 1800px;
}
apply to child
elements

.bk-list li .bk-front {
transform-style: preserve-3d;
add origin to
transform-origin: 0% 50%;
translation
transform: translate3d(0,0,20px);
}

apply 35 degree rotation about Y axis
.bk-list li .bk-book.bk-bookdefault:hover {
transform: rotate3d(0,1,0,35deg);
}
23 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

Using 3D
transform forces
hardware
acceleration

http://tympanus.net/codrops/2013/01/08/3dbook-showcase/

http://www.tonyparisi.com/
CSS3 FILTER EFFECTS
source: http://html5-demos.appspot.com/static/css/filters/index.html

 apply post-processing effects to image elements
img {
-webkit-filter: sepia(100%);
}
img {
-webkit-filter: grayscale(100%);
}
img {
-webkit-filter: blur(2px);
}
img {
-webkit-filter: brightness(33%);
}
img {
-webkit-filter: contrast(67%);
}
24 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
CSS3 CUSTOM FILTERS
source: http://alteredqualia.com/css-shaders/crumple.html
.shader {
-webkit-filter: custom(url(shaders/crumple.vs) mix(url(shaders/crumple.fs) multiply source-atop), 50 50, amount 0, strength 0.2,
lightIntensity 1.05, transform rotateX(0deg) translateZ(0px) );
-webkit-transition: -webkit-filter linear 1.5s;
box-shadow: 0 0 2em #111;
}
.shader:hover {
-webkit-filter: custom(url(shaders/crumple.vs) mix(url(shaders/crumple.fs) multiply source-atop), 50 50, amount 1, strength 0.2,
lightIntensity 1.05, transform rotateX(0deg) translateZ(0px) );
}

Crumple shader by
Branislav Ulicny (AlteredQualia)
http://alteredqualia.com/cssshaders/crumple.html

25 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
CSS3 VERTEX SHADER
void main() {
// Compute displacement
float time = 10.0 * quadraticInOut( amount );
vec2 surfaceCoordinate = 0.025 * a_texCoord;
float n = surface( surfaceCoordinate, time );
float curve = strength * n;

browser predefines a_texCoord
and a_position, passes into
shader

vec4 pos = a_position;
pos.z = amount * ( 0.5 * strength - curve );
// Compute normal
const float e = 0.001;
float nx = surface( surfaceCoordinate + vec2( e, 0.0 ), time );
float ny = surface( surfaceCoordinate + vec2( 0.0, e ), time );
vec3 normal = normalize( vec3( n - nx, n - ny, 1.0 - strength * 1.25 ) );
// Compute lighting (directional light)
vec3 lightPosition = normalize( vec3( 0.0, 0.5, 1.0 ) );
float lightWeight = lightIntensity * max( dot( normal, lightPosition ), 0.0 );
// Set vertex position
gl_Position = u_projectionMatrix * perspective( 0.9 ) * transform * pos;

shader outputs new
vertex position,
passes lighting
information to
fragment shader

v_uv = a_texCoord;
v_height = n;
v_light = lightWeight;
26 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
CSS3 FRAGMENT SHADER

// Uniform values from CSS
uniform float amount;

// Varyings passed in from vertex shader
varying vec2 v_uv;
varying float v_height;
varying float v_light;
void main() {
const float a = 1.0;
float r, g, b;
// Light variant
float n = v_light;
float v = mix( 1.0, n * n, amount );
r = g = b = sqrt( v );
// Set color matrix

Fragment shader
outputs blend value
based on light
calculated in vertex
shader and usersupplied amount

css_ColorMatrix = mat4( r, 0.0, 0.0, 0.0,
0.0, g, 0.0, 0.0,
0.0, 0.0, b, 0.0,
0.0, 0.0, 0.0, a );
}

27 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
CSS3 SUPPORT
source: http://css3.bradshawenterprises.com/

CSS3 Transitions
supported since
• Safari 3.2: 13/11/2008
• Firefox 4.0: Late 2010
• Chrome 1.0: 02/09/2008
• Opera 10.5: 02/03/2010
• Internet Explorer 10: 09/2011

CSS 3D Transforms
supported since
• Safari 4.0: 11/06/2008
• Chrome: 28/08/2010
• IE 10: 09/2011
• Firefox: 27/10/2011

CSS3 Filters
CSS3 Animations
supported since
• Safari 4.0: 11/06/2008
• Chrome 1.0: 02/09/2008
• Firefox 5: 20/04/2011
• IE 10: 09/2011
• Opera: 03/2012
28 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

supported since
• Safari 6.0
• Chrome: 18.0

CSS3 Custom Filters
supported only in Chrome
http://www.tonyparisi.com/
FUN WITH THREE.JS AND CSS3

http://mrdoob.github.io/three.js/examples/css3d_periodictable.html
29 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
LANGUAGE INNOVATIONS
tackling performance and memory challenges

 asm.js
optimizable, low-level subset of JavaScript; strictly typed; improves performance (2x native vs. 3-10x) runs
in FF and Chrome nightlies
http://asmjs.org/

 Emscripten
LLVM-to-JavaScript compiler translates C++ native code to JavaScript; can output to asm.js
https://github.com/kripken/emscripten/wiki

 new Web languages - Dart, TypeScript
optionally strongly typed; class-based
https://www.dartlang.org/
http://www.typescriptlang.org/

30 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
RESOURCES





WebGL specification http://www.khronos.org/registry/webgl/specs/latest/
Learning WebGL http://www.learningwebgl.com/
Three.js https://github.com/mrdoob/three.js/
requestAnimationFrame
http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/

 CSS specifications
http://www.w3.org/TR/css3-animations/
http://www.w3.org/TR/css3-transitions/
http://www.w3.org/TR/css3-transforms/
http://www.w3.org/TR/filter-effects/

 CSS animation demos http://www.creativebloq.com/css3/animation-with-css3-712437
 CSS 3D transforms explained http://desandro.github.io/3dtransforms/
 Adobe filter lab - playing with filter
effectshttp://html.adobe.com/webplatform/graphics/customfilters/cssfilterlab/
 Alan Greenblatt’s blog – CSS filter effects http://blattchat.com/
31 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/
STAY IN TOUCH…

contact information
tparisi@gmail.com
skype: auradeluxe
http://twitter.com/auradeluxe
arisi.com/
http://www.learningwebgl.com/

http://www.tonyp

book source code
https://github.com/tparisi/WebGLBook
https://github.com/tparisi/Programming3DApplications

get the books!
WebGL: Up and Running
http://www.amazon.com/dp/144932357X
Programming 3D Applications with HTML and WebGL
http://www.amazon.com/Programming-Applications-HTML5-WebGLVisualization/dp/1449362966
32 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013

http://www.tonyparisi.com/

Weitere ähnliche Inhalte

Was ist angesagt?

PT-4053, Advanced OpenCL - Debugging and Profiling Using AMD CodeXL, by Uri S...
PT-4053, Advanced OpenCL - Debugging and Profiling Using AMD CodeXL, by Uri S...PT-4053, Advanced OpenCL - Debugging and Profiling Using AMD CodeXL, by Uri S...
PT-4053, Advanced OpenCL - Debugging and Profiling Using AMD CodeXL, by Uri S...AMD Developer Central
 
PL-4048, Adapting languages for parallel processing on GPUs, by Neil Henning
PL-4048, Adapting languages for parallel processing on GPUs, by Neil HenningPL-4048, Adapting languages for parallel processing on GPUs, by Neil Henning
PL-4048, Adapting languages for parallel processing on GPUs, by Neil HenningAMD Developer Central
 
CC-4000, Characterizing APU Performance in HadoopCL on Heterogeneous Distribu...
CC-4000, Characterizing APU Performance in HadoopCL on Heterogeneous Distribu...CC-4000, Characterizing APU Performance in HadoopCL on Heterogeneous Distribu...
CC-4000, Characterizing APU Performance in HadoopCL on Heterogeneous Distribu...AMD Developer Central
 
GS-4150, Bullet 3 OpenCL Rigid Body Simulation, by Erwin Coumans
GS-4150, Bullet 3 OpenCL Rigid Body Simulation, by Erwin CoumansGS-4150, Bullet 3 OpenCL Rigid Body Simulation, by Erwin Coumans
GS-4150, Bullet 3 OpenCL Rigid Body Simulation, by Erwin CoumansAMD Developer Central
 
WT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
WT-4073, ANGLE and cross-platform WebGL support, by Shannon WoodsWT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
WT-4073, ANGLE and cross-platform WebGL support, by Shannon WoodsAMD Developer Central
 
MM-4104, Smart Sharpen using OpenCL in Adobe Photoshop CC – Challenges and Ac...
MM-4104, Smart Sharpen using OpenCL in Adobe Photoshop CC – Challenges and Ac...MM-4104, Smart Sharpen using OpenCL in Adobe Photoshop CC – Challenges and Ac...
MM-4104, Smart Sharpen using OpenCL in Adobe Photoshop CC – Challenges and Ac...AMD Developer Central
 
GS-4152, AMD’s Radeon R9-290X, One Big dGPU, by Michael Mantor
GS-4152, AMD’s Radeon R9-290X, One Big dGPU, by Michael MantorGS-4152, AMD’s Radeon R9-290X, One Big dGPU, by Michael Mantor
GS-4152, AMD’s Radeon R9-290X, One Big dGPU, by Michael MantorAMD Developer Central
 
PL-4044, OpenACC on AMD APUs and GPUs with the PGI Accelerator Compilers, by ...
PL-4044, OpenACC on AMD APUs and GPUs with the PGI Accelerator Compilers, by ...PL-4044, OpenACC on AMD APUs and GPUs with the PGI Accelerator Compilers, by ...
PL-4044, OpenACC on AMD APUs and GPUs with the PGI Accelerator Compilers, by ...AMD Developer Central
 
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon SelleyPT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon SelleyAMD Developer Central
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMark Kilgard
 
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...AMD Developer Central
 
PL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor Miller
PL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor MillerPL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor Miller
PL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor MillerAMD Developer Central
 
MM-4097, OpenCV-CL, by Harris Gasparakis, Vadim Pisarevsky and Andrey Pavlenko
MM-4097, OpenCV-CL, by Harris Gasparakis, Vadim Pisarevsky and Andrey PavlenkoMM-4097, OpenCV-CL, by Harris Gasparakis, Vadim Pisarevsky and Andrey Pavlenko
MM-4097, OpenCV-CL, by Harris Gasparakis, Vadim Pisarevsky and Andrey PavlenkoAMD Developer Central
 
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla MahGS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla MahAMD Developer Central
 
PT-4058, Measuring and Optimizing Performance of Cluster and Private Cloud Ap...
PT-4058, Measuring and Optimizing Performance of Cluster and Private Cloud Ap...PT-4058, Measuring and Optimizing Performance of Cluster and Private Cloud Ap...
PT-4058, Measuring and Optimizing Performance of Cluster and Private Cloud Ap...AMD Developer Central
 
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary DemosMM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary DemosAMD Developer Central
 
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...AMD Developer Central
 
PT-4059, Bolt: A C++ Template Library for Heterogeneous Computing, by Ben Sander
PT-4059, Bolt: A C++ Template Library for Heterogeneous Computing, by Ben SanderPT-4059, Bolt: A C++ Template Library for Heterogeneous Computing, by Ben Sander
PT-4059, Bolt: A C++ Template Library for Heterogeneous Computing, by Ben SanderAMD Developer Central
 
PT-4142, Porting and Optimizing OpenMP applications to APU using CAPS tools, ...
PT-4142, Porting and Optimizing OpenMP applications to APU using CAPS tools, ...PT-4142, Porting and Optimizing OpenMP applications to APU using CAPS tools, ...
PT-4142, Porting and Optimizing OpenMP applications to APU using CAPS tools, ...AMD Developer Central
 
Leverage the Speed of OpenCL™ with AMD Math Libraries
Leverage the Speed of OpenCL™ with AMD Math LibrariesLeverage the Speed of OpenCL™ with AMD Math Libraries
Leverage the Speed of OpenCL™ with AMD Math LibrariesAMD Developer Central
 

Was ist angesagt? (20)

PT-4053, Advanced OpenCL - Debugging and Profiling Using AMD CodeXL, by Uri S...
PT-4053, Advanced OpenCL - Debugging and Profiling Using AMD CodeXL, by Uri S...PT-4053, Advanced OpenCL - Debugging and Profiling Using AMD CodeXL, by Uri S...
PT-4053, Advanced OpenCL - Debugging and Profiling Using AMD CodeXL, by Uri S...
 
PL-4048, Adapting languages for parallel processing on GPUs, by Neil Henning
PL-4048, Adapting languages for parallel processing on GPUs, by Neil HenningPL-4048, Adapting languages for parallel processing on GPUs, by Neil Henning
PL-4048, Adapting languages for parallel processing on GPUs, by Neil Henning
 
CC-4000, Characterizing APU Performance in HadoopCL on Heterogeneous Distribu...
CC-4000, Characterizing APU Performance in HadoopCL on Heterogeneous Distribu...CC-4000, Characterizing APU Performance in HadoopCL on Heterogeneous Distribu...
CC-4000, Characterizing APU Performance in HadoopCL on Heterogeneous Distribu...
 
GS-4150, Bullet 3 OpenCL Rigid Body Simulation, by Erwin Coumans
GS-4150, Bullet 3 OpenCL Rigid Body Simulation, by Erwin CoumansGS-4150, Bullet 3 OpenCL Rigid Body Simulation, by Erwin Coumans
GS-4150, Bullet 3 OpenCL Rigid Body Simulation, by Erwin Coumans
 
WT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
WT-4073, ANGLE and cross-platform WebGL support, by Shannon WoodsWT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
WT-4073, ANGLE and cross-platform WebGL support, by Shannon Woods
 
MM-4104, Smart Sharpen using OpenCL in Adobe Photoshop CC – Challenges and Ac...
MM-4104, Smart Sharpen using OpenCL in Adobe Photoshop CC – Challenges and Ac...MM-4104, Smart Sharpen using OpenCL in Adobe Photoshop CC – Challenges and Ac...
MM-4104, Smart Sharpen using OpenCL in Adobe Photoshop CC – Challenges and Ac...
 
GS-4152, AMD’s Radeon R9-290X, One Big dGPU, by Michael Mantor
GS-4152, AMD’s Radeon R9-290X, One Big dGPU, by Michael MantorGS-4152, AMD’s Radeon R9-290X, One Big dGPU, by Michael Mantor
GS-4152, AMD’s Radeon R9-290X, One Big dGPU, by Michael Mantor
 
PL-4044, OpenACC on AMD APUs and GPUs with the PGI Accelerator Compilers, by ...
PL-4044, OpenACC on AMD APUs and GPUs with the PGI Accelerator Compilers, by ...PL-4044, OpenACC on AMD APUs and GPUs with the PGI Accelerator Compilers, by ...
PL-4044, OpenACC on AMD APUs and GPUs with the PGI Accelerator Compilers, by ...
 
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon SelleyPT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to Vulkan
 
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
 
PL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor Miller
PL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor MillerPL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor Miller
PL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor Miller
 
MM-4097, OpenCV-CL, by Harris Gasparakis, Vadim Pisarevsky and Andrey Pavlenko
MM-4097, OpenCV-CL, by Harris Gasparakis, Vadim Pisarevsky and Andrey PavlenkoMM-4097, OpenCV-CL, by Harris Gasparakis, Vadim Pisarevsky and Andrey Pavlenko
MM-4097, OpenCV-CL, by Harris Gasparakis, Vadim Pisarevsky and Andrey Pavlenko
 
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla MahGS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
 
PT-4058, Measuring and Optimizing Performance of Cluster and Private Cloud Ap...
PT-4058, Measuring and Optimizing Performance of Cluster and Private Cloud Ap...PT-4058, Measuring and Optimizing Performance of Cluster and Private Cloud Ap...
PT-4058, Measuring and Optimizing Performance of Cluster and Private Cloud Ap...
 
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary DemosMM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
 
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
 
PT-4059, Bolt: A C++ Template Library for Heterogeneous Computing, by Ben Sander
PT-4059, Bolt: A C++ Template Library for Heterogeneous Computing, by Ben SanderPT-4059, Bolt: A C++ Template Library for Heterogeneous Computing, by Ben Sander
PT-4059, Bolt: A C++ Template Library for Heterogeneous Computing, by Ben Sander
 
PT-4142, Porting and Optimizing OpenMP applications to APU using CAPS tools, ...
PT-4142, Porting and Optimizing OpenMP applications to APU using CAPS tools, ...PT-4142, Porting and Optimizing OpenMP applications to APU using CAPS tools, ...
PT-4142, Porting and Optimizing OpenMP applications to APU using CAPS tools, ...
 
Leverage the Speed of OpenCL™ with AMD Math Libraries
Leverage the Speed of OpenCL™ with AMD Math LibrariesLeverage the Speed of OpenCL™ with AMD Math Libraries
Leverage the Speed of OpenCL™ with AMD Math Libraries
 

Ähnlich wie WT-4064, Build Rich Applications with HTML5 and WebGL, by Tony Parisi

Developing Web Graphics with WebGL
Developing Web Graphics with WebGLDeveloping Web Graphics with WebGL
Developing Web Graphics with WebGLTony Parisi
 
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
 
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
 
WebGL - It's GO Time
WebGL - It's GO TimeWebGL - It's GO Time
WebGL - It's GO TimeTony Parisi
 
WebGL: The Next Generation
WebGL:  The Next GenerationWebGL:  The Next Generation
WebGL: The Next GenerationTony Parisi
 
WebGL Crash Course
WebGL Crash CourseWebGL Crash Course
WebGL Crash CourseTony Parisi
 
HTML5 and Other Modern Browser Game Tech
HTML5 and Other Modern Browser Game TechHTML5 and Other Modern Browser Game Tech
HTML5 and Other Modern Browser Game Techvincent_scheib
 
WebGL demos showcase
WebGL demos showcaseWebGL demos showcase
WebGL demos showcaseYukio Andoh
 
HTML5DevConf 2013 (October): WebGL is a game changer!
HTML5DevConf 2013 (October): WebGL is a game changer!HTML5DevConf 2013 (October): WebGL is a game changer!
HTML5DevConf 2013 (October): WebGL is a game changer!Iker Jamardo
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsBinary Studio
 
Drawing in HTML5 Open House
Drawing in HTML5 Open HouseDrawing in HTML5 Open House
Drawing in HTML5 Open HouseNoam Kfir
 
Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012philogb
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptFITC
 
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webpjcozzi
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile   jsday 2014 - Verona 14 mayAngular js mobile   jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 mayLuciano Amodio
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty grittyMario Noble
 
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
 
Rich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptRich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptGjokica Zafirovski
 

Ähnlich wie WT-4064, Build Rich Applications with HTML5 and WebGL, by Tony Parisi (20)

Developing Web Graphics with WebGL
Developing Web Graphics with WebGLDeveloping Web Graphics with WebGL
Developing Web Graphics with WebGL
 
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
 
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
 
WebGL - It's GO Time
WebGL - It's GO TimeWebGL - It's GO Time
WebGL - It's GO Time
 
WebGL: The Next Generation
WebGL:  The Next GenerationWebGL:  The Next Generation
WebGL: The Next Generation
 
WebGL Crash Course
WebGL Crash CourseWebGL Crash Course
WebGL Crash Course
 
HTML5 and Other Modern Browser Game Tech
HTML5 and Other Modern Browser Game TechHTML5 and Other Modern Browser Game Tech
HTML5 and Other Modern Browser Game Tech
 
WebGL and three.js
WebGL and three.jsWebGL and three.js
WebGL and three.js
 
WebGL demos showcase
WebGL demos showcaseWebGL demos showcase
WebGL demos showcase
 
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!
 
Artists Only
Artists OnlyArtists Only
Artists Only
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphics
 
Drawing in HTML5 Open House
Drawing in HTML5 Open HouseDrawing in HTML5 Open House
Drawing in HTML5 Open House
 
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
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScript
 
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open web
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile   jsday 2014 - Verona 14 mayAngular js mobile   jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 may
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty gritty
 
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?
 
Rich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptRich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScript
 

Mehr von AMD Developer Central

DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
DX12 & Vulkan: Dawn of a New Generation of Graphics APIsDX12 & Vulkan: Dawn of a New Generation of Graphics APIs
DX12 & Vulkan: Dawn of a New Generation of Graphics APIsAMD Developer Central
 
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware WebinarAn Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware WebinarAMD Developer Central
 
Webinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop IntelligenceWebinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop IntelligenceAMD Developer Central
 
The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...
The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...
The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...AMD Developer Central
 
TressFX The Fast and The Furry by Nicolas Thibieroz
TressFX The Fast and The Furry by Nicolas ThibierozTressFX The Fast and The Furry by Nicolas Thibieroz
TressFX The Fast and The Furry by Nicolas ThibierozAMD Developer Central
 
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellRendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellAMD Developer Central
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonAMD Developer Central
 
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave OldcornDirect3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave OldcornAMD Developer Central
 
Introduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan NevraevIntroduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan NevraevAMD Developer Central
 
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth ThomasHoly smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth ThomasAMD Developer Central
 
Computer Vision Powered by Heterogeneous System Architecture (HSA) by Dr. Ha...
Computer Vision Powered by Heterogeneous System Architecture (HSA) by  Dr. Ha...Computer Vision Powered by Heterogeneous System Architecture (HSA) by  Dr. Ha...
Computer Vision Powered by Heterogeneous System Architecture (HSA) by Dr. Ha...AMD Developer Central
 
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...AMD Developer Central
 
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14AMD Developer Central
 
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14AMD Developer Central
 

Mehr von AMD Developer Central (20)

DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
DX12 & Vulkan: Dawn of a New Generation of Graphics APIsDX12 & Vulkan: Dawn of a New Generation of Graphics APIs
DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Media SDK Webinar 2014
Media SDK Webinar 2014Media SDK Webinar 2014
Media SDK Webinar 2014
 
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware WebinarAn Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
 
DirectGMA on AMD’S FirePro™ GPUS
DirectGMA on AMD’S  FirePro™ GPUSDirectGMA on AMD’S  FirePro™ GPUS
DirectGMA on AMD’S FirePro™ GPUS
 
Webinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop IntelligenceWebinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop Intelligence
 
The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...
The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...
The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...
 
Inside XBox- One, by Martin Fuller
Inside XBox- One, by Martin FullerInside XBox- One, by Martin Fuller
Inside XBox- One, by Martin Fuller
 
TressFX The Fast and The Furry by Nicolas Thibieroz
TressFX The Fast and The Furry by Nicolas ThibierozTressFX The Fast and The Furry by Nicolas Thibieroz
TressFX The Fast and The Furry by Nicolas Thibieroz
 
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellRendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
 
Gcn performance ftw by stephan hodes
Gcn performance ftw by stephan hodesGcn performance ftw by stephan hodes
Gcn performance ftw by stephan hodes
 
Inside XBOX ONE by Martin Fuller
Inside XBOX ONE by Martin FullerInside XBOX ONE by Martin Fuller
Inside XBOX ONE by Martin Fuller
 
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave OldcornDirect3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
 
Introduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan NevraevIntroduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan Nevraev
 
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth ThomasHoly smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
 
Computer Vision Powered by Heterogeneous System Architecture (HSA) by Dr. Ha...
Computer Vision Powered by Heterogeneous System Architecture (HSA) by  Dr. Ha...Computer Vision Powered by Heterogeneous System Architecture (HSA) by  Dr. Ha...
Computer Vision Powered by Heterogeneous System Architecture (HSA) by Dr. Ha...
 
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
 
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
 
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
 

Kürzlich hochgeladen

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 

Kürzlich hochgeladen (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 

WT-4064, Build Rich Applications with HTML5 and WebGL, by Tony Parisi

  • 1. BUILD RICH APPLICATIONS IN HTML5 AND WEBGL TONY PARISI NOVEMBER 12, 2013
  • 2. ABOUT ME  serial entrepreneur  founder, Vizi (stealth startup)  consulting architect and CTO  co-creator, VRML and X3D web standards  co-designer, glTF  author, speaker instructor  contact information book source code https://github.com/tparisi/WebGLBook https://github.com/tparisi/Programming3DApplications tparisi@gmail.com skype: auradeluxe http://twitter.com/auradeluxe http://www.tonyparisi.com/ http://www.learningwebgl.com/ 2 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 3. RIP: 1995-2013 Image: 3 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 Eric Dye http://www.tonyparisi.com/
  • 4. LONG LIVE… 4 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 5. HTML5: THE BROWSER AS PLATFORM  graphics APIs– Canvas, WebGL, SVG  CSS3 – animations, transitions, transforms and filter effects  hardware-accelerated compositing ‒ all elements blend seamlessly on page  JavaScript performance and language enhancements  and a whole lot more… ‒ first-class streaming media types - <audio>, <video> ‒ device input ‒ location and mobile-inspired features ‒ database, local storage, file system ‒ networking – sockets and real-time connections (WebRTC) ‒ multi-threading (Workers) 5 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 6. WebGL: REAL-TIME 3D RENDERING  the 3D API standard ‒ OpenGL ES™ in a browser ‒ JavaScript API bindings ‒ supported in all modern browsers ‒ shipped since early 2011 …and it’s awesome. supported in • • • • desktop Safari, Firefox, Chrome, Opera, IE Android – mobile Chrome, mobile Firefox FireOS (Kindle Fire HDX) Blackberry, Tizen, Firefox OS • Surface (Windows 8.1) • iOS mobile Safari – iAds only • 500M+ seats -> 1B 6 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 100,000 Stars Google Experiment http://www.tonyparisi.com/
  • 7. WebGL APPLICATIONS advertising and media data visualization 7 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 products and e-commerce page graphics http://www.tonyparisi.com/
  • 8. JUST HOW RICH? Epic Games’ Unreal Citadel Running in Firefox http://www.unrealengine.com/html5/ 60FPS ported in 5 days Unreal native C++ engine -> JavaScript 8 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 Emscripten + asm.js http://www.tonyparisi.com/
  • 9. HOW WebGL WORKS  it’s a JavaScript drawing API ‒ draw to a canvas element using a special context (“webgl”) ‒ low-level drawing – buffers, primitives, textures and shaders ‒ accelerated by graphics hardware (GPU) ‒ can draw 2D as well as 3D graphics  integrates seamlessly with other page content  there is no file format; no markup language; no DOM.  libraries and frameworks are key to fast ramp up and productive development 9 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 10. A SIMPLE WebGL PROGRAM 1. create a <canvas> element 2. obtain a drawing context 3. initialize the viewport 4. create one or more buffers 5. create one or more matrices 6. create one or more shaders 7. initialize the shaders 8. draw one or more primitives 10 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 11. CREATE THE CANVAS, CONTEXT AND VIEWPORT function initWebGL(canvas) { var gl = null; var msg = "Your browser does not support WebGL, " + "or it is not enabled by default."; try { gl = canvas.getContext(“webgl"); } catch (e) { msg = "Error creating WebGL Context!: " + e.toString(); } detect WebGL if (!gl) { alert(msg); throw new Error(msg); } return gl; set WebGL drawing region } function initViewport(gl, canvas) { gl.viewport(0, 0, canvas.width, canvas.height); } 11 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 12. BUFFERS AND TYPED ARRAYS var vertexBuffer; vertexBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); var verts = [ // Front face -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, // Back face -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0, … WebGL drawing functions use buffers of data Typed Arrays: new low-level data type stores arrays of floats and ints compactly ]; gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verts), gl.STATIC_DRAW); 12 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 13. SHADERS var vertexShaderSource = " " " " " " " " " " " " attribute vec3 vertexPos;n" + attribute vec2 texCoord;n" + uniform mat4 modelViewMatrix;n" + uniform mat4 projectionMatrix;n" + varying vec2 vTexCoord;n" + void main(void) {n" + // Return the transformed and projected vertex valuen" + gl_Position = projectionMatrix * modelViewMatrix * n" + vec4(vertexPos, 1.0);n" + // Output the texture coordinate in vTexCoordn" + vTexCoord = texCoord;n" + }n"; var fragmentShaderSource = " precision mediump float;n" + " varying vec2 vTexCoord;n" + " uniform sampler2D uSampler;n" + " void main(void) {n" + " // Return the pixel color: always output whiten" + " gl_FragColor = texture2D(uSampler, vec2(vTexCoord.s, vTexCoord.t));n" + "}n"; 13 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 the vertex shader transforms modelspace positions into screen space the fragment shader outputs a color value for each pixel http://www.tonyparisi.com/
  • 14. DRAWING function draw(gl, obj) { // clear the background (with black) gl.clearColor(0.0, 0.0, 0.0, 1.0); gl.enable(gl.DEPTH_TEST); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); clear the canvas // set the shader to use gl.useProgram(shaderProgram); set the shader // connect up the shader parameters: vertex position, texture coordinate, // projection/model matrices and texture // set up the buffers gl.bindBuffer(gl.ARRAY_BUFFER, obj.buffer); gl.vertexAttribPointer(shaderVertexPositionAttribute, obj.vertSize, gl.FLOAT, false, 0, 0); gl.bindBuffer(gl.ARRAY_BUFFER, obj.texCoordBuffer); gl.vertexAttribPointer(shaderTexCoordAttribute, obj.texCoordSize, gl.FLOAT, false, 0, 0); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, obj.indices); gl.uniformMatrix4fv(shaderProjectionMatrixUniform, false, projectionMatrix); gl.uniformMatrix4fv(shaderModelViewMatrixUniform, false, modelViewMatrix); gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, webGLTexture); gl.uniform1i(shaderSamplerUniform, 0); // draw the object gl.drawElements(obj.primtype, obj.nIndices, gl.UNSIGNED_SHORT, 0); } 14 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 set up buffers for vertices and texture coordinates pass transform and projection matrices to the shader set the texture and pass to the shader draw the object http://www.tonyparisi.com/
  • 15. A WebGL CLIENT-SIDE STACK  rendering – Three.js library  animation – Three.js, Tween.js libraries  application functionality – game engine/framework ‒ setup/teardown ‒ interaction – picking, rollovers, rotating models ‒ behaviors ‒ run loop and event dispatching  content creation pipeline ‒ 3D tools e.g. Autodesk Maya ‒ COLLADA, glTF formats; conversion tools 15 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 16. Three.js: A JAVASCRIPT 3D ENGINE https://github.com/mrdoob/three.js/  the most popular WebGL library renderer = new THREE.WebGLRenderer( { canvas: canvas, antialias: true } ); scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera( 45, canvas.width / canvas.height, 1, 4000 ); scene.add(camera); can render to WebGL, 2D canvas, SVG and CSS3 var light = new THREE.DirectionalLight( 0xffffff, 1.5); scene.add( light ); var mapUrl ="../images/webgl-logo-256.jpg“; var map = THREE.ImageUtils.loadTexture(mapUrl ); var material = new THREE.MeshPhongMaterial({ map: map }); represents WebGL at a high level using standard 3D graphics concepts var geometry = new THREE.CubeGeometry(2, 2, 2); cube = new THREE.Mesh(geometry, material); scene.add( cube ); 16 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 17. 3D ANIMATION  requestAnimationFrame() http://www.paulirish.com/2011/requestanimationframe-for-smartanimating/  with JavaScript we can animate anything: materials, lights, textures…. Shaders  Three.js has support for key frames, morphs and skins  Tween.js – simple tweening library https://github.com/sole/tween.js/ var tween = new TWEEN.Tween( { x: 50, y: 0 } ) .to( { x: 400 }, 2000 ) .easing( TWEEN.Easing.Elastic.InOut ) .start(); function animate() { requestAnimationFrame( animate ); TWEEN.update(); } 17 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 create and run tween call TWEEN.update() each frame to update values http://www.tonyparisi.com/
  • 18. WebGL PIPELINE TOOLS  WebGL has no file format; no markup language; no DOM. ‒ apps/libraries must define their own formats  a lot of people are still creating content by writing code  existing 3D formats proprietary, incomplete or ill-suited for web/mobile delivery  help is on the way: glTF ‒ a “JPEG for 3D” ‒ bridges the gap between existing 3D formats/tools and today’s GL based APIs ‒ compact, efficient to load representation ‒ JSON scene description and high-level objects ‒ binary vector and animation data  a common publishing format for content tools ‒ open specification; open process glTF Three.js Loader Prototype ‒ Khronos Group initiative within the COLLADA working group ‒ F. Robinet (lead), R. Arnaud, P. Cozzi, T. Parisi ‒ https://github.com/KhronosGroup/glTF ‒ http://gltf.gl/ 18 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 19. WebGL ENGINES AND FRAMEWORKS  Provide application-level functionality ‒ setup/teardown ‒ interaction – picking, rollovers, rotating models ‒ behaviors ‒ run loop and event dispatching ‒ FSM objects (states) ‒ physics, dynamics, collision, … ‒ view models, camera controllers, … game engines/IDEs libraries/frameworks PlayCanvas http://www.playcanvas.com/ Three.js http://threejs.org/ Turbulenz https://turbulenz.com/ SceneJS Goo Enginehttp://www.gootechnologies.com/ http://scenejs.org/ Artillery Engine https://artillery.com/ BabylonJS Verold http://verold.com/ Sketchfab https://sketchfab.com/ Unreal… ? http://www.extremetech.com/gaming/151900unreal-engine-3-ported-to-javascript-and-webglworks-in-any-modern-browser http://www.babylonjs.com/ Voodoo.js http://www.voodoojs.com/ tQuery http://jeromeetienne.github.io/tquery/ Vizi https://github.com/tparisi/Vizi 19 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 20. CSS3: ADVANCED PAGE EFFECTS  CSS transitions  CSS animations  CSS 3D transforms  CSS filter effects  CSS custom filters 20 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 21. CSS3 TRANSITIONS source: http://www.kirupa.com/html5/all_about_css_transitions.htm  allow gradual changes to CSS properties over time new CSS3 properties currently require vendorspecific prefixes #box img { -webkit-transition: transform .5s ease-in; -webkit-transform: translate3d(0, -350px, 0); } #box img:hover { -webkit-transition: transform .5s ease-in; -webkit-transform: translate3d(0, 0px, 0); cursor: pointer; } -webkit-transition: all .5s ease-in -.1s; 21 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 shortcut for specify property to transition, duration of transition, easing function transition-property: all; transition-duration: .5s; transition-timing-function: ease-in; transition-delay: .1s; http://www.tonyparisi.com/
  • 22. CSS3 ANIMATIONS source: http://www.kirupa.com/html5/all_about_css_animations.htm  allow fine control over animation behavior with key frames #bigcloud { animation: bobble 2s infinite; } @keyframes bobble { 0% { transform: translate3d(50px, 40px, 0px); animation-timing-function: ease-in; } 50% { transform: translate3d(50px, 50px, 0px); animation-timing-function: ease-out; } 100% { transform: translate3d(50px, 40px, 0px); } } 22 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 each key frame contains a transform control timing with ease in/out functions keys are used to interpolate transform values http://www.tonyparisi.com/
  • 23. CSS3 3D TRANSFORMS  translate, rotate, scale page elements with perspective browser will render element in 3D perspective .bk-list li { perspective: 1800px; } apply to child elements .bk-list li .bk-front { transform-style: preserve-3d; add origin to transform-origin: 0% 50%; translation transform: translate3d(0,0,20px); } apply 35 degree rotation about Y axis .bk-list li .bk-book.bk-bookdefault:hover { transform: rotate3d(0,1,0,35deg); } 23 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 Using 3D transform forces hardware acceleration http://tympanus.net/codrops/2013/01/08/3dbook-showcase/ http://www.tonyparisi.com/
  • 24. CSS3 FILTER EFFECTS source: http://html5-demos.appspot.com/static/css/filters/index.html  apply post-processing effects to image elements img { -webkit-filter: sepia(100%); } img { -webkit-filter: grayscale(100%); } img { -webkit-filter: blur(2px); } img { -webkit-filter: brightness(33%); } img { -webkit-filter: contrast(67%); } 24 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 25. CSS3 CUSTOM FILTERS source: http://alteredqualia.com/css-shaders/crumple.html .shader { -webkit-filter: custom(url(shaders/crumple.vs) mix(url(shaders/crumple.fs) multiply source-atop), 50 50, amount 0, strength 0.2, lightIntensity 1.05, transform rotateX(0deg) translateZ(0px) ); -webkit-transition: -webkit-filter linear 1.5s; box-shadow: 0 0 2em #111; } .shader:hover { -webkit-filter: custom(url(shaders/crumple.vs) mix(url(shaders/crumple.fs) multiply source-atop), 50 50, amount 1, strength 0.2, lightIntensity 1.05, transform rotateX(0deg) translateZ(0px) ); } Crumple shader by Branislav Ulicny (AlteredQualia) http://alteredqualia.com/cssshaders/crumple.html 25 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 26. CSS3 VERTEX SHADER void main() { // Compute displacement float time = 10.0 * quadraticInOut( amount ); vec2 surfaceCoordinate = 0.025 * a_texCoord; float n = surface( surfaceCoordinate, time ); float curve = strength * n; browser predefines a_texCoord and a_position, passes into shader vec4 pos = a_position; pos.z = amount * ( 0.5 * strength - curve ); // Compute normal const float e = 0.001; float nx = surface( surfaceCoordinate + vec2( e, 0.0 ), time ); float ny = surface( surfaceCoordinate + vec2( 0.0, e ), time ); vec3 normal = normalize( vec3( n - nx, n - ny, 1.0 - strength * 1.25 ) ); // Compute lighting (directional light) vec3 lightPosition = normalize( vec3( 0.0, 0.5, 1.0 ) ); float lightWeight = lightIntensity * max( dot( normal, lightPosition ), 0.0 ); // Set vertex position gl_Position = u_projectionMatrix * perspective( 0.9 ) * transform * pos; shader outputs new vertex position, passes lighting information to fragment shader v_uv = a_texCoord; v_height = n; v_light = lightWeight; 26 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 27. CSS3 FRAGMENT SHADER // Uniform values from CSS uniform float amount; // Varyings passed in from vertex shader varying vec2 v_uv; varying float v_height; varying float v_light; void main() { const float a = 1.0; float r, g, b; // Light variant float n = v_light; float v = mix( 1.0, n * n, amount ); r = g = b = sqrt( v ); // Set color matrix Fragment shader outputs blend value based on light calculated in vertex shader and usersupplied amount css_ColorMatrix = mat4( r, 0.0, 0.0, 0.0, 0.0, g, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, a ); } 27 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 28. CSS3 SUPPORT source: http://css3.bradshawenterprises.com/ CSS3 Transitions supported since • Safari 3.2: 13/11/2008 • Firefox 4.0: Late 2010 • Chrome 1.0: 02/09/2008 • Opera 10.5: 02/03/2010 • Internet Explorer 10: 09/2011 CSS 3D Transforms supported since • Safari 4.0: 11/06/2008 • Chrome: 28/08/2010 • IE 10: 09/2011 • Firefox: 27/10/2011 CSS3 Filters CSS3 Animations supported since • Safari 4.0: 11/06/2008 • Chrome 1.0: 02/09/2008 • Firefox 5: 20/04/2011 • IE 10: 09/2011 • Opera: 03/2012 28 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 supported since • Safari 6.0 • Chrome: 18.0 CSS3 Custom Filters supported only in Chrome http://www.tonyparisi.com/
  • 29. FUN WITH THREE.JS AND CSS3 http://mrdoob.github.io/three.js/examples/css3d_periodictable.html 29 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 30. LANGUAGE INNOVATIONS tackling performance and memory challenges  asm.js optimizable, low-level subset of JavaScript; strictly typed; improves performance (2x native vs. 3-10x) runs in FF and Chrome nightlies http://asmjs.org/  Emscripten LLVM-to-JavaScript compiler translates C++ native code to JavaScript; can output to asm.js https://github.com/kripken/emscripten/wiki  new Web languages - Dart, TypeScript optionally strongly typed; class-based https://www.dartlang.org/ http://www.typescriptlang.org/ 30 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 31. RESOURCES     WebGL specification http://www.khronos.org/registry/webgl/specs/latest/ Learning WebGL http://www.learningwebgl.com/ Three.js https://github.com/mrdoob/three.js/ requestAnimationFrame http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/  CSS specifications http://www.w3.org/TR/css3-animations/ http://www.w3.org/TR/css3-transitions/ http://www.w3.org/TR/css3-transforms/ http://www.w3.org/TR/filter-effects/  CSS animation demos http://www.creativebloq.com/css3/animation-with-css3-712437  CSS 3D transforms explained http://desandro.github.io/3dtransforms/  Adobe filter lab - playing with filter effectshttp://html.adobe.com/webplatform/graphics/customfilters/cssfilterlab/  Alan Greenblatt’s blog – CSS filter effects http://blattchat.com/ 31 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/
  • 32. STAY IN TOUCH… contact information tparisi@gmail.com skype: auradeluxe http://twitter.com/auradeluxe arisi.com/ http://www.learningwebgl.com/ http://www.tonyp book source code https://github.com/tparisi/WebGLBook https://github.com/tparisi/Programming3DApplications get the books! WebGL: Up and Running http://www.amazon.com/dp/144932357X Programming 3D Applications with HTML and WebGL http://www.amazon.com/Programming-Applications-HTML5-WebGLVisualization/dp/1449362966 32 | BUILD RICH APPLICATION S IN HTML5 AND WEBGL | NOVEMBER 21, 2013 http://www.tonyparisi.com/