David Catuhe

David Rousset

Windows Clients Evangelist Lead

Windows Clients Evangelist

http://aka.ms/david
@deltakosh

...
Agenda
 Why building a WebGL 3D engine ?
 The old school way: Using the 2D canvas
 The rise of GPUs
 Using WebGL direc...
Why building a WebGL 3D engine ?
The oldschool way: using 2D canvas
Build a 3D “Software” engine that only uses the CPU

Wireframe

Rasterization

Lights &...
The rise of GPUs
Hardware accelerated
rendering:
2D Canvas, CSS3
animations

H264 & JPG hardware
decoding

Accelerated 3D
...
Using WebGL directly
Requires a compatible browser:

A new context for the canvas:
canvas.getContext("webgl", { antialias:...
Using WebGL directly
WebGL is a low level API
Need to handle everything
except the rendering:






Shaders code (loa...
Using Babylon.js to create 3D apps & games
How to use Babylon.js ?
Open source project (Available on Github)

http://www.babylonjs.com
https://github.com/babylonjs/b...
How to use Babylon.js ?
Babylon.js is a scene graph: All complex features are abstracted for YOU!
var scene = new BABYLON....
Advanced features
Blender exporter

Offline support

Design & render

IndexedDB

Complete collisions
engine

Network optim...
What we’ve learned ?
Tracking & reducing the pressure on GC
A 3D engine is a place where matrices, vectors and quaternions live.
And there may ...
Tracking & reducing the pressure on GC
Maximum reuse of mathematical entities
 Pre-instantiate
 Stock variables
GC frien...
Performance first
Efficient shaders
Do only what is REALLY required

Scene partitioning
Frustum / submeshes / octrees

Com...
Handling touch devices
@deltakosh / @davrous
Using babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devices
Upcoming SlideShare
Loading in …5
×

Using babylon js to create apps & games for all web gl devices

2,485 views
2,290 views

Published on

We have built in France a WebGL 3d realtime engine named BabylonJS. It has been made to support all WebGL compatible platforms such as Chrome, Firefox, Opera, IE11 on the desktop as well as on Firefox OS, Android & Windows 8.1 devices. We will see 2 main points in this session. First, we’ll share some of the things we’ve learned while building it: how to track and reduce the garbage collector, how to pay attention to the performance and how to handle touch on all devices. Then, we’ll see how to use these frameworks to build your own 3d applications & games for the web! Be ready to read some code.

Published in: Technology, Art & Photos
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,485
On SlideShare
0
From Embeds
0
Number of Embeds
90
Actions
Shares
0
Downloads
11
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • Davrous/davca/davrous
  • Davrous – 4’’
  • davrous
  • Davrous – 10’’
  • davrous
  • davca
  • davca
  • Davca – 20’’
  • Davca -
  • Davca – 25’’
  • davrous
  • davrous– 35’’
  • davca
  • Davca – 40’’ (demoresponsiveness / profiler)
  • Davca – 43’’
  • Davrous- to the end (and beyond)
  • Using babylon js to create apps & games for all web gl devices

    1. 1. David Catuhe David Rousset Windows Clients Evangelist Lead Windows Clients Evangelist http://aka.ms/david @deltakosh http://aka.ms/davrous @davrous Michel Rousseau Pierre Lagarde Painting Windows Clients Evangelist Shadow Windows Clients Evangelist @rousseau_michel @pierlag
    2. 2. Agenda  Why building a WebGL 3D engine ?  The old school way: Using the 2D canvas  The rise of GPUs  Using WebGL directly  Using Babylon.js to create 3D apps and games  How to use Babylon.js?  Advanced features  What we’ve learned…  Tracking and reducing the pressure on garbage collector  Performance first  Handling touch devices
    3. 3. Why building a WebGL 3D engine ?
    4. 4. The oldschool way: using 2D canvas Build a 3D “Software” engine that only uses the CPU Wireframe Rasterization Lights & Shadows Textures
    5. 5. The rise of GPUs Hardware accelerated rendering: 2D Canvas, CSS3 animations H264 & JPG hardware decoding Accelerated 3D with WebGL
    6. 6. Using WebGL directly Requires a compatible browser: A new context for the canvas: canvas.getContext("webgl", { antialias: true}) || canvas.getContext("experimental-webgl", { antialias: true});
    7. 7. Using WebGL directly WebGL is a low level API Need to handle everything except the rendering:      Shaders code (loading, compilation) Geometry creation, topology, transfer Shaders variables management Texture and resources management Render loop
    8. 8. Using Babylon.js to create 3D apps & games
    9. 9. How to use Babylon.js ? Open source project (Available on Github) http://www.babylonjs.com https://github.com/babylonjs/babylon.js How to use it? Include one file and you’re ready to go! <script src="babylon.js"></script> To start Babylon.js, you’ve just need to create an engine object: var engine = new BABYLON.Engine(canvas, true);
    10. 10. How to use Babylon.js ? Babylon.js is a scene graph: All complex features are abstracted for YOU! var scene = new BABYLON.Scene(engine); var camera = new BABYLON.FreeCamera("Camera", new BABYLON.Vector3(0, 0, -10), scene); var light0 = new BABYLON.PointLight("Omni0", new BABYLON.Vector3(0, 100, 100), scene); var sphere = BABYLON.Mesh.createSphere("Sphere", 16, 3, scene); Handling rendering can be done in one line: engine.runRenderLoop(function() { scene.render(); });
    11. 11. Advanced features Blender exporter Offline support Design & render IndexedDB Complete collisions engine Network optimizations Incremental loading
    12. 12. What we’ve learned ?
    13. 13. Tracking & reducing the pressure on GC A 3D engine is a place where matrices, vectors and quaternions live. And there may be tons of them! Pressure is huge on the garbage collector
    14. 14. Tracking & reducing the pressure on GC Maximum reuse of mathematical entities  Pre-instantiate  Stock variables GC friendly arrays (able to reset size at no cost) When the scene is up and running, aiming at no allocation at all
    15. 15. Performance first Efficient shaders Do only what is REALLY required Scene partitioning Frustum / submeshes / octrees Complete cache system Update WebGL only when required
    16. 16. Handling touch devices
    17. 17. @deltakosh / @davrous

    ×