SlideShare a Scribd company logo
You Don’t Know
WebGL
GREE, Inc.
MM Team
MM Team
Kuu Miyazaki
@miyazaqui, github:@kuu
Jason Parrott
+JasonParrott, github:@Moncader
Guangyao Liu
@brilliun, github:@brilliun
Daijiro Wachi
@watilde, github:@watilde
WebGL Misconceptions
● WebGL === 3D?
● WebGL === Super fast?
● WebGL === Another new “magic”?
WebGL Misconceptions
● WebGL === 3D?
● WebGL === Super fast?
● WebGL === Another new “magic”?
When Talking About WebGL
This work is a derivative of a photo by Paranoidray, used under CC BY-SA.
It is licensed under CC BY-SA by GREE, Inc.
This work is a derivative of a photo by Mr mr ben, used under CC BY-SA.
It is licensed under CC BY-SA by GREE, Inc.
What About 2D Contents
● Lots of 2D contents on the web
● WebGL used for 2D in serious applications?
Theatrical Suite
WebGL in Theatrical Suite
● WebGL used in real-world product
● For rendering 2D graphics
2D Graphics By WebGL
● Extremely challenging task
● Rarely implemented even in OpenGL
2D Graphics
Vector graphics Raster graphics
https://signalizenj.wordpress.com/2015/01/29/vector-vs-raster/
Canvas 2D API
The 2D graphics API works in <canvas>
elementctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.quadraticCurveTo(
x3, y3, x4, y4
);
ctx.stroke();
ctx.fill();
ctx.drawImage(
img,
srcX, srcY,
srcWidth,
srcHeight,
x, y,
width,
height
);
Vector graphics Raster graphics
WebGL API
gl.drawArrays(mode, first, count);
gl.drawElements(mode, count, type, offset);
mode:
gl.POINTS
gl.LINES
gl.LINE_LOOP
gl.LINE_STRIP
gl.TRIANGLES
gl.TRIANGLE_STRIP
gl.TRIANGLE_FAN
Triangles
Lines
How to render 2D
graphics by WebGL?
Raster Graphics
R R
One image
(Rectangle)
Two triangles
Vector Graphics
?
Sequence of
outlines
Why not convert vector
to raster in advance?
Vector Graphics
● Resolution independant
● Small data size
● Existing assets
This work is a derivative of a photo by Darth Stabro, used under CC BY-SA.
It is licensed under CC BY-SA by GREE, Inc.
How common libraries
deal with vector
graphics?
CreateJS
Layered canvases
● Extra composition cost
Web Page
WebGL
Canvas 2D
Pixi.js
Drawing filled polygons using stencil buffer
● Extra rendering cost
http://www.cs.sun.ac.za/~lvzijl/courses/rw778/grafika/OpenGLtuts/Big/graphicsnotes014.html
three.js
Triangulation
● but with restrictions
http://mathworld.wolfram.com/Triangulation.html
How Theatrical deal
with vector graphics?
Tesspathy
And it’s open source
now!
github.com/gree/tesspathy
Vector in Theatrical
● We do triangulation
● With almost no restrictions
● Produce resolution independent curves
Now let’s watch the
SWF again.
(with a special build of Theatrical)
“Isn’t it weird to render
vector graphics in this
way?”
“Why not just use
Canvas 2D?”
First,
guess how Canvas 2D is
implemented in
browser?
Canvas Path in Chrome
● Chrome(Skia) do triangulation too!
○ With a combination of other approaches
Second,
we use WebGL for
better performance.
Let’s see the difference
“Ah, I know, WebGL is
super fast”
(Everyone says so)
WebGL Misconceptions
● WebGL === 3D?
● WebGL === Super fast?
● WebGL === Another new “magic”?
WebGL Is Super Fast?
Hardware
accelerationWebGL Super fast?
Hardware acceleration
itself does NOT
guarantee good
performance
Hardware Acceleration
Modern browsers have already been utilizing
hardware acceleration for several tasks.
chrome://gpu
Hardware Acceleration
Then why WebGL beats Canvas 2D?
chrome://tracing
WebGL Performance
● Performance boosts not ONLY because we
use WebGL
● It is the way how we use it that matters
WebGL Performance
● Draw calls
○ drawElements/drawArrays
● Texture updates
● Shader operations
○ especially Fragment Shader
WebGL Performance
● Otherwise, easy to get bad performance.
● Not to mention WebGL on mobile
○ weaker hardware
○ restricted GL features & extensions
WebGL Misconceptions
● WebGL === 3D?
● WebGL === Super fast?
● WebGL === Another new “magic”?
Extensible Web
“Avoid New Magic”
Magic In Browser
● A lot of “magic” going on in browser
○ Canvas 2D API
○ <video>
● Doing complex tasks silently in C++ w/o
letting web developers know how
WebGL is New Magic?
● WebGL is a new API
● WebGL brings plug-in free 3D into browser
● WebGL is complex
WebGL is New Magic?
var canvas2D = canvas.getContext(‘2d’);
// Existing magic
var webgl = canvas.getContext(‘webgl’);
// Aha! New magic!!!
No,
WebGL is a good
practice for extensible
web
Extensible Web
● New low-level capabilities should be exposed
to Javascript
● Existing high-level capabilities should be
explained in terms of Javascript
Extensible Web
● New low-level capabilities should be exposed
to Javascript
● Existing high-level capabilities should be
explained in terms of Javascript
Low-level Capabilities
With WebGL, we can
● Write and execute GLSL programs on GPU
● Trigger GL/Direct3D commands through
browser
WebGL exposes access
to hardwares and
GL/D3D bindings
Things restricted to native apps before
Extensible Web
● New low-level capabilities should be exposed
to Javascript
● Existing high-level capabilities should be
explained in terms of Javascript
Hardware acceleration
can be instructed using
WebGL
High-level Capabilities
● Hardware acceleration used to be a black
box to web developers
● Relying on browser vendors to gift us with
performance improvement
Hardware Acceleration
Hardware Acceleration
Without WebGL
Hardware Acceleration
Hardware Acceleration
Vertex
Buffer
Draw
Call
Texture
Shader
Program
With WebGL
Hardware Acceleration
“truly hardware accelerating graphics on the
web means giving developers access to a
programmable 3D graphics pipeline with
WebGL”
-- Chrome blog
For those really care
about rendering
performance in web
Don’t rely on browsers
any more
Use WebGL to render
your hardware
accelerating graphics
Conclusion
WebGL !== 3D
Unleash the power of
WebGL in 2D world
WebGL !== Super fast
Be careful, and
optimize your
particular app
WebGL !== Another
New “Magic”
Open the black box and
happy hacking!
Thank you
Q&A

