-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpresentation.js
More file actions
446 lines (419 loc) · 15.7 KB
/
presentation.js
File metadata and controls
446 lines (419 loc) · 15.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
import React, { Component } from 'react'
import {
Appear,
BlockQuote,
Code,
Deck,
Heading,
Image,
List,
ListItem,
Quote,
S,
Slide,
Text
} from 'spectacle'
import createTheme from 'spectacle/lib/themes/default'
import './presentation.css'
import { HelloThree } from './slides/hello-three/hello-three'
import { Instances } from './slides/instances/Instances'
import { Kpv } from './slides/kpv/kpv'
require('normalize.css')
const theme = createTheme(
{
primary: 'white',
secondary: '#1F2022',
tertiary: '#03A9FC',
quaternary: '#CECECE'
},
{
primary: 'Montserrat',
secondary: 'Helvetica'
}
)
export default class Presentation extends Component {
render() {
return (
<Deck transition={['fade']} transitionDuration={500} theme={theme}>
<Slide transition={['fade']} bgColor="primary">
<Heading fit size={1} lineHeight={1} bold textColor="tertiary">
Web Graphics
</Heading>
<Heading fit size={1} lineHeight={1} textColor="secondary">
Programming
</Heading>
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Heading size={1} lineHeight={1} bold textColor="tertiary">
Plan
</Heading>
<List>
<ListItem>Who am I?</ListItem>
<ListItem>What is "Web Graphics Programming"?</ListItem>
<ListItem>What is three.js?</ListItem>
<ListItem>Why should you care?</ListItem>
</List>
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Heading size={1} lineHeight={1} bold textColor="tertiary">
Alec McEachran
</Heading>
<Text size={1} lineHeight={1} bold textColor="secondary">
@alecmce • alecmce.com
</Text>
<Appear>
<List>
<ListItem>
Self-taught coder <em className="tertiary-text small-text"> 1978-</em>
</ListItem>
</List>
</Appear>
<Appear>
<List>
<ListItem>
Maths & Philosophy Teacher{' '}
<em className="tertiary-text small-text"> 2004-8</em>
</ListItem>
<ListItem>
Flash<em className="tertiary-text">|</em>Web<em className="tertiary-text">|</em>
Unity Developer <em className="tertiary-text small-text"> 2008-2013</em>
</ListItem>
<ListItem>
Snr Software Engineer @ YouTube
<em className="tertiary-text small-text"> 2013-2016</em>
</ListItem>
<ListItem>
Snr Software Engineer @ Google
<em className="tertiary-text small-text"> 2016-2018</em>
</ListItem>
</List>
</Appear>
<Appear>
<List>
<ListItem>
Principal Developer @ KPV LAB <em className="tertiary-text small-text">2018-</em>
</ListItem>
</List>
</Appear>
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Kpv />
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Heading size={1} fit lineHeight={1} textColor="secondary">
Web Graphics
</Heading>
<Heading size={1} fit lineHeight={1} textColor="tertiary">
Programming
</Heading>
</Slide>
<Slide bgColor="primary">
<iframe
title="shader-toy"
width="640"
height="360"
frameborder="0"
src="https://www.shadertoy.com/embed/llVXRd?gui=false&t=0&paused=false&muted=true"
allowfullscreen
/>
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Image src="timeline.png" fit />
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Heading size={1} lineHeight={1} bold textColor="tertiary">
Adobe Flash
</Heading>
<Appear>
<List>
<ListItem>Macromedia buys FutureSplash 1996</ListItem>
<ListItem>Adobe buys Macromedia in 2005</ListItem>
</List>
</Appear>
<Appear>
<List>
<ListItem>2D Graphics IDE with ActionScript Timeline</ListItem>
<ListItem>Content runs in Flash Plugin</ListItem>
</List>
</Appear>
<Appear>
<List>
<ListItem>2010 Apple drop Flash on iOS</ListItem>
<ListItem>Adobe will drop Flash Player in 2020</ListItem>
</List>
</Appear>
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Image src="furbles.png" fit />
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Heading size={1} lineHeight={1} bold textColor="tertiary">
SVG & Canvas
</Heading>
<Appear>
<List>
<ListItem>W3C start to develop SVG in 1999</ListItem>
<ListItem>Major Browsers adopt SVG by 2006</ListItem>
</List>
</Appear>
<Appear>
<List>
<ListItem notes="proprietary tech">Apple introduces Canvas element</ListItem>
</List>
</Appear>
</Slide>
<Slide>
<iframe title="d3" width="640" height="360" frameborder="0" src="https://d3js.org/" />
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Heading size={1} lineHeight={1} bold textColor="tertiary">
WebGL
</Heading>
<Appear>
<List>
<ListItem>WebGL came out of Mozilla in 2006</ListItem>
<ListItem>
<em className="tertiary-text">Mozilla</em>, <em className="tertiary-text">Apple</em>
, <em className="tertiary-text">Google</em>,{' '}
<em className="tertiary-text">Opera</em> collaborate
</ListItem>
<ListItem>WebGL v.1.0 spec released in 2011</ListItem>
</List>
</Appear>
</Slide>
<Slide transition={['fade']} bgColor="primary" textColor="secondary">
<BlockQuote>
<Quote textColor="secondary" textSize="6vmin">
Graphics technologies have to trade-off <em className="tertiary-text">performance</em>{' '}
with
<br />
<em className="tertiary-text">ease-of-use</em>.
</Quote>
</BlockQuote>
</Slide>
<Slide transition={['fade']} bgColor="secondary" textColor="primary">
<BlockQuote>
<Quote textSize="6vmin">
<em className="tertiary-text">SVG</em> and <em className="tertiary-text">Canvas</em>{' '}
support limited <em className="tertiary-text">2D</em> graphics, but are reasonably{' '}
<em className="tertiary-text">easy</em> to use.
</Quote>
<br />
<Quote>
<em className="tertiary-text">WebGL</em> supports very powerful{' '}
<em className="tertiary-text">3D</em> graphics, but is{' '}
<em className="tertiary-text">hard</em> to use.
</Quote>
</BlockQuote>
</Slide>
<Slide bgColor="primary">
<iframe
title="google-maps"
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d778.7377249302808!2d-4.292347362556625!3d55.85274713196313!2m3!1f0!2f39.24003176711267!3f0!3m2!1i1024!2i768!4f35!3m3!1m2!1s0x4888467904a37135%3A0x8331231a4f6c7877!2sBBC+Scotland!5e1!3m2!1sen!2suk!4v1561748817984!5m2!1sen!2suk"
width="600"
height="450"
frameborder="0"
style={{ border: 0 }}
allowfullscreen
/>
</Slide>
<Slide>
<Heading size={1} lineHeight={1} bold textColor="tertiary">
CPUs and GPUs are different...
</Heading>
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Image src="cpu-city.png" fit />
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Image src="gpu-city.png" fit />
</Slide>
<Slide transition={['fade']} bgColor="secondary" textColor="primary">
<Text size={1} lineHeight={1} bold textColor="tertiary">
Web Graphics performance comes from the architecture of the GPU:
</Text>
<Appear>
<Text textColor="primary">
The GPU performs calculations in parallel, making it extremely fast.
</Text>
</Appear>
</Slide>
<Slide transition={['fade']} bgColor="secondary" textColor="primary">
<Text size={1} lineHeight={1} bold textColor="tertiary">
Web Graphics limitations comes from the architecture of the GPU, too:
</Text>
<Appear>
<Text textColor="primary">
Coding for parallel execution is complicated. You have to learn to think and code very
differently.
</Text>
</Appear>
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Instances />
<div className="in-front top-right">
<Appear>
<Text textColor="primary">1 cube</Text>
</Appear>
<Appear>
<Text textColor="primary">160k positions & colours</Text>
</Appear>
<Appear>
<Text textColor="primary">3D simplex noise</Text>
</Appear>
<Appear>
<Text textColor="primary">1.3m vertex calculations per frame</Text>
</Appear>
</div>
</Slide>
<Slide bgColor="tertiary">
<Code>{`// JavaScript\n`}</Code>
<Code>{`function getColor([r, g, b], scale) {\n`}</Code>
<Code>{` return scale > 0\n`}</Code>
<Code>{` ? [r, g, b]\n`}</Code>
<Code>{` : [r, b, g]\n`}</Code>
<Code>{`}`}</Code>
</Slide>
<Slide bgColor="tertiary">
<Code>{`// GLSL\n`}</Code>
<Code>{`float gt(float x, float y) {\n`}</Code>
<Code>{` return max(sign(x - y), 0.0);\n`}</Code>
<Code>{`}\n`}</Code>
<Code>{`\n`}</Code>
<Code>{`float lt(float x, float y) {\n`}</Code>
<Code>{` return max(sign(y - x), 0.0);\n`}</Code>
<Code>{`}\n`}</Code>
<Code>{`\n`}</Code>
<Code>{`vec3 getColor(vec3 rgb, float scale) {\n`}</Code>
<Code>{` return gt(scale, 0.0) * iCol.rbg +\n`}</Code>
<Code>{` lt(scale, 0.0) * iCol.rgb;\n`}</Code>
<Code>{`}\n`}</Code>
</Slide>
<Slide>
<Heading size={1} lineHeight={1} bold>
A quick introduction to <em className="secondary-text">three.js</em>
</Heading>
</Slide>
<Slide>
<Text size={1} lineHeight={1} bold>
three.js is a library that wraps a lot of the more complicated parts of working with
WebGL to make it easy to get started.
</Text>
</Slide>
<Slide>
<HelloThree />
</Slide>
<Slide bgColor="tertiary">
<Code textColor="primary">{`import {...} from 'three'`}</Code>
<br />
<Code>{`renderer = new WebGLRenderer()`}</Code>
<Code>{`camera = new PerspectiveCamera()`}</Code>
<Code>{`light = new PointLight()`}</Code>
<Code>{`geometry = new DodecahedronGeometry()`}</Code>
<Code>{`material = new MeshPhysicalMaterial()`}</Code>
<Code>{`box = new Mesh(geometry, material)`}</Code>
<Code>{`scene = new Scene()`}</Code>
<Code>{`scene.add(light)`}</Code>
<Code>{`scene.add(box)`}</Code>
<br />
<Code textColor="primary">{`renderer.render(scene, camera)`}</Code>
</Slide>
<Slide bgColor="primary">
<iframe
title="skin"
src="https://www.derschmale.com/lab/doodles/skinsss/build/"
allowfullscreen
/>
<div className="in-front top-right">
<Text textColor="secondary">
from <S type="underline">www.derschmale.com</S>
</Text>
</div>
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Heading size={1} lineHeight={1} fit bold textColor="secondary">
Speculation
</Heading>
<Text size={1} lineHeight={1} fit bold textColor="tertiary">
about the future of the web
</Text>
</Slide>
<Slide
transition={['fade']}
bgColor="secondary"
textColor="primary"
notes="Stadia, Timescale!"
>
<BlockQuote>
<Quote textSize="6vmin">
Eventually, <em className="tertiary-text">Compute</em> moves to{' '}
<em className="tertiary-text">The Cloud</em>.
</Quote>
</BlockQuote>
</Slide>
<Slide transition={['fade']}>
<Heading fit>Two main reasons:</Heading>
<List>
<ListItem>Economies of scale</ListItem>
<ListItem>Protection of intellectual property</ListItem>
</List>
<Appear>
<div>
<Text fit textColor="tertiary">
And it's starting to happen with graphics:
</Text>
<List>
<ListItem>Video - YouTube & Netflix</ListItem>
<ListItem>Gaming - Stadia & xCloud</ListItem>
</List>
</div>
</Appear>
</Slide>
<Slide transition={['fade']} backgroundColor="tertiary">
<Heading fit>A Cloud Rendered Web</Heading>
<List>
<ListItem>Would use less bandwidth than watching Netflix for a few hours</ListItem>
<ListItem>Would make your computers and phones cheaper</ListItem>
</List>
<List>
<ListItem>Would further commoditize the web</ListItem>
<ListItem>Would cede even more control to the Internet Giants</ListItem>
</List>
</Slide>
<Slide transition={['fade']} bgColor="secondary" textColor="primary">
<BlockQuote>
<Quote textSize="6vmin">
In a future with a Cloud Rendered Web,
<em className="tertiary-text"> there would be no technical constraints </em>
on integrating video, text, and interactivity.
</Quote>
</BlockQuote>
</Slide>
<Slide transition={['fade']} bgColor="secondary" textColor="primary">
<BlockQuote>
<Quote textSize="6vmin">
In a future with a Cloud Rendered Web,{' '}
<em className="tertiary-text">
perhaps it's worth knowing something about GPU programming.
</em>
</Quote>
</BlockQuote>
</Slide>
<Slide transition={['fade']} bgColor="primary">
<Heading size={1} lineHeight={2} bold textColor="secondary">
Q/A
</Heading>
<Text textColor="tertiary" bold>
Alec McEachran
</Text>
<Text textColor="secondary">
follow me on twitter <em className="tertiary-text">@alecmce</em>
</Text>
<Text textColor="secondary">
work with me <em className="tertiary-text">www.kpv-lab.co.uk/jobs</em>
</Text>
</Slide>
</Deck>
)
}
}