Seminar LIGHTING MODELS What is a light? Types of light - - PowerPoint PPT Presentation

seminar
SMART_READER_LITE
LIVE PREVIEW

Seminar LIGHTING MODELS What is a light? Types of light - - PowerPoint PPT Presentation

Computer Graphics Seminar LIGHTING MODELS What is a light? Types of light Illumination models Shading models What is a light? Illumination models Shading models Lighting models What is a light? Delta Lights


slide-1
SLIDE 1

Computer Graphics

Seminar

LIGHTING MODELS

slide-2
SLIDE 2

What is a light? Types of light Illumination models Shading models

slide-3
SLIDE 3

What is a light? Illumination models Shading models Lighting models

slide-4
SLIDE 4

What is a light?

slide-5
SLIDE 5

Delta Lights

Light entities with no physical size Used because simulating area lights was

for a very long time too expensive

today should be avoided as much as

possible

slide-6
SLIDE 6

What is a light? Types of light Illumination models Shading models

slide-7
SLIDE 7

Types of light

Directional light Point light Spotlight

slide-8
SLIDE 8

Directional light

slide-9
SLIDE 9

Point Light

slide-10
SLIDE 10

Point light VS Spotlight

slide-11
SLIDE 11

Spotlight

slide-12
SLIDE 12

What is a light? Types of lights Illumination models Shading models

slide-13
SLIDE 13

Illumination Models

Global Illumination = Ambient Light + Diffuse Light + Specular Light + Emissive Light

slide-14
SLIDE 14

The emissive ligthing

  • Each polygon is self-luminous

(it lights itself, but does not give off light)

  • There are no lights in the scene
  • Each polygon has its own colour which is constant

Over its surface That color is not affected by anything else in the world position of viewer is not important

slide-15
SLIDE 15

Calculating Emissive Term

emissive = Ke

where: Ke is the material's emissive color.

slide-16
SLIDE 16

The Ambient Term

Ambient light does not appear to come from any particular direction, rather it appears to come from all directions, because

  • f this it does not depend on light source position.
slide-17
SLIDE 17

Calculating Ambient Term

ambient = Ka x globalAmbient Where :

Ka is the material's ambient colour

globalAmbient is the color of the incoming ambient light.

slide-18
SLIDE 18

Diffuse Term

comes from a specific direction

slide-19
SLIDE 19

Diffuse Term

The diffuse term accounts for directed light reflected off a surface equally in all directions.

slide-20
SLIDE 20

The Diffuse Term

diffuse = Kd x lightColor x max(N · L, 0) Kd is the material's diffuse color lightColor is the color of the incoming diffuse light N is the normalized surface normal P is the point being shaded.

L is the normalized vector toward the light source

slide-21
SLIDE 21

The Specular Term

Rendering the specular term Light is reflected from the surface in mirror direction brightness depends on theta - angle between surface normal (N) and the direction to the light source

slide-22
SLIDE 22

The specular Term

slide-23
SLIDE 23

Specular Term

slide-24
SLIDE 24

Adding The terms together

slide-25
SLIDE 25

Ambient+Diffuse+Specular

slide-26
SLIDE 26

Material Properties Demo

diffuse color -how the material reflects light diffusely specular color –how material reflects light specularly

http://math.hws.edu/graphicsbook/c4/s1

.html

slide-27
SLIDE 27

Different Lighting Models

slide-28
SLIDE 28

Phong Lighting Model

slide-29
SLIDE 29

Phong Ligthing model

slide-30
SLIDE 30

Blinn-Phong Lighting Model

Another, a bit more realistic, lighting model is the Blinn- Phong model that calculates the specular term somewhat differently.

slide-31
SLIDE 31

Blinn phong VS phong

slide-32
SLIDE 32

real-world photograph

slide-33
SLIDE 33

What is a light? Types of light Illumination models Shading models

slide-34
SLIDE 34

What is shading?

slide-35
SLIDE 35

Shading models

There are three main shading models that are used for different result. Flat Shading Gouraud Shading (per vertex) Phong Shading (per fragment)

slide-36
SLIDE 36

Three main shading models

slide-37
SLIDE 37

3D mesh

Consists of: Vertices, edges that form faces, Face normals - orthogonal to the face. Normals + light source we determine Colour of the face.

slide-38
SLIDE 38

Flat Shading (per polygon)

 It defines a single color for a face.  main idea is that we use only one surface normal per polygon  The color itself is uniform (unchanging) on that polygon.

slide-39
SLIDE 39

Flat shading

is in screen space ⊕ easiest to implement, really fast ⊖ ugly results, only good results if mesh resolution is such that one face corresponds to one pixel on the screen, this breaks down when zooming in.

slide-40
SLIDE 40

Example of Flat Shading Model

slide-41
SLIDE 41

Linear interpolation

slide-42
SLIDE 42
slide-43
SLIDE 43
slide-44
SLIDE 44
slide-45
SLIDE 45

Positive and Negative sides of Gouraud Shading

  • is in screen space

⊕ pretty efficient and not too hard to implement, nice shading on medium to high mesh resolution ⊖ looks bad on low mesh resolution, has perspective distortion, which can also be noticed on rotation of the object or if you change the triangle shapes. ⊖ if the light source is specular and focused on a very small area, Gouraud Shading might not render it correctly (if it doesn’t hit and illuminate a vertex, but only hits a face or an edge of the mesh)

slide-46
SLIDE 46

Example of Gouraud Shading

slide-47
SLIDE 47

Phong shading

slide-48
SLIDE 48
slide-49
SLIDE 49

Results of Phong Shading

⊕ great shading of round and smooth objects at any mesh resolution ⊖ can’t change the mesh contour ⊖ is more challenging to implement and takes longer to compute than the other two algorithms ⊖ always assumes a smooth basic shape, i.e. if the object we want to display has sharp edges that should actually be sharp (e.g. if we try to render a cube), it will make the edges look somewhat round instead of shading the faces in different light.

slide-50
SLIDE 50

Example of Phong Shading

http://multivis.net/lecture/phong.html

slide-51
SLIDE 51

If the object resolution is higher

slide-52
SLIDE 52

Fog

Fog makes objects that are further away look less distinct than near objects

slide-53
SLIDE 53

Why is fog shading needed ?

slide-54
SLIDE 54

The monster sees a much softer horizon

slide-55
SLIDE 55

Thank you !

slide-56
SLIDE 56
slide-57
SLIDE 57
slide-58
SLIDE 58
slide-59
SLIDE 59
slide-60
SLIDE 60
slide-61
SLIDE 61
slide-62
SLIDE 62
slide-63
SLIDE 63
slide-64
SLIDE 64
slide-65
SLIDE 65
slide-66
SLIDE 66
slide-67
SLIDE 67
slide-68
SLIDE 68
slide-69
SLIDE 69
slide-70
SLIDE 70
slide-71
SLIDE 71
slide-72
SLIDE 72
slide-73
SLIDE 73
slide-74
SLIDE 74
slide-75
SLIDE 75
slide-76
SLIDE 76
slide-77
SLIDE 77
slide-78
SLIDE 78
slide-79
SLIDE 79
slide-80
SLIDE 80
slide-81
SLIDE 81
slide-82
SLIDE 82
slide-83
SLIDE 83
slide-84
SLIDE 84
slide-85
SLIDE 85
slide-86
SLIDE 86
slide-87
SLIDE 87
slide-88
SLIDE 88
slide-89
SLIDE 89
slide-90
SLIDE 90
slide-91
SLIDE 91
slide-92
SLIDE 92
slide-93
SLIDE 93
slide-94
SLIDE 94
slide-95
SLIDE 95
slide-96
SLIDE 96
slide-97
SLIDE 97
slide-98
SLIDE 98
slide-99
SLIDE 99
slide-100
SLIDE 100
slide-101
SLIDE 101
slide-102
SLIDE 102
slide-103
SLIDE 103
slide-104
SLIDE 104
slide-105
SLIDE 105
slide-106
SLIDE 106
slide-107
SLIDE 107
slide-108
SLIDE 108
slide-109
SLIDE 109
slide-110
SLIDE 110
slide-111
SLIDE 111
slide-112
SLIDE 112
slide-113
SLIDE 113
slide-114
SLIDE 114
slide-115
SLIDE 115
slide-116
SLIDE 116
slide-117
SLIDE 117
slide-118
SLIDE 118
slide-119
SLIDE 119
slide-120
SLIDE 120
slide-121
SLIDE 121
slide-122
SLIDE 122
slide-123
SLIDE 123
slide-124
SLIDE 124
slide-125
SLIDE 125