More Related Content

PPTX
Beating canvas 2 d in its own territory webgl+tesspathy
PPTX
Dataflow Visualization using ASCII DAG
PDF
You Don't Know WebGL at GREE Tech Talk #08
PPTX
DevChatt: The Wonderful World Of Html5
PPTX
Cloud Study Jam Exploring the Cloud
PPTX
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArt
PDF
About OpenGL and Vulkan interoperability (XDC 2020)
PDF
Building Browser VR Experience in React VR
Beating canvas 2 d in its own territory webgl+tesspathy
Dataflow Visualization using ASCII DAG
You Don't Know WebGL at GREE Tech Talk #08
DevChatt: The Wonderful World Of Html5
Cloud Study Jam Exploring the Cloud
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArt
About OpenGL and Vulkan interoperability (XDC 2020)
Building Browser VR Experience in React VR

What's hot (20)

PPTX
Introduction to Serverless and Google Cloud Functions
PPTX
GWTcon 2015 - Best development practices for GWT web applications
PDF
Cloud Study Jam - 2019
PDF
How to improve gradle build speed
PDF
Quick Review of Desktop and Native Apps using Javascript
PPTX
Confoo - Javascript Server Side : How to start
PDF
Angry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLal
PDF
Best Practices - By Lofi Dewanto
PDF
Front end microservices - October 2019
PDF
Gradle build automation tool
PDF
Building the Web with Gradle
PPTX
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
PDF
Chromium Ozone
PDF
Gradle by Example
PDF
What's new in Gradle 4.0
PDF
Cloud Spin - building a photo booth with the Google Cloud Platform
PDF
Automatic image moderation in classifieds
PDF
Java2day 2013 : Modern workflows for javascript integration
PDF
Gradle presentation
PDF
Nuxeo World Session: GWT Integration
Introduction to Serverless and Google Cloud Functions
GWTcon 2015 - Best development practices for GWT web applications
Cloud Study Jam - 2019
How to improve gradle build speed
Quick Review of Desktop and Native Apps using Javascript
Confoo - Javascript Server Side : How to start
Angry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLal
Best Practices - By Lofi Dewanto
Front end microservices - October 2019
Gradle build automation tool
Building the Web with Gradle
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
Chromium Ozone
Gradle by Example
What's new in Gradle 4.0
Cloud Spin - building a photo booth with the Google Cloud Platform
Automatic image moderation in classifieds
Java2day 2013 : Modern workflows for javascript integration
Gradle presentation
Nuxeo World Session: GWT Integration
Ad

Similar to [GREE Tech Talk #08] You Don't Know WebGL (20)

PDF
GraphQL Bangkok Meetup 6.0
PPTX
Academy PRO: HTML5 API graphics
PDF
Build Your Blazing Fast Site with Gatsby and WordPress @ WordSesh by Muhammad...
PDF
High Performance Graphics - Introduction to WebGPU - Next Generation of High ...
KEY
WebGL Awesomeness
PDF
IntoWebGL - Unite Melbourne 2015
PDF
Cross-platform Desktop application with AngularJS and build with Node-webkit
PPTX
Deploy Your Website with GCP Workshop slides of GDG on Campus UNSTPB
PDF
GWT - Building Rich Internet Applications Using OO Tools
PDF
Портируем существующее Web-приложение в виртуальную реальность / Денис Радин ...
PPT
Introduction to Google Web Toolkit
PPT
WebGL: GPU acceleration for the open web
PDF
Migrating your Web app to Virtual Reality
PDF
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
PPT
GWT + Gears : The browser is the platform
PPTX
HTML5DevConf 2013 (October): WebGL is a game changer!
PDF
Decoupled Drupal and Gatsby in the Real World
PPTX
Réaliser un jeu cross plateformes avec WebGL et babylon.js
PDF
Leaving Flatland: Getting Started with WebGL- SXSW 2012
PDF
Drupal 3D - Intro to Using Web 3D with Drupal
GraphQL Bangkok Meetup 6.0
Academy PRO: HTML5 API graphics
Build Your Blazing Fast Site with Gatsby and WordPress @ WordSesh by Muhammad...
High Performance Graphics - Introduction to WebGPU - Next Generation of High ...
WebGL Awesomeness
IntoWebGL - Unite Melbourne 2015
Cross-platform Desktop application with AngularJS and build with Node-webkit
Deploy Your Website with GCP Workshop slides of GDG on Campus UNSTPB
GWT - Building Rich Internet Applications Using OO Tools
Портируем существующее Web-приложение в виртуальную реальность / Денис Радин ...
Introduction to Google Web Toolkit
WebGL: GPU acceleration for the open web
Migrating your Web app to Virtual Reality
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
GWT + Gears : The browser is the platform
HTML5DevConf 2013 (October): WebGL is a game changer!
Decoupled Drupal and Gatsby in the Real World
Réaliser un jeu cross plateformes avec WebGL et babylon.js
Leaving Flatland: Getting Started with WebGL- SXSW 2012
Drupal 3D - Intro to Using Web 3D with Drupal
Ad

More from gree_tech (20)

PPTX
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
PDF
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
PPTX
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
PPTX
アプリ起動時間高速化 ~推測するな、計測せよ~
PPTX
長寿なゲーム事業におけるアプリビルドの効率化
PPTX
Cloud Spanner をより便利にする運用支援ツールの紹介
PPTX
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
PPTX
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
PPTX
海外展開と負荷試験
PPTX
翻訳QAでのテスト自動化の取り組み
PPTX
組み込み開発のテストとゲーム開発のテストの違い
PPTX
サーバーフレームワークに潜んでる脆弱性検知ツール紹介
PPTX
データエンジニアとアナリストチーム兼務になった件について
PPTX
シェアドサービスとしてのデータテクノロジー
PPTX
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
PPTX
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
PPTX
比較サイトの検索改善(SPA から SSR に変換)
PPTX
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
PPTX
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
PPTX
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
アプリ起動時間高速化 ~推測するな、計測せよ~
長寿なゲーム事業におけるアプリビルドの効率化
Cloud Spanner をより便利にする運用支援ツールの紹介
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
海外展開と負荷試験
翻訳QAでのテスト自動化の取り組み
組み込み開発のテストとゲーム開発のテストの違い
サーバーフレームワークに潜んでる脆弱性検知ツール紹介
データエンジニアとアナリストチーム兼務になった件について
シェアドサービスとしてのデータテクノロジー
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
比較サイトの検索改善(SPA から SSR に変換)
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
MYSQL Presentation for SQL database connectivity
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Machine learning based COVID-19 study performance prediction
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
A Presentation on Artificial Intelligence
MYSQL Presentation for SQL database connectivity
“AI and Expert System Decision Support & Business Intelligence Systems”
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Monthly Chronicles - July 2025
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

[GREE Tech Talk #08] You Don't Know WebGL