Computer Graphics MTAT.03.015 Raimond Tunnel 2 / 50 The Road So - - PowerPoint PPT Presentation

computer graphics
SMART_READER_LITE
LIVE PREVIEW

Computer Graphics MTAT.03.015 Raimond Tunnel 2 / 50 The Road So - - PowerPoint PPT Presentation

Computer Graphics MTAT.03.015 Raimond Tunnel 2 / 50 The Road So Far... 3 / 50 Shadows 4 / 50 Shadows Three distinct parts of a shadow: 5 / 50 Shadows Three distinct parts of a shadow: Umbra full shadow 6 / 50 Shadows


slide-1
SLIDE 1

Computer Graphics

MTAT.03.015

Raimond Tunnel

slide-2
SLIDE 2

2 / 50

The Road So Far...

slide-3
SLIDE 3

3 / 50

Shadows

slide-4
SLIDE 4

4 / 50

Shadows

  • Three distinct parts of a shadow:
slide-5
SLIDE 5

5 / 50

Shadows

  • Three distinct parts of a shadow:
  • Umbra – full shadow
slide-6
SLIDE 6

6 / 50

Shadows

  • Three distinct parts of a shadow:
  • Umbra – full shadow
  • Penumbra – half shadow
slide-7
SLIDE 7

7 / 50

Shadows

  • Three distinct parts of a shadow:
  • Umbra – full shadow
  • Penumbra – half shadow
  • Antumbra – after shadow
slide-8
SLIDE 8

8 / 50

Shadows

  • Three distinct parts of a shadow:
  • Umbra – full shadow
  • Penumbra – half shadow
  • Antumbra – after shadow

What happens with point or directional light sources?

slide-9
SLIDE 9

9 / 50

Global Shadows

  • With path or ray tracing, shoot rays to points on

the light source.

slide-10
SLIDE 10

10 / 50

Global Shadows

  • With path or ray tracing, shoot rays to points on

the light source.

  • If some of the rays do not hit the light source,

the point is in a shadow (rays hit an occlusion).

slide-11
SLIDE 11

11 / 50

Shadow Mapping

  • Goal is the same: find an occluder between a

surface point and the light source.

slide-12
SLIDE 12

12 / 50

Shadow Mapping

  • Goal is the same: find an occluder between a

surface point and the light source.

  • Render the depth buffer from the light source.
slide-13
SLIDE 13

13 / 50

Shadow Mapping

  • Goal is the same: find an occluder between a

surface point and the light source.

  • Render the depth buffer from the light source.
  • For each fragment in

the main rendering consider the depth to the light source.

slide-14
SLIDE 14

14 / 50

Shadow Mapping

  • Goal is the same: find an occluder between a

surface point and the light source.

  • Render the depth buffer from the light source.
  • For each fragment in the main rendering

consider the depth to the light source.

  • How to find a depth to the light source?

Will distance work?

slide-15
SLIDE 15

15 / 50

Shadow Mapping

  • Goal is the same: find an occluder between a

surface point and the light source.

  • Render the depth buffer from the light source.
  • For each fragment in the main rendering

consider the depth to the light source.

  • How to find a depth to the light source?
  • What happens if it is larger then the closest

depth seen from the light source?

slide-16
SLIDE 16

16 / 50

Shadow Mapping: Directional Light

slide-17
SLIDE 17

17 / 50

Shadow Mapping: Point Light

What problems do you see here?

slide-18
SLIDE 18

18 / 50

Shadow Mapping

  • See the example in CGLearn
slide-19
SLIDE 19

19 / 50

Shadow Volume

  • We create a volume (mesh) around the shadow
  • f each object.
slide-20
SLIDE 20

20 / 50

Shadow Volume

  • We create a volume (mesh) around the shadow
  • f each object.
  • When rendering, we count the number of times,

we enter a volume, minus the number of times we exit a volume, to get to a fragment.

slide-21
SLIDE 21

21 / 50

Shadow Volume

  • We create a volume (mesh) around the shadow
  • f each object.
  • When rendering, we count the number of times,

we enter a volume, minus the number of times we exit a volume, to get to a fragment.

  • Multiple ways to use this info:
  • Depth pass – counts from front

Shadow volume faces between the object and the camera

slide-22
SLIDE 22

22 / 50

Shadow Volume

  • We create a volume (mesh) around the shadow
  • f each object.
  • When rendering, we count the number of times,

we enter a volume, minus the number of times we exit a volume, to get to a fragment.

  • Multiple ways to use this info:
  • Depth pass – counts from front

Shadow volume faces between the object and the camera

  • Depth fail – counts from back (Carmack's reverse)

Shadow volume faces after the object to infinity

slide-23
SLIDE 23

23 / 50

Shadow Volume

  • We create a volume (mesh) around the shadow
  • f each object.
  • When rendering, we count the number of times,

we enter a volume, minus the number of times we exit a volume, to get to a fragment.

  • Multiple ways to use this info:
  • Depth pass – counts from front

Shadow volume faces between the object and the camera

  • Depth fail – counts from back (Carmack's reverse)

Shadow volume faces after the object to infinity

  • When count is 0, object is lit.
slide-24
SLIDE 24

24 / 50

Shadow Volume

  • Find the silhouette of the object.

1.

slide-25
SLIDE 25

25 / 50

Shadow Volume

  • Find the silhouette of the object.
  • How to find those edges?

1.

slide-26
SLIDE 26

26 / 50

Shadow Volume

  • Copy the vertices and extrude the copy to

infinity from the light source.

2.

slide-27
SLIDE 27

27 / 50

Shadow Volume

  • Copy the vertices and extrude the copy to

infinity from the light source.

  • Assigning 0 as the fourth coordinate, results in

a point projected to infinity.

Works like a laser...

2.

slide-28
SLIDE 28

28 / 50

Shadow Volume

  • Create caps and sides of

the shadow volume.

3.

slide-29
SLIDE 29

29 / 50

Shadow Volume

  • Create caps and sides of

the shadow volume.

  • In order for the far plane

not to clip the volume, send the far plane to infinity.

lim

far→∞ P={

1 ar⋅tan(α) 1 tan(α) −1 −2 ⋅near −1 0 }

3.

slide-30
SLIDE 30

30 / 50

Shadow Volume

  • Depth-pass – count the front facing shadow

planes minus the back facing shadow planes in front of the object.

One of those has a problem.

4.

slide-31
SLIDE 31

31 / 50

Shadow Volume

  • Depth-fail – count the front facing

shadow planes minus the back facing shadow planes behind the object.

4.

slide-32
SLIDE 32

32 / 50

Conclusion

  • Coordinate Systems
  • Left / Right Handed
  • Triangles
  • Planar
  • Polygons
  • Convex / Concave
  • Simple
slide-33
SLIDE 33

33 / 50

Conclusion

  • Convex Combination
  • Barycentric Coordinates
  • Points and Vectors
slide-34
SLIDE 34

34 / 50

Conclusion

  • Standard Graphics Pipeline
  • Application code
  • GPU steps
slide-35
SLIDE 35

35 / 50

Conclusion

  • Linear Transformations
  • Rotation
  • Scale
  • Shear
  • Affine Transformations
  • Translation
  • Homogeneous

Coordinates

(

ax a y)

(

1 tan(ϕ) 1)

(

1 tan(ϕ) 1 )

(

cos(α) −sin(α) sin(α) cos(α))

(

1 xt 1 yt 1)

(x , y , z ,w)=(

x w , y w , z w)

slide-36
SLIDE 36

36 / 50

Conclusion

  • Augmented Transformation Matrix

(

a b c xt d e f yt g h i zt 1) ⋅( x y z 1) =( ax+ by+ cz+ xt dx+ ey+ fz+ yt gx+ hy+ iz+ zt 1

)

Used for perspective projection... Translation column Linear transformations

Affine trasnformation

slide-37
SLIDE 37

37 / 50

Conclusion

  • Projection
  • Orthographic
  • Oblique
  • Perspective
slide-38
SLIDE 38

38 / 50

Conclusion

  • Frames of Reference
  • Object Space
  • World Space
  • View Space
  • Clip Space
  • Normalized Device Space
  • Screen Space
slide-39
SLIDE 39

39 / 50

Conclusion

  • Shading Models
  • Flat
  • Gouraud
  • Phong
  • Lighting Models
  • Single color
  • Lambert
  • Phong
  • Blinn-Phong
  • sRGB Color Space and Gamma
slide-40
SLIDE 40

40 / 50

Conclusion

  • Textures
  • UV Mapping
  • Mipmap
  • Interpolation

– Upscale – Downscale

  • Anisotropy
slide-41
SLIDE 41

41 / 50

Conclusion

  • Blending
  • Alpha

– Conventional – Premultiplied

  • General Blending Function

– Alpha Blending – Additive – Multiplicative

blend (src ,dst)=(src⋅srcFactor) function(dst⋅dstFactor)

Multiplicative blending example in World Remade by Jaanus Jaggo http://forums.tigsource.com/index.php ?topic=41334.0

slide-42
SLIDE 42

42 / 50

Conclusion

  • Asset Pipeline
  • Code vs Design vs Art
  • Vertical Slice
  • Game Engine
  • Runtime
  • Tools
  • Layered Architecture
  • Drivers, OS, Resource Manager, Middleware, SDK

Image by Ats Kurvet and Timo Kallaste

slide-43
SLIDE 43

43 / 50

Conclusion

  • Curves
  • Interpolating vs Approximating
  • Smoothness and .
  • Construction with constraints
  • Hermite
  • Catmull-Rom
  • Bezier

C

n

G

n

slide-44
SLIDE 44

44 / 50

Conclusion

  • Procedural Generation
  • Noise

– Value noise – Gradient noise (Perlin)

  • Lindenmayer Systems
  • Particle Systems

– Boids

slide-45
SLIDE 45

45 / 50

Conclusion

  • Ray Casting
  • Ray-Triangle Intersection
  • Ray Tracing
  • Ray Trace Rendering
  • Data Structures
  • Octree
  • K-D Tree
  • Binary Space Partitioning
  • Bounding Volume Hierarcy
slide-46
SLIDE 46

46 / 50

Conclusion

  • Global Illumination
  • Path Tracing
  • Photon Mapping
  • Radiosity
  • The Rendering Equation

Lemit(x ,ωo)+∫

Ω

f brdf (x ,ωi ,ωo) ⋅Li(x ,ωi) ⋅ (ωi⋅n)d ωi

slide-47
SLIDE 47

47 / 50

Conclusion

  • Shadows
  • Global Illumination Shadows
  • Shadow Mapping
  • Shadow Volume
  • Umbra, penumbra, antumbra
slide-48
SLIDE 48

48 / 50

Conclusion

  • Conclusion
  • Coordinate System Handedness
  • Polygons

– Convex and Concave – Simple

  • Triangles

– Planar

  • Barycentric coordinates
  • ...
slide-49
SLIDE 49

49 / 50

Computer Graphics

Thanks for the ride!

The End

slide-50
SLIDE 50

50 / 50

What knowledge did you gain today? What more would you like to know?

Next time: Your open mic lecture!

If you can not present your project in the projects presentation.