Geekovo Minimum Nadpis 1 Nadpis 2 Počítačové Grafiky Nadpis 3 Jméno AdamPříjmení Herout VysokéVysoké učení technické učení technické v Brně,vFakulta Brně, Fakulta informačních informačních technologií technologií v Brně Božetěchova 2, 612 66 Brno
[email protected] [email protected]
http://herout.net 99.99.2008 15.10.2011
Počítač ~ Procesor ~ Tranzistor
# ?? barcamp: Geekovo minimum počítačové grafiky
2
Tranzistory: CPU × GPU Intel • 1993 – Pentium – 3.1 Mt • 1997 – Pentium II – 7.5 Mt • 1999 – Pentium III – 24 Mt • 2000 – Pentium IV – 42-169 Mt
• • • • •
2004 – Prescott – 125 Mt 2005 – Pentium D – 206 Mt 2006 – Intel Core 2 Duo – 291 Mt 2010 – Qd-Cr Itanium Tukwila – 2 Gt 2011 – 10-Core Xeon – 2,6 Gt
NVidia
• • • • • •
1998 – RIVA TNT – 7 Mt 1999 – TNT2 – 15 Mt 2000 – GeForce 2 – 25 Mt 2001 – GeForce 3 – 57 Mt 2002 – GeForce 4 – 63 Mt 2003 – GeForce FX – 130 Mt
• 2005 – G70 – 302 Mt • 2006 – nVidia G8800 GTX – 680 Mt • 2010 – GF100 – 3 Gt
PGR - Počítačová grafika / Organizace
3
Hrubá síla: GFLOPs/sec
barcamp: Geekovo minimum počítačové grafiky
4
2D nebo 3D?
barcamp: Geekovo minimum počítačové grafiky
5
2D nebo 3D?
barcamp: Geekovo minimum počítačové grafiky
6
2D nebo 3D?
barcamp: Geekovo minimum počítačové grafiky
7
Sprites
barcamp: Geekovo minimum počítačové grafiky
8
Viditelnost: Malířův algoritmus
barcamp: Geekovo minimum počítačové grafiky
9
Viditelnost: Malířův algoritmus
barcamp: Geekovo minimum počítačové grafiky
10
Viditelnost: Malířův algoritmus
barcamp: Geekovo minimum počítačové grafiky
11
2D nebo 3D?
barcamp: Geekovo minimum počítačové grafiky
12
2D nebo 3D?
barcamp: Geekovo minimum počítačové grafiky
13
Síť trojúhelníků!
• Trojúhelník popsán: … barcamp: Geekovo minimum počítačové grafiky
14
Projekce: Perspektivní
𝒙′ = 𝑴𝒙
𝑎11 𝑥′ 𝑎21 𝑦′ = 𝑎 31 0 𝑎41 𝑤′
𝑎12 𝑎22 𝑎32 𝑎42
𝑎13 𝑎23 𝑎33 𝑎43
𝑎14 𝑎24 𝑎34 𝑎44
𝑥 𝑦 𝑧 1
barcamp: Geekovo minimum počítačové grafiky
15
Display je RASTROVÝ 8bitů grayscale 24bitů RGB 32bitů RGBA 16bitů RGB
• ----> Rasterizace barcamp: Geekovo minimum počítačové grafiky
16
Rasterizace: Trojúhelník
barcamp: Geekovo minimum počítačové grafiky
17
Rasterizace: Trojúhelník – Řádkovým algoritmem
barcamp: Geekovo minimum počítačové grafiky
18
Rasterizace: Trojúhelník – Řádkovým algoritmem
barcamp: Geekovo minimum počítačové grafiky
19
Rasterizace trojúhelníka: Interpolace hodnot
• • • •
Barvy Texturovacích souřadnic Hodnot osvětlení Atd. atd. - cokoliv
barcamp: Geekovo minimum počítačové grafiky
20
Rasterizace trojúhelníka: Texturování
barcamp: Geekovo minimum počítačové grafiky
21
Síť trojúhelníků!
• Jenže: viditelnost? barcamp: Geekovo minimum počítačové grafiky
22
Viditelnost: Paměť hloubky
barcamp: Geekovo minimum počítačové grafiky
23
Viditelnost: Paměť hloubky 8bitů grayscale 24bitů RGB 32bitů RGBA 16bitů RGB
24+48 bitů - RGBD
Framebuffer
barcamp: Geekovo minimum počítačové grafiky
24
Vykreslovací řetězec Per-Vertex Op 𝑎11 𝑥′ 𝑎 𝑦′ 21 = 𝑎 31 𝑧′ 𝑎41 𝑤′
𝑎12 𝑎22 𝑎32 𝑎42
𝑎13 𝑎23 𝑎33 𝑎43
𝑎14 𝑎24 𝑎34 𝑎44
Primitive Assembly
𝑥 𝑦 𝑧 1
Raster ization
Per-Pixel Op
Framebuffer
barcamp: Geekovo minimum počítačové grafiky
25
Programovatelný vykreslovací řetězec Vertex Shader 𝑎11 𝑥′ 𝑎 𝑦′ 21 = 𝑎 31 𝑧′ 𝑎41 𝑤′
𝑎12 𝑎22 𝑎32 𝑎42
𝑎13 𝑎23 𝑎33 𝑎43
?
𝑎14 𝑎24 𝑎34 𝑎44
?
Primitive Assembly
𝑥 𝑦 𝑧 1
Raster ization
Pixel Shader
Framebuffer
barcamp: Geekovo minimum počítačové grafiky
26
OpenGL × Direct3D
Vertex Shader 𝑎11 𝑥′ 𝑎21 𝑦′ = 𝑎 31 𝑧′ 𝑎 41 𝑤′
𝑎12 𝑎22 𝑎32 𝑎42
?
𝑎13 𝑎23 𝑎33 𝑎43
𝑎14 𝑎24 𝑎34 𝑎44
?
Primitive Assembly 𝑥 𝑦 𝑧 1
Raster ization
Pixel Shader
Framebuffer
barcamp: Geekovo minimum počítačové grafiky
27
Struktura GPU (GeForce 6600 – cca 2004)
barcamp: Geekovo minimum počítačové grafiky
28
Vertex Op. × Pixel Op.
𝑃 =5×𝑉
𝑃 = 1000 × 𝑉
barcamp: Geekovo minimum počítačové grafiky
29
Struktura GPU (GTX 280 – cca 2008)
barcamp: Geekovo minimum počítačové grafiky
30
Struktura GPU (GTX 560Ti – cca 2010)
barcamp: Geekovo minimum počítačové grafiky
31
GPU × CPU
Vertex Shader 𝑎11 𝑥′ 𝑎 𝑦′ 21 = 𝑎 31 𝑧′ 𝑎41 𝑤′
𝑎12 𝑎22 𝑎32 𝑎42
?
𝑎13 𝑎23 𝑎33 𝑎43
𝑎14 𝑎24 𝑎34 𝑎44
?
Primitive Assembly 𝑥 𝑦 𝑧 1
Raster ization
Pixel Shader
Framebuffer barcamp: Geekovo minimum počítačové grafiky
32
Hrubá síla: GFLOPs/sec
barcamp: Geekovo minimum počítačové grafiky
33
CUDA × OpenCL × DirectCompute
DirectCompute
barcamp: Geekovo minimum počítačové grafiky
34
Vertex Op. × Pixel Op.
𝑃 = 0.1 × 𝑉 𝑃 = 1000 × 𝑉
𝑃 =5×𝑉
barcamp: Geekovo minimum počítačové grafiky
35
Point-Based Graphics
barcamp: Geekovo minimum počítačové grafiky
36
Suma sumárum
5.
4.
1. 3. 2.
Vertex Shader 𝑎11 𝑥′ 𝑎21 𝑦′ = 𝑎 31 𝑧′ 𝑎 41 𝑤′
𝑎12 𝑎22 𝑎32 𝑎42
?
𝑎13 𝑎23 𝑎33 𝑎43
𝑎14 𝑎24 𝑎34 𝑎44
?
Primitive Assembly 𝑥 𝑦 𝑧 1
Raster ization
Pixel Shader
Framebuffer
barcamp: Geekovo minimum počítačové grafiky
37
Děkuji za pozornost! http://herout.net
barcamp: Geekovo minimum počítačové grafiky
38