Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Let’s talk WebGL
Search
Tomek Kopczuk
March 05, 2018
Programming
1
26
Let’s talk WebGL
Introduction to game development and three.js with Tomek Kopczuk, SwingDev’s CTO
Tomek Kopczuk
March 05, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
170
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
910
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
CSC307 Lecture 04
javiergs
PRO
0
660
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
500
MUSUBIXとは
nahisaho
0
130
「ブロックテーマでは再現できない」は本当か?
inc2734
0
480
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
230
CSC307 Lecture 08
javiergs
PRO
0
670
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
Featured
See All Featured
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
49
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
64
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Why Our Code Smells
bkeepers
PRO
340
58k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
100
Transcript
www.swing3d.io Let’s talk WebGL Introduction to game development and three.js
with Tomek Kopczuk, SwingDev’s CTO
Game Development is different • Render loop • Only 16ms
per frame • Soft Real Time System
16ms to rule them all • Actual drawing • Collisions
• Physics • Animations • AI • I/O
So - WebGL • OpenGL ES for <canvas> • Transcends
way beyond 3D!
Programmable Pipeline Vertex Buffer Objects Primitive Processing Vertex Shader Primitive
Assembly Rasterizer Fragment Shader Depth Stencil Color Buffer Blend Dither Frame Buffer API Triangles/Lines/Points Vertices How does stuff get drawn?
How does stuff get drawn? VBO Vertex Shader Rasterization Fragment
Shader
three.js - introduction • After today we’re going to be
able to do this
three.js - introduction • Scene • Camera • Renderer
three.js - cameras and projections • Orthographic • Perspective
Camera Demo
three.js - introduction • Geometry • Material • Object3D •
Light • Mesh
three.js - common geometries • BoxGeometry • CircleGeometry • ConeGeometry
• CylinderGeometry • PlaneGeometry • SphereGeometry
Demo 1 - bootstrap, skybox, ground
three.js - common materials • MeshBasicMaterial • MeshLambertMaterial • MeshPhongMaterial
• MeshPhysicalMaterial • MeshStandardMaterial • MeshToonMaterial • RawShaderMaterial
Demo 2 - cube and materials
three.js - shaders • Vertex shader • Fragment shader Vertex
Shader Uniforms Fragment Shader Frame Buffer Vertex Buffer Objects Varyings Attributes input input input output points to input
three.js - vertex shader uniform mat4 projectionMatrix; uniform mat4 modelViewMatrix;
void main () { gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }
three.js - fragment shader void main () { gl_FragColor =
vec4(0.5, 0.5, 0.5, 1.0); }
Demo 3 - cube with a shader
three.js - shaders - useful?
Demo 4 - cube with a dynamic shader
three.js - loading real assets • Group • OBJ Loader
• Texture Loader
Demo 5 - turret
three.js - loading real assets • Geometry • MeshStandardMaterial •
map • normalMap • aoMap • roughnessMap • metalnessMap • envMap • ModelView matrix
three.js - adding user interaction • Asynchronous to the render
loop • Raycasting
Demo 6 - moving turrets
Further reading • https://threejs.org/docs/index.html#manual/introduction/Creating- a-scene • https://threejs.org/examples/ • https://www.khronos.org/webgl/ •
https://www.opengl.org/sdk/tools/ShaderDesigner/
Thank you