3D and 2D for web 
Agus Susilo
WebGL? 
● Javascript API untuk merender grafis 3D dan 2D 
pada browser web yang kompatibel tanpa 
menggunakan plugin 
● Integrasi penuh ke semua standar web browser 
● Penggunaan GPU fisik 
● Dapat di campur dengan elemen HTML
Design 
● WebGL di bangun berdasarkan pada OpenGL 
ES 2.0 yang menyediakan API untuk grafis 3D 
● Menggunakan elemen kanvas pada HTML5 
● Dapat di akses melalui DOM interface
History 
● WebGL tumbuh dari eksperimen Canvas 3D 
dimulai oleh Vladimir Vukicevic di Mozilla, 
● Pertama kali di demokan pd tahun 2006 
● Tahun 2009 Consortium Khronos Group 
memulai kelompok kerja WebGL 
● Yang di dukung oleh Apple, Google, Mozilla 
● Aplikasi pertama yaitu Google Maps dan 
Zygote Body
Support 
● Didukung luas pada web browser modern 
● Ketersediaan WebGL ini juga tergantung pada 
faktor lain seperti dukungan dari GPU
Desktop Browsers 
● Google Chrome, support sejak versi 9 
● Mozilla Firefoz, versi 4.0 ke atas 
● Safari, versi >= 6 pada Lion, Mountain Lion, 
Safari 5.1 Snow Leopard, 
disabled by default 
● Opera, versi 11 dan 12, disabled by default 
● Internet Explorer, partially supported in IE 11
Mobile Browsers 
● Nokia N900, Web browser MicroB 
● Blackberry playbook, OS 2.0 
● Firefox mobile 
● Firefox OS 
● Google Chrome >= 25 
● Opera Mobile >= 12 
● Tizen 1.0 
● Ubuntu Touch
Library and Ecosystem 
● Library: 
– three.js 
– O3D 
– OSG.JS 
– GLGE 
● Game Engine: 
– Unreal Engine 4 
– Unity 5 
● 3D object import
Examples, Simple rotating Cube 
var camera, scene, renderer; 
var geometry, material, mesh; 
init(); 
animate(); 
function init() { 
camera = new 
THREE.PerspectiveCamera(75,
Examples, Simple rotating Cube 
mesh = new THREE.Mesh(geometry, material); 
scene.add(mesh); 
renderer = new THREE.CanvasRenderer(); 
renderer.setSize(window.innerWidth, window.innerHeight); 
document.body.appendChild(renderer.domElement); 
} 
function animate() { 
requestAnimationFrame(animate); 
mesh.rotation.x += 0.01; 
mesh.rotation.y += 0.02; 
renderer.render(scene, camera); 
}
Demos 
● http://stemkoski.github.io/Three.js/ 
● http://threejs.org/ 
● http://www.glge.org/category/demos/ 
● http://osgjs.org/#examples 
● http://www.chromeexperiments.com/webgl/
Terima kasih 
? 
Semoga bermanfaat ;)

Web GL by Agus S - Swevel

  • 1.
    3D and 2Dfor web Agus Susilo
  • 2.
    WebGL? ● JavascriptAPI untuk merender grafis 3D dan 2D pada browser web yang kompatibel tanpa menggunakan plugin ● Integrasi penuh ke semua standar web browser ● Penggunaan GPU fisik ● Dapat di campur dengan elemen HTML
  • 3.
    Design ● WebGLdi bangun berdasarkan pada OpenGL ES 2.0 yang menyediakan API untuk grafis 3D ● Menggunakan elemen kanvas pada HTML5 ● Dapat di akses melalui DOM interface
  • 4.
    History ● WebGLtumbuh dari eksperimen Canvas 3D dimulai oleh Vladimir Vukicevic di Mozilla, ● Pertama kali di demokan pd tahun 2006 ● Tahun 2009 Consortium Khronos Group memulai kelompok kerja WebGL ● Yang di dukung oleh Apple, Google, Mozilla ● Aplikasi pertama yaitu Google Maps dan Zygote Body
  • 5.
    Support ● Didukungluas pada web browser modern ● Ketersediaan WebGL ini juga tergantung pada faktor lain seperti dukungan dari GPU
  • 6.
    Desktop Browsers ●Google Chrome, support sejak versi 9 ● Mozilla Firefoz, versi 4.0 ke atas ● Safari, versi >= 6 pada Lion, Mountain Lion, Safari 5.1 Snow Leopard, disabled by default ● Opera, versi 11 dan 12, disabled by default ● Internet Explorer, partially supported in IE 11
  • 7.
    Mobile Browsers ●Nokia N900, Web browser MicroB ● Blackberry playbook, OS 2.0 ● Firefox mobile ● Firefox OS ● Google Chrome >= 25 ● Opera Mobile >= 12 ● Tizen 1.0 ● Ubuntu Touch
  • 8.
    Library and Ecosystem ● Library: – three.js – O3D – OSG.JS – GLGE ● Game Engine: – Unreal Engine 4 – Unity 5 ● 3D object import
  • 9.
    Examples, Simple rotatingCube var camera, scene, renderer; var geometry, material, mesh; init(); animate(); function init() { camera = new THREE.PerspectiveCamera(75,
  • 10.
    Examples, Simple rotatingCube mesh = new THREE.Mesh(geometry, material); scene.add(mesh); renderer = new THREE.CanvasRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); } function animate() { requestAnimationFrame(animate); mesh.rotation.x += 0.01; mesh.rotation.y += 0.02; renderer.render(scene, camera); }
  • 11.
    Demos ● http://stemkoski.github.io/Three.js/ ● http://threejs.org/ ● http://www.glge.org/category/demos/ ● http://osgjs.org/#examples ● http://www.chromeexperiments.com/webgl/
  • 12.
    Terima kasih ? Semoga bermanfaat ;)

Editor's Notes

  • #3 WebGL is integrated completely into all the web standards of the browser allowing GPU accelerated usage of physics and image processing and effects as part of the web page canvas. WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background.[3] WebGL programs consist of control code written in JavaScript and shader code that is executed on a computer's Graphics Processing Unit (GPU). WebGL is designed and maintained by the non-profit Khronos Group.
  • #4 WebGL is based on OpenGL ES 2.0 and provides an API for 3D graphics. It uses the HTML5 canvas element and is accessed using Document Object Model interfaces. Automatic memory management is provided as part of the JavaScript language.[4] Like OpenGL ES 2.0, WebGL does not have the fixed-function APIs introduced in OpenGL 1.0 and deprecated in OpenGL 3.0. This functionality can instead be provided by the user in the JavaScript code space. Shaders in WebGL are expressed directly in GLSL.
  • #5 Vukićević first demonstrated a Canvas 3D prototype in 2006. By the end of 2007, both Mozilla and Opera had made their own separate implementations. In early 2009, the non-profit technology consortium Khronos Group started the WebGL Working Group, with initial participation from Apple, Google, Mozilla, Opera, Version 1.0 specification was released March 2011.[1] As of March 2012, the chair of the working group is Ken Russell. Early app Google Maps and Zygote Body. These applications included Fusion 360 and AutoCAD 360. Development of the WebGL 2 specification started in 2013. This specification is based on OpenGL ES 3.0.
  • #6 WebGL is widely supported in modern browsers. However its availability is dependent on other factors like the GPU supporting it. The official WebGL website offers a simple test page. More detailed information (like what renderer the browser uses, and what extensions are available) is provided at third-party websites
  • #8 Android Browser - Basically unsupported, Sony Ericsson Xperia range of Android smartphones have had WebGL capabilities following a firmware upgrade. #Firefox mobile early version
  • #9 Can use directly without some utility library, loading scene graph and 3D Object. Tidak sederhana jika tanpa library.