webgl fundamentals

44
Thursday, November 3, 2011

Post on 18-Oct-2014

4.687 views

Category:

Technology


16 download

DESCRIPTION

3D Graphics have come to the browser and this represents a new world of possibilities. WebGL has a reputation for a high entry barrier, but fortunately there are already some frameworks out there making things simpler. We’ll cover some of the WebGL basics and show you what to look for in a framework for 3D graphics in the browser. You’ll also meet PhiloGL, a WebGL framework focused on data visualization, creative coding and game development from Sencha Labs. Prepare to watch cool 3D demos!

TRANSCRIPT

Page 1: WebGL Fundamentals

Thursday, November 3, 2011

Page 2: WebGL Fundamentals

Nicolas Garcia Belmonte, Sencha

@philogb

http://philogb.github.com/

WebGL Fundamentals

Thursday, November 3, 2011

Page 3: WebGL Fundamentals

Agenda

Thursday, November 3, 2011

Page 4: WebGL Fundamentals

Agenda

What is WebGL ?

What can WebGL be used for ?

How can I get started with WebGL ?

Thursday, November 3, 2011

Page 5: WebGL Fundamentals

What is WebGL ?

Thursday, November 3, 2011

Page 7: WebGL Fundamentals

What is WebGL ?

OpenGL

OpenGL ES

WebGL

Thursday, November 3, 2011

Page 8: WebGL Fundamentals

What is WebGL ?

JavaScript

GPU (Compiled Program)

WebGL JS API

Thursday, November 3, 2011

Page 9: WebGL Fundamentals

What is WebGL ?JavaScript

Fragment Shader

WebGL JS API

Vertex ShaderGLSL API

GLSL API

Thursday, November 3, 2011

Page 10: WebGL Fundamentals

What is WebGL ?JavaScript

Fragment Shader

WebGL JS API

Vertex ShaderGLSL API

GLSL API

[x1, y1, z1, x2, y2, z2, ...]

attributeuniform

uniform varying

Thursday, November 3, 2011

Page 11: WebGL Fundamentals

What is WebGL ?JavaScript

Fragment Shader

Vertex Shader

[x1, y1, z1, x2, y2, z2, ...]

attributeuniform

uniform varying

Triangle Assembly

Rasterization

Thursday, November 3, 2011

Page 12: WebGL Fundamentals

What is WebGL ?

Fragment Shader

Vertex Shader

Triangle Assembly

Rasterization

Thursday, November 3, 2011

Page 13: WebGL Fundamentals

What can WebGL be used for ?

Thursday, November 3, 2011

Page 14: WebGL Fundamentals

What can WebGL be used for ?

Thursday, November 3, 2011

Page 15: WebGL Fundamentals

What can WebGL be used for ?

Interactive games

Data visualization

Creative coding

Physics simulations

Music videos

... very fast processing of any data.Thursday, November 3, 2011

Page 18: WebGL Fundamentals

Thursday, November 3, 2011

Page 27: WebGL Fundamentals

Thursday, November 3, 2011

Page 28: WebGL Fundamentals

PhiloGL

A WebGL framework for data visualization, creative coding and

game development.

Thursday, November 3, 2011

Page 29: WebGL Fundamentals

PhiloGL

http://senchalabs.github.com/philogl/

A WebGL framework for data visualization, creative coding and

game development.

Thursday, November 3, 2011

Page 30: WebGL Fundamentals

PhiloGL

A WebGL framework for data visualization, creative coding and

game development.

Thursday, November 3, 2011

Page 31: WebGL Fundamentals

PhiloGL

http://senchalabs.github.com/philogl/

A WebGL framework for data visualization, creative coding and

game development.

Thursday, November 3, 2011

Page 32: WebGL Fundamentals

HTML Document

Thursday, November 3, 2011

Page 33: WebGL Fundamentals

How most people see a WebGL app:

HTML DocumentWebGL Canvas

Thursday, November 3, 2011

Page 34: WebGL Fundamentals

How we see a WebGL app:

WebGL Canvas

Web Workers

2D Canvas XHR(2)

Video

Audio

Images

Forms

Thursday, November 3, 2011

Page 36: WebGL Fundamentals

PhiloGL

Thursday, November 3, 2011

Page 37: WebGL Fundamentals

PhiloGL

Idiomatic JavaScript

Rich Module System

Flexible and Performance Focused

Thursday, November 3, 2011

Page 38: WebGL Fundamentals

Idiomatic JavaScript

Thursday, November 3, 2011

Page 39: WebGL Fundamentals

Idiomatic JavaScript

Concise & Expressive

Thursday, November 3, 2011

Page 40: WebGL Fundamentals

  //Create application  PhiloGL('canvasId', {    program: {      from: 'uris',      vs: 'shader.vs.glsl',      fs: 'shader.fs.glsl'    },    camera: {      position: {        x: 0, y: 0, z: -50      }    },    textures: {      src: ['arroway.jpg', 'earth.jpg']    },    events: {      onDragMove: function(e) {        //do things...      },      onMouseWheel: function(e) {        //do things...      }    },    onError: function() {      alert("There was an error creating the app.");    },    onLoad: function(app) {      /* Do things here */    }  });

Thursday, November 3, 2011

Page 41: WebGL Fundamentals

CoreMathWebGLProgramShadersO3DCameraSceneEventFxIOWorkersMedia

Module System

Thursday, November 3, 2011

Page 43: WebGL Fundamentals

Thanks!

Thursday, November 3, 2011

Page 44: WebGL Fundamentals

Thanks!

@philogb

http://philogb.github.com/

http://senchalabs.github.com/philogl/

Thursday, November 3, 2011