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
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
130
Private APIの呼び出し方
kishikawakatsumi
2
800
外接に惑わされない自システムの処理時間SLIをOpenTelemetryで実現した話
kotaro7750
0
230
SODA - FACT BOOK(JP)
sodainc
1
9.4k
問題の見方を変える「システム思考」超入門
panda_program
0
180
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
140
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
5
370
HTTPじゃ遅すぎる! SwitchBotを自作ハブで動かして学ぶBLE通信
occhi
0
230
NIKKEI Tech Talk#38
cipepser
0
430
AI駆動開発カンファレンスAutumn2025 _AI駆動開発にはAI駆動品質保証
autifyhq
0
130
What’s Fair is FAIR: A Decentralised Future for WordPress Distribution
rmccue
0
140
CSC509 Lecture 09
javiergs
PRO
0
290
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8k
Balancing Empowerment & Direction
lara
5
730
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
Designing for humans not robots
tammielis
254
26k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6k
Side Projects
sachag
455
43k
Navigating Team Friction
lara
190
15k
Making Projects Easy
brettharned
120
6.4k
For a Future-Friendly Web
brad_frost
180
10k
GitHub's CSS Performance
jonrohan
1032
470k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Designing Experiences People Love
moore
142
24k
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