lightingksuweb.kennesaw.edu/.../cgdd4003/slides/lighting.pdf · 2016-09-13 · here, per vertex...

20
LIGHTING

Upload: others

Post on 05-Apr-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

LIGHTING

Page 2: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

WHAT IS LIGHT?• A very complex process

• Find a dark area – how is it being lit?

• Light bounces (mirrors, shiny objects)

• Light refracts through other media (water, heat)

• Light comes from everywhere (Global Illumination)

• Light bounces off of lakes in weird ways (Fresnel effect)

• THUS

• We’re forced to make approximations

• Tradeoff between time and realism

• “If it looks good, it is good” – Michael Abrash

http://darrentakenaga.com/3d.html

http://en.wikipedia.org/wiki/File:Global_illumination.JPG

Page 3: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

TWO COMPONENTS

• Light Source Properties

• Color (Wavelength(s) of light)

• Shape

• Direction

• Object Properties

• Material

• Geometry

• Absorption

Page 4: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

GLOBAL EFFECTS

translucent surface

shadow

multiple reflection

Page 5: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

A BASIC LIGHTING CONCEPT• How can we determine how much light should be cast onto a triangle from a directional

light?

P2

P0

P1

Directional light - position doesn’t matter- triangle is almost fully lit

𝑁𝑁

5

Page 6: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

A BASIC LIGHTING CONCEPT• How can we determine how much light should be cast onto a triangle from a directional

light?

P2

P0

P1

(Triangle less lit)𝑁𝑁

6

Page 7: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

A BASIC LIGHTING CONCEPT• How can we determine how much light should be cast onto a triangle from a directional

light?

P2

P0

P1

(Little to no light hits the surface)

𝑁𝑁

7

Page 8: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

A BASIC LIGHTING CONCEPT• How can we determine how much light should be cast onto a triangle from a directional

light?

P2

P0

P1

(Directional light)𝑁𝑁

8

Page 9: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

A BASIC LIGHTING CONCEPT• How can we determine how much light should be cast onto a triangle from a directional

light?

P2

P0

P1

(Directional light)𝑁𝑁

𝐿𝐿

9

Page 10: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

BASIC LIGHTING• Four independent components:

• Diffuse – the way light “falls off” of an object

• Specular – the “shininess” of the object

• Ambient – a minimum amount of light used to simulate “global illumination”

• Emit – a “glowing” effect

Only diffuse

10

Page 11: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

BASIC LIGHTING• Four independent components:

• Diffuse – the way light “falls off” of an object

• Specular – the “shininess” of the object

• Ambient – a minimum amount of light used to simulate “global illumination”

• Emit – a “glowing” effect

Diffuse+Specular

11

Page 12: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

BASIC LIGHTING• Four independent components:

• Diffuse – the way light “falls off” of an object

• Specular – the “shininess” of the object

• Ambient – a minimum amount of light used to simulate “global illumination”

• Emit – a “glowing” effect

Ambient

Diffuse+Specular+Ambient

12

Page 13: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

BASIC LIGHTING• Four independent components:

• Diffuse – the way light “falls off” of an object

• Specular – the “shininess” of the object

• Ambient – a minimum amount of light used to simulate “global illumination”

• Emit – a “glowing” effect

D+S+A+Emit

Note: emit does not produce light!13

Page 14: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

LIGHT SOURCE DIRECTION

• In computer graphics, we usually treat lights as rays emanating from a source. The direction of these rays can either be:

• Omni-directional (point light source)

• Directional angle (spotlights)

• Directional (parallel rays)

Page 15: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

POINT LIGHTS• These lights have a position in 3D space

• Sometimes called a “Lamp”

• Light emanates from the light in all directions

• Distance d determines brightness (“attenuation”):

𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖 = 1/𝑑𝑑2

Here, per fragment lighting used15

Page 16: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

POINT LIGHTS• These lights have a position in 3D space

• Sometimes called a “Lamp”

• Light emanates from the light in all directions

• Distance d determines brightness (“attenuation”):

𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖 = 1/𝑑𝑑2

Here, per vertex lighting used16

Page 17: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

DIRECTIONAL LIGHTS• Are infinitely far away

• position in NO WAY matters

• Have only direction

• All objects are lit evenly

• Sometimes called a “Sun”

17

Page 18: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

SPOTLIGHTS• Point light source

• Conical in shape

18

Page 19: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

SPOTLIGHTS• Point light source

• Conical in shape

• Have:

• An inner and outer cone angle

• Umbra – areas that are fully in shadow

• Penumbra – areas that are in partial shadow

• Note: There’s an ambient light

JEFF CHASTINE 19

Page 20: Lightingksuweb.kennesaw.edu/.../CGDD4003/Slides/Lighting.pdf · 2016-09-13 · Here, per vertex lighting used. 16. DIRECTIONAL LIGHTS • Are infinitely far away • position in NO

AREA LIGHTS• A “surface” lights objects

• Has a position and direction

• Provides for a smoother drop off than point

• Larger surface == smoother shadows

• Expensive to calculate

20