-
Notifications
You must be signed in to change notification settings - Fork 1
/
talk.tex
533 lines (453 loc) · 14.7 KB
/
talk.tex
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
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
%!TEX TS-program = pdflatex
%!TEX encoding = UTF-8 Unicode
% -*- coding: utf-8 -*-
\documentclass[10pt]{beamer}
%\usepackage[english]{babel}
%\usepackage[dvipdfmx]{movie15_dvipdfmx}
\usepackage{color}
\usepackage{tikz}
\usetikzlibrary{calc,arrows,shapes.multipart}
\usepackage{multicol}
\usepackage{listings}
%\usepackage{algpseudocode}
%\usepackage{algorithmic}
\definecolor{solarized@base03}{HTML}{002B36}
\definecolor{solarized@base02}{HTML}{073642}
\definecolor{solarized@base01}{HTML}{586e75}
\definecolor{solarized@base00}{HTML}{657b83}
\definecolor{solarized@base0}{HTML}{839496}
\definecolor{solarized@base1}{HTML}{93a1a1}
\definecolor{solarized@base2}{HTML}{EEE8D5}
\definecolor{solarized@base3}{HTML}{FDF6E3}
\definecolor{solarized@yellow}{HTML}{B58900}
\definecolor{solarized@orange}{HTML}{CB4B16}
\definecolor{solarized@red}{HTML}{DC322F}
\definecolor{solarized@magenta}{HTML}{D33682}
\definecolor{solarized@violet}{HTML}{6C71C4}
\definecolor{solarized@blue}{HTML}{268BD2}
\definecolor{solarized@cyan}{HTML}{2AA198}
\definecolor{solarized@green}{HTML}{859900}
\lstset {
language=python,
% upquote=true,
% columns=fixed, tabsize=4,
% extendedchars=true, breaklines=true,
% frame=tb,
% rulesepcolor=\color{solarized@base03},
% numberstyle=\tiny\color{solarized@base01},
basicstyle=\scriptsize\ttfamily,
keywordstyle=\color{solarized@green},
stringstyle=\color{solarized@cyan}\ttfamily,
identifierstyle=\color{solarized@blue},
commentstyle=\color{solarized@base01},
emphstyle=\color{solarized@red}
}
\definecolor{blendedblue}{rgb}{0.2, 0.2, 0.7}
%% % --- Font --------------------------------------------------------------------
%% \usepackage{fontspec}
%% \fontspec[Weight=1.0,Scale=1.0]{Gill Sans Light}
%% \setsansfont [
%% Mapping = tex-text,
%% Ligatures={Common},
%% Numbers=OldStyle,
%% Scale=.9,
%% BoldFont={Gill Sans},
%% ItalicFont={Gill Sans Light Italic}
%% ]{Gill Sans Light}
%% \setmainfont [
%% Mapping = tex-text,
%% Ligatures={Common},
%% Numbers=OldStyle,
%% BoldFont={Gill Sans},
%% ItalicFont={Gill Sans Light Italic}
%% ]{Gill Sans Light}
% --- Beamer theme ------------------------------------------------------------
\usetheme{Pittsburgh}
%\useoutertheme[footline=empty,subsection=false]{miniframes}
%% \useoutertheme[subsection=false]{miniframes}
\setbeamertemplate{navigation symbols}{} %no nav symbols
%% \setbeamercolor{section in head/foot}{use=normal text,bg=white}
%% \setbeamertemplate{section in head/foot shaded}[default][25]
%% \setbeamerfont{title}{family={\fontspec[Weight=0.5,Scale=1.25]{Gill Sans}}}
%% \setbeamerfont{subtitle}{family={\fontspec[Weight=0.5,Scale=1]{Gill Sans Light}}}
%% \setbeamerfont{frametitle}{family={\fontspec[Weight=1.0,Scale=1.1]{Gill Sans}}}
%% \setbeamerfont{framesubtitle}{family={\fontspec[Weight=0.5,Scale=1.]{Gill Sans Light}}}
% Docmument title, author, date and institution
% ---------------------------------------------
\title{Vispy\\
{\small A Modern and Interactive Visualization Framework}}
\author{Luke Campagnola, Almar Klein, Cyrille Rossant\\ \& {\bf Nicolas Rougier} (it's me)}
\date{EuroSciPy 2013\\
\includegraphics[width=0.15\textwidth]{vispy-logo}}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{}
\begin{block}{}
\begin{center}
Our goal is to create a {\bf interactive} visualization\\ software in
Python based on OpenGL/WebGL.\\
\vspace{2.5mm}
\includegraphics[height=4cm]{vispy}\\
\vspace{2.5mm}
We do not aim at replacing matplotlib.\\
We aim at living by its side.\\
\end{center}
\end{block}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{Python/OpenGL frameworks}
\begin{block}{Rendering framework}
\begin{multicols}{2}
\begin{itemize}
\item Pyglet\\
{\scriptsize \url{www.pyglet.org}}
\item PyOpenGL\\
{\scriptsize \url{pyopengl.sourceforge.net}}
\item Nodebox for OpenGL\\
{\scriptsize \url{www.cityinabottle.org/nodebox}}
\item PyProcessing\\
{\scriptsize \url{code.google.com/p/pyprocessing}}
\end{itemize}
\end{multicols}
\end{block}
\begin{block}{Visualization framework}
\begin{multicols}{2}
\begin{itemize}
\item mayavi 2 {\scriptsize (Enthought)}\\
{\scriptsize \url{github.com/enthought/mayavi}}
\item VTK {\scriptsize (Kitware)}\\
{\scriptsize \url{www.vtk.org}}
\item \textcolor{red}{galry {\scriptsize (Cyrille Rossant)}}\\
{\scriptsize \url{rossant.github.io/galry/}}
\item \textcolor{red}{visvis {\scriptsize (Almar Klein)}}\\
{\scriptsize \url{code.google.com/p/visvis/}}
\item \textcolor{red}{glumpy {\scriptsize (Nicolas Rougier)}}\\
{\scriptsize \url{code.google.com/p/glumpy/}}
\item \textcolor{red}{pyqtgraph {\scriptsize (Luke Campagnola)}}
{\scriptsize \url{www.pyqtgraph.org}}
\end{itemize}
\end{multicols}
\end{block}
%% \begin{columns}
%% \begin{column}{.45\textwidth}
%% \begin{block}{}
%% \end{block}
%% \end{column}
%% \begin{column}{.45\textwidth}
%% \end{column}
%% \end{columns}
%% \begin{itemize}
%% \item mayavi
%% \item pyglet
%% \item processings / pyprocessings
%% \item nodebox / nodebox OpenGL
%% \item glumpy
%% \item galry
%% \item visvis
%% \end{itemize}
%% \end{block}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{Graphic cards}
\framesubtitle{video-gaming industry is working for us !}
\begin{center}
\includegraphics[width=.75\textwidth]{cpu-vs-gpu.png}
\end{center}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{OpenGL history}
\framesubtitle{}
\input{opengl.tikz}
\vfill
\includegraphics[height=2cm]{doom.jpg}
\hfill
\includegraphics[height=2cm]{rage.jpg}\\
\small Doom (1993) \hfill Rage (2011)
% \vfill
% 2001: Final FantasyMovie, 90 minutes per frame using 900 CPUs\\
% 2013: 1 GPU, 1 CPU, real time
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{OpenGL ES 2.0 pipeline overview}
\framesubtitle{(\url{openglinsights.com})}
Around 350 constants and 150 functions.
\begin{center}
\includegraphics[width=1.0\textwidth]{GLES-Pipeline-2.png}
\end{center}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{OpenGL 4.2 pipeline overview}
\framesubtitle{(could have been worse...)}
Around 2000 constants and 1000 functions.
\begin{center}
\includegraphics[width=0.75\textwidth]{GL-Pipeline-4.png}
\end{center}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{Vispy pipeline overview}
\framesubtitle{Data centered}
% \begin{block}{}
\begin{center}
\includegraphics[width=1.0\textwidth]{vispy-pipeline}
\end{center}
% \end{block}
Critical parts are the {\bf baking} process and the {\bf transfer} to GPU memory.\\
% (using geometry shaders, we could deport (some) baking on the GPU).
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{Baking process}
\begin{block}{Ideal case: no baking}
\begin{columns}
\begin{column}{.50\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{glumpy.png}
\end{center}
\end{column}
\begin{column}{.40\textwidth}
Interpolation, colorization, leveling, gridding, scaling, lighting,
aliasing, rendering entirely done on GPU.
\end{column}
\end{columns}
\end{block}
\begin{block}{Hard case: baking depends on transformation}
\begin{columns}
\begin{column}{.50\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{transparency}
\end{center}
\end{column}
\begin{column}{.40\textwidth}
Transparency implies lot of CPU processing (sorting) or multi-pass
rendering.
\end{column}
\end{columns}
\end{block}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{Performances and Quality}
\framesubtitle{We do not have to (always) trade quality for speed}
\begin{block}{}
\begin{columns}
\begin{column}{.225\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{scatter-2}\\
\tiny 10,000 pts - 403 FPS
\end{center}
\end{column}
\begin{column}{.225\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{scatter-3}\\
\tiny 100,000 pts - 140 FPS
\end{center}
\end{column}
\begin{column}{.225\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{scatter-4}\\
\tiny 1,000,000 pts - 40 FPS
\end{center}
\end{column}
\begin{column}{.225\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{scatter-5}\\
\tiny 10,000,000 pts - 1.5 FPS
\end{center}
\end{column}
\end{columns}
\end{block}
\begin{block}{}
\begin{columns}
\begin{column}{.225\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{agg-circles-detail}\\
\tiny AntiGrain Geometry\\(matplotlib agg backend)
\end{center}
\end{column}
\begin{column}{.225\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{gl-circles-detail}\\
\tiny OpenGL AntiGrain\\(using dedicated shaders)
\end{center}
\end{column}
\begin{column}{.225\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{agg-lines-detail}\\
\tiny AntiGrain Geometry\\(matplotlib agg backend)
\end{center}
\end{column}
\begin{column}{.225\textwidth}
\begin{center}
\includegraphics[width=\textwidth]{gl-lines-detail}\\
\tiny OpenGL AntiGrain\\(using dedicated shaders)
\end{center}
\end{column}
\end{columns}
\end{block}
%% No need to render everything if you can't see it.
%% \begin{center}
%% \includegraphics[width=.75\textwidth]{lod}
%% \end{center}
%% \end{block}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{Architecture}
\begin{block}{Modules}
\begin{itemize}
\item app - Window \& events
\item gl - OpenGL ES 2.0 (emulation)
\item io - input/output
\item oogl - Object Oriented OpenGL
\item visual - Low-level interface
\item plot - High-level interface
\end{itemize}
\end{block}
\begin{block}{Backends}
\begin{itemize}
\item GLUT (historical, packaged with OpenGL)
\item Pyglet
\item PyQT
\item WebGL (not yet done)
\end{itemize}
\end{block}
\begin{block}{}
\end{block}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{Application Programming Interface}
\begin{columns}
\begin{column}{.45\textwidth}
\begin{block}{Raw GLUT}
\begin{lstlisting}[basicstyle=\tiny\ttfamily]
import sys
import OpenGL.GL as gl
import OpenGL.GLUT as glut
def display():
gl.glClear (gl.GL_COLOR_BUFFER_BIT
| gl.GL_DEPTH_BUFFER_BIT)
# draw something
glut.glutSwapBuffers()
glut.glutInit(sys.argv)
glut.glutInitDisplayMode(glut.GLUT_DOUBLE |
glut.GLUT_RGBA |
glut.GLUT_DEPTH)
glut.glutCreateWindow(sys.argv[0])
glut.glutDisplayFunc(display)
gl.glClearColor(1,1,1,1)
glut.glutMainLoop()
\end{lstlisting}
\end{block}
\end{column}
\begin{column}{.45\textwidth}
\begin{block}{Low-level (current)}
\begin{lstlisting}
from vispy import app
@app.connect
def on_paint(event):
# draw something
app.run()
\end{lstlisting}
\end{block}
\begin{block}{High-level (future)}
\begin{lstlisting}
import numpy as np
import vispy as vp
P = np.random.random((1000,3))
vp.scatter(P), vp.show()
\end{lstlisting}
\end{block}
\end{column}
\end{columns}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{Shaders}
\framesubtitle{What do they look like ?}
\begin{block}{Vertex shader}
\begin{lstlisting}
attribute vec3 position;
void main()
{
gl_Position = vec4(position,1.0);
}
\end{lstlisting}
\end{block}
\begin{block}{Fragment shader}
\begin{lstlisting}
uniform vec4 color;
void main()
{
gl_FragmentColor = color;
}
\end{lstlisting}
\end{block}
\end{frame}
% -----------------------------------------------------------------------------
%\begin{frame}
% \frametitle{Transformed data}
%\end{frame}
% -----------------------------------------------------------------------------
%\begin{frame}
% \frametitle{Rendered data}
%\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{Lot of problems ahead...}
\framesubtitle{...but work is in progress}
\begin{block}{Shader composition}
How to define a shader format that allow easy composition/templating ?
\end{block}
\begin{block}{Level of details}
How to set automatic level of details ?
\end{block}
\begin{block}{Very big data}
How to render data that doesn't even fit into GPU memory ?
\end{block}
\begin{block}{Complex data transformation}
How to handle user-supplied exotic transformation ?
\end{block}
\begin{block}{Supersampling or antialiasing ?}
Full 2D anti-aliasing possible, but unlikely for complex 3D scene.
\end{block}
\begin{block}{...}
\end{block}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}[T]
\begin{center}
\includegraphics[width=.65\textwidth]{Showtime.pdf}
\end{center}
\end{frame}
% -----------------------------------------------------------------------------
\begin{frame}
\frametitle{Informations}
\begin{block}{Project page}
\url{vispy.org}
\end{block}
\begin{block}{Code repository}
\url{github.com/vispy/vispy}
\end{block}
% \begin{block}{Wiki}
% \url{https://github.com/vispy/vispy/wiki}
% \end{block}
% \begin{block}{Mailing List}
% \url{https://groups.google.com/forum/?fromgroups\#!forum/vispy}
% \end{block}
\begin{block}{Sprint}
A sprint is organised on Sunday. Interested people are encouraged to come
to share ideas, comments, code, and even request features !
\end{block}
\end{frame}
\end{document}