Game Rendering -...
Transcript of Game Rendering -...
![Page 1: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/1.jpg)
Ken-Yi Lee
Game Programming, Fall 2020 @ National Taiwan University
Game Rendering
![Page 3: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/3.jpg)
3
Game Rendering
● 3D or 2D ?
![Page 4: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/4.jpg)
4
Game Rendering
● 3D or 2D ?
● Realistic ?
○ Photorealistic rendering
■ Physically-based rendering
https://en.wikipedia.org/wiki/Unbiased_rendering
![Page 5: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/5.jpg)
5
Game Rendering
● 3D or 2D ?
● Realistic ?
○ Photorealistic rendering
■ Physically-based rendering
○ Non-photorealistic rendering
https://en.wikipedia.org/wiki/Non-photorealistic_rendering
![Page 6: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/6.jpg)
6
Game Rendering
● 3D or 2D ?
● Realistic ?
○ Photorealistic rendering
■ Physically-based rendering
○ Non-photorealistic rendering
● Real-time ?
○ Performance, performance, and performance
![Page 7: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/7.jpg)
Unreal Paris 2020 on Steamhttps://store.steampowered.com/app/1280890/Unreal_Paris_2020/
![Page 8: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/8.jpg)
Unreal Paris 2020 on Steamhttps://store.steampowered.com/app/1280890/Unreal_Paris_2020/
![Page 9: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/9.jpg)
Unreal Paris 2020 on Steamhttps://store.steampowered.com/app/1280890/Unreal_Paris_2020/
![Page 10: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/10.jpg)
Ray tracing
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 10
![Page 11: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/11.jpg)
Model
11
http://3drender.com/jbirn/hippo/hairyhipponose.html
Mesh
● Vertices
○ Positions, Normals, UVs, ...
● Faces
○ Triangles or Quads ?
![Page 12: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/12.jpg)
12
CPU, RAM, GPU, VRAM, Disk, ...
Graphics hardware
Hardware
![Page 13: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/13.jpg)
13
CPU, RAM, GPU, VRAM, Disk, ...
Graphics hardware
Hardware
![Page 14: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/14.jpg)
14
Windows, Android, iOS, Linux, macOS, Orbis, ..OS
CPU, RAM, GPU, VRAM, Disk, ...
Graphics hardware
Hardware
![Page 15: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/15.jpg)
15
Windows, Android, iOS, Linux, macOS, Orbis, ..OS
CPU, RAM, GPU, VRAM, Disk, ...
3D Graphics API OpenGL, Direct3D, Vulkan, Metal, ...
Graphics hardware
Hardware
![Page 16: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/16.jpg)
16
Windows, Android, iOS, Linux, macOS, Orbis, ..OS
CPU, RAM, GPU, VRAM, Disk, ...
Game Engine
3D Graphics API OpenGL, Direct3D, Vulkan, Metal, ...
Unity, Unreal, Cocos2d-x, Godot, ...
Graphics hardware
Hardware
![Page 17: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/17.jpg)
Model
17
http://3drender.com/jbirn/hippo/hairyhipponose.html
Mesh
● Vertices
○ Positions, Normals, UVs, ...
● Faces
○ Triangles (hardware)
○ Quads (artist)
![Page 18: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/18.jpg)
Mesh Filter / Mesh Renderer
18
![Page 19: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/19.jpg)
"How many vertices / faces can we use ? "
19https://www.zbrushcentral.com/t/headshot-series/360990
![Page 20: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/20.jpg)
Mesh simplification
20
https://vgc.poly.edu/~csilva/papers/siggraph-asia2008.pdf
![Page 21: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/21.jpg)
Ray tracing
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 21
![Page 22: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/22.jpg)
Ray-triangle intersection
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 22
![Page 23: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/23.jpg)
Ray-triangle intersection (cont'd)
23
![Page 24: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/24.jpg)
Ray-triangle intersection (cont'd)
24
![Page 25: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/25.jpg)
Space-partitioning data structures
25
![Page 26: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/26.jpg)
Case study: NVIDIA RTXTM Platform
26
https://developer.nvidia.com/rtx
![Page 27: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/27.jpg)
Case study: DXR (DirectX Raytracing)
27
![Page 29: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/29.jpg)
Ray Tracing with HDRP
29https://docs.unity3d.com/Packages/[email protected]/manual/Ray-Tracing-Getting-Started.html
![Page 30: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/30.jpg)
Ray tracing
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 30
![Page 31: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/31.jpg)
31
Material
![Page 32: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/32.jpg)
32
Material
10
?
f (ωi, ωr)
![Page 33: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/33.jpg)
33
Material
?
10
f (ωr, ωi)
![Page 34: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/34.jpg)
34
Material (cont'd)
http://collagefactory.blogspot.com/2010/04/brdf-for-diffuseglossyspecular.html
![Page 35: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/35.jpg)
x
35
Material (cont'd) BSSRDF (Bidirectional scattering distribution function)
http://collagefactory.blogspot.com/2010/04/brdf-for-diffuseglossyspecular.html
f BSSRDF (x, ωi, ωr)
![Page 36: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/36.jpg)
x
36
Material (cont'd) BSSRDF (Bidirectional scattering distribution function)
https://en.wikipedia.org/wiki/Subsurface_scattering
http://collagefactory.blogspot.com/2010/04/brdf-for-diffuseglossyspecular.html
f BSSRDF (x, ωi, ωr)
![Page 37: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/37.jpg)
37
Material (cont'd)
http://collagefactory.blogspot.com/2010/04/brdf-for-diffuseglossyspecular.html
BSDF (Bidirectional scattering distribution function) =
BTDF(Bidirectional transmittance distribution function)BRDF(Bidirectional reflectance distribution function) +
f BRDF (ωi, ωr) f BTDF (ωi, ωr)
![Page 38: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/38.jpg)
38
BRDF (Bidirectional reflectance distribution function)
https://en.wikipedia.org/wiki/Bidirectional_reflectance_distribution_function
![Page 39: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/39.jpg)
39
BRDF (Bidirectional reflectance distribution function)
![Page 40: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/40.jpg)
BRDF (Bidirectional reflectance distribution function)
40
![Page 41: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/41.jpg)
BRDF (Bidirectional reflectance distribution function)
41
Emissive ?
![Page 42: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/42.jpg)
BRDF (Bidirectional reflectance distribution function)
42
Symmetric ?
![Page 43: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/43.jpg)
BRDF (Bidirectional reflectance distribution function)
43
![Page 44: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/44.jpg)
44
BRDF (Bidirectional reflectance distribution function)
● Different Normals
![Page 45: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/45.jpg)
45
BRDF (Bidirectional reflectance distribution function)
● Different Normals
![Page 46: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/46.jpg)
BRDF (Bidirectional reflectance distribution function)
46
![Page 47: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/47.jpg)
47
BRDF Measurement
https://graphics.stanford.edu/projects/gantry/
![Page 48: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/48.jpg)
48
BRDF Measurement
https://graphics.stanford.edu/projects/gantry/
![Page 49: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/49.jpg)
49
BRDF Measurement
https://graphics.stanford.edu/projects/gantry/https://www.merl.com/brdf/
![Page 50: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/50.jpg)
50
Analytic BRDF (Bidirectional reflectance distribution function)
http://resources.mpi-inf.mpg.de/departments/d4/teaching/ws200708/cg/slides/CG07-Brdf+Texture.pdf
![Page 51: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/51.jpg)
51
http://resources.mpi-inf.mpg.de/departments/d4/teaching/ws200708/cg/slides/CG07-Brdf+Texture.pdf
Analytic BRDF (Bidirectional reflectance distribution function)
= fD( 0.8 ) + fM( 2 ) + fG( 0.1 )
![Page 52: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/52.jpg)
52
http://resources.mpi-inf.mpg.de/departments/d4/teaching/ws200708/cg/slides/CG07-Brdf+Texture.pdf
Analytic BRDF (Bidirectional reflectance distribution function)
= fD( 0.8 ) + fM( 2 ) + fG( 0.1 )
![Page 53: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/53.jpg)
53
http://resources.mpi-inf.mpg.de/departments/d4/teaching/ws200708/cg/slides/CG07-Brdf+Texture.pdf
Analytic BRDF (Bidirectional reflectance distribution function)
= fD( 0.8 ) + fM( 2 ) + fG( 0.1 )
![Page 54: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/54.jpg)
I Ambient(ka) + I Diffuse(kd) + I Specular(ks) = I
54
Phong illumination model
![Page 55: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/55.jpg)
55
Disney Principled BRDF
https://blog.selfshadow.com/publications/s2012-shading-course/burley/s2012_pbs_disney_brdf_notes_v3.pdf
https://github.com/wdas/brdf/blob/main/src/brdfs/disney.brdf
Github :
![Page 56: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/56.jpg)
Ray tracing
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 56
![Page 57: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/57.jpg)
57
Material
![Page 58: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/58.jpg)
58
Material
Use Shader (a program) to calculate the result
Given :● Light● View● Normal● BRDF parameters● Position● ...
![Page 59: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/59.jpg)
Material (cont'd)
59
All triangles/quads have the same Material ?
All triangles/quads have the same BRDF ?
![Page 60: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/60.jpg)
Texture
60
![Page 61: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/61.jpg)
Texture
61
![Page 62: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/62.jpg)
Texture
62
u
v
![Page 63: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/63.jpg)
Material
63
![Page 64: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/64.jpg)
Case Study: Concept Art
64
![Page 65: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/65.jpg)
65
ShaderGiven :● Light● View● Normal● BRDF parameters● Position● UVs● Textures ● ...
![Page 66: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/66.jpg)
66
Windows, Android, iOS, Linux, macOS, Orbis, ..OS
CPU, RAM, GPU, VRAM, Disk, ...
Game Engine
3D Graphics API OpenGL, Direct3D, Vulkan, Metal, ...
Unity, Unreal, Cocos2d-x, Godot, ...
Graphics hardware
Hardware
![Page 67: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/67.jpg)
Writing shaders
67
![Page 68: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/68.jpg)
Shader Graph
68https://blogs.unity3d.com/2018/02/27/introduction-to-shader-graph-build-your-shaders-with-a-visual-editor/
![Page 69: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/69.jpg)
69
ShaderConsiders :● Light● View● Normal● BRDF● Position● UVs● Textures ● ...
![Page 70: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/70.jpg)
Point light
70
![Page 71: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/71.jpg)
Point light / Directional light
71
![Page 72: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/72.jpg)
Spot light
72
![Page 73: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/73.jpg)
Area light ?
73
![Page 74: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/74.jpg)
Lots of point lights ? integral ?
74
![Page 75: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/75.jpg)
Point light
75
![Page 76: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/76.jpg)
Directional light
76
![Page 77: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/77.jpg)
Spot light
77
![Page 78: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/78.jpg)
Area light
78
![Page 79: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/79.jpg)
Shadow ?
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 79
![Page 80: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/80.jpg)
Shadow ?
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 80
shadow rays
![Page 81: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/81.jpg)
Shadow ?
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 81
?
![Page 82: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/82.jpg)
Shadow ?
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 82
?
shadow rays ?
![Page 84: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/84.jpg)
Direct illumination
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 84
Number of lights
Hard / Soft shadows (Light type)
![Page 85: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/85.jpg)
Indirect illumination
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 85
![Page 86: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/86.jpg)
86
Direct vs. indirect illumination
Direct + Indirect = Final
![Page 87: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/87.jpg)
Global illumination = Indirect illumination
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 87
![Page 88: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/88.jpg)
Global illumination = Indirect illumination
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 88
Lots of ray intersection tests
We'll talk about this later.
![Page 89: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/89.jpg)
Camera ?
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 89
![Page 90: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/90.jpg)
Camera
● Anti-aliasing
● Depth of field
● Auto exposure
● White balance
● Color adjustments
● Lens distortion
● Grain
90
● Motion blur
● HDR (High-dynamic-range)
○ Bloom
○ Tonemapping
● ...
![Page 91: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/91.jpg)
Anti-aliasing
91
![Page 92: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/92.jpg)
Anti-aliasing (cont'd)
92
1) Supersampling: casting multiple rays/samples in a pixel
https://en.wikipedia.org/wiki/Fast_approximate_anti-aliasing
https://en.wikipedia.org/wiki/Supersampling
![Page 93: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/93.jpg)
Anti-aliasing (cont'd)
93
1) Supersampling: casting multiple rays/samples in a pixel
2) Approximation: smoothing undesirable jagged edges
https://en.wikipedia.org/wiki/Fast_approximate_anti-aliasing
![Page 94: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/94.jpg)
Depth of Field
94https://en.wikipedia.org/wiki/File:Dof_blocks_f4_0.jpg
1) Lots of rays/samples
2) Approximation
![Page 95: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/95.jpg)
Depth of Field (cont'd)
95https://www.nintendo.com/games/detail/octopath-traveler-switch/
![Page 96: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/96.jpg)
Bloom
96https://en.wikipedia.org/wiki/Bloom_(shader_effect)
![Page 97: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/97.jpg)
Post Processing (before)
97https://docs.unity3d.com/Manual/PostProcessingOverview.html
![Page 98: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/98.jpg)
Post Processing (after)
98https://docs.unity3d.com/Manual/PostProcessingOverview.html
![Page 99: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/99.jpg)
99
Post Processing (package for Built-in RP)
![Page 100: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/100.jpg)
Ray tracing
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 100
![Page 101: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/101.jpg)
Global illumination = Indirect illumination
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 101
Lots of ray intersection tests
![Page 102: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/102.jpg)
Global illumination = Indirect illumination
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 102
hardware acceleration ?
Lots of ray intersection tests
![Page 103: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/103.jpg)
Global illumination = Indirect illumination
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 103
hardware acceleration ?
Challenge: divergence of ray paths
Lots of ray intersection tests
![Page 104: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/104.jpg)
Direct illumination
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 104
hardware acceleration ?
Lots of ray intersection tests
![Page 105: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/105.jpg)
Direct illumination
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 105
hardware acceleration ?
GPU & VRAM
Lots of ray intersection tests
![Page 106: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/106.jpg)
Case study: NVIDIA RTXTM Platform
106
https://developer.nvidia.com/rtx
![Page 107: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/107.jpg)
Case study: NVIDIA RTXTM Platform
107
https://developer.nvidia.com/rtx
![Page 108: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/108.jpg)
Rasterization
108
![Page 109: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/109.jpg)
Rasterization (cont'd)
109
![Page 110: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/110.jpg)
Rasterization (cont'd)
110
![Page 111: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/111.jpg)
Rasterization (cont'd)
111
![Page 112: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/112.jpg)
3D Graphics Rendering Pipeline
112
![Page 113: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/113.jpg)
3D Graphics Rendering Pipeline
113
Which triangle/mesh needs to be drawn first ?
![Page 114: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/114.jpg)
Painter's algorithm
114
https://en.wikipedia.org/wiki/Painter%27s_algorithm
![Page 115: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/115.jpg)
Painter's algorithm
115
https://en.wikipedia.org/wiki/Painter%27s_algorithm
Far Near
![Page 116: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/116.jpg)
Painter's algorithm (cont'd)
116
https://en.wikipedia.org/wiki/Painter%27s_algorithm
Far Near
? ?
![Page 117: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/117.jpg)
Z (Depth)-buffering
117
https://www.racketboy.com/retro/about-video-games-rasterization-and-z-buffer
![Page 118: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/118.jpg)
3D Graphics Rendering Pipeline
118
Are all triangles visible ?
![Page 119: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/119.jpg)
Culling
119http://people.csail.mit.edu/fredo/PUBLI/surveyTVCG.pdf
![Page 120: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/120.jpg)
● Yes, Unity applies frustum culling to every renderer.
○ But, you can also use the CullingGroup API
View-frustum culling
120
![Page 121: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/121.jpg)
Occlusion culling
121
![Page 122: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/122.jpg)
3D Graphics Rendering Pipeline
122
Are all triangles opaque ?
![Page 123: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/123.jpg)
Transparency ?
123
http://cs248.stanford.edu/winter19/lecture/pipeline/slide_055
● Fog● Particles● Visual effects● ...
![Page 124: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/124.jpg)
Transparency ?
124
http://cs248.stanford.edu/winter19/lecture/pipeline/slide_055
Opaque
Transparent
Depth Buffer
![Page 125: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/125.jpg)
Transparency ?
125
http://cs248.stanford.edu/winter19/lecture/pipeline/slide_055
Opaque
Transparent
Depth Buffer
Does the order of transparent objects matter ?
![Page 126: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/126.jpg)
Render Queue
126
![Page 127: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/127.jpg)
127
DEVOTIONhttps://shop.redcandlegames.com/#game
How many draw calls are requied ?
![Page 128: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/128.jpg)
Draw call
128
Needs to have The same rendering order and material
![Page 129: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/129.jpg)
Frame debugger
129https://docs.unity3d.com/Manual/FrameDebugger.html
![Page 130: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/130.jpg)
Frame debugger
130
https://docs.unity3d.com/Manual/FrameDebugger.html
![Page 132: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/132.jpg)
132
Unity render pipeline stages
![Page 133: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/133.jpg)
Rasterization vs. Ray tracing
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 133
![Page 134: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/134.jpg)
Hard / soft shadows ?
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 134
![Page 135: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/135.jpg)
Indirect illumination ?
https://en.wikipedia.org/wiki/Ray_tracing_(graphics)#/media/File:Ray_trace_diagram.svg 135
![Page 136: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/136.jpg)
136
Shadow and global illumination
● Shadow
○ Shadow mapping, ambient occlusions (post-processing)
● Lightmap
○ Baked indirect lighting (static objects)
○ Baked ambient occlusions
● Light Probes
○ Baked indirect lighting (dynamic objects)
● Reflection Probes
![Page 137: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/137.jpg)
How about 2D / GUI ?
137https://docs.unity3d.com/Manual/Sprites.html
![Page 138: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/138.jpg)
How about 2D / GUI ?
138https://docs.unity3d.com/Manual/Sprites.html
AABB (Axis-Aligned Bounding Box)
Rectangle ?
![Page 139: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/139.jpg)
How about 2D / GUI ?
139https://docs.unity3d.com/Manual/Sprites.html
AABB (Axis-Aligned Bounding Box)
Rectangle ?
Drawing order: painter's algorithm ?
![Page 140: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/140.jpg)
How about 2D / GUI ?
140https://docs.unity3d.com/Manual/Sprites.html
AABB (Axis-Aligned Bounding Box)
Rectangle ?
Drawing order: painter's algorithm ?
Opaque vs. Transparent
![Page 141: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/141.jpg)
How about 2D / GUI ? (cont'd)
141
![Page 142: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/142.jpg)
Draw call
142
Needs to have The same rendering order and material
![Page 143: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/143.jpg)
Sprite Atlas
143
Pack as many textures as possible ?
![Page 144: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/144.jpg)
Q & A
144
![Page 145: Game Rendering - 國立臺灣大學graphics.im.ntu.edu.tw/~robin/courses/game20/ppt/game20_08ren.pdfKen-Yi Lee Game Programming, Fall 2020 @ National Taiwan University Game Rendering](https://reader036.fdocuments.net/reader036/viewer/2022081621/6124f86a582e193d8c28d2a7/html5/thumbnails/145.jpg)
Deferred shading vs. Forward shading
145