lighting csis 5838: graphics and animation for gaming

11
Lighting CSIS 5838: Graphics and Animation for Gaming

Upload: amber-knight

Post on 20-Jan-2016

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lighting CSIS 5838: Graphics and Animation for Gaming

Lighting

CSIS 5838: Graphics and Animation for Gaming

Page 2: Lighting CSIS 5838: Graphics and Animation for Gaming

Terminology

• ϴL: Incident light angle to point on surface

• ϴV: Incident viewing angle to point on surface• K: Intensity of light source

Surface in image

Focal point of cameraLight source(intensity I)

Image plane

ϴLϴV

Page 3: Lighting CSIS 5838: Graphics and Animation for Gaming

Reflected Light

• Amount of light received by surface proportional to K cos(ϴL) Light source

Light concentrated in smallest area at ϴL = 90°

Light more “spread out” at smaller ϴL

Page 4: Lighting CSIS 5838: Graphics and Animation for Gaming

Shape from Shading

• Brain reverses this process, interpolating shape from shading across surface– No variation in lighting flat surface– Slow variation in lighting curved surface– Sharp variation in lighting corners

Page 5: Lighting CSIS 5838: Graphics and Animation for Gaming

Smooth Shading

• Can create illusion that non-curved surface is curved– More efficient than adding large number of vertices

• Interpolate curve through series of edges– Often done with Bezier curves (built into Blender)

• Render image based on interpolated curves, not actual surface

Page 6: Lighting CSIS 5838: Graphics and Animation for Gaming

Diffuse Reflection

• Portion of light “scattered” from surface, reflecting in all directions ϴV

Surface in image

Focal point of cameraLight sourceImage

plane

ϴLϴV

Page 7: Lighting CSIS 5838: Graphics and Animation for Gaming

Specular Reflection

• Portion of light directly reflected from surface, only visible if ϴV = ϴL (Snell’s law)

Surface in image

Not visibleLight source

ϴL

ϴV

visible

Page 8: Lighting CSIS 5838: Graphics and Animation for Gaming

Specular Reflection in Blender

• “Hardness” parameter defines additional angles at which specular light visible

• Light intensity function of |ϴL - ϴv|/hardness

ϴL - ϴV

Intensity

Hardness = 20

Hardness = 2

Page 9: Lighting CSIS 5838: Graphics and Animation for Gaming

Lambertian Model

• Assumption: Amount of light reflected in direction ϴV = K cos(ϴV)– Most light reflected

normal to surface– Less light reflected

parallel to surface

Page 10: Lighting CSIS 5838: Graphics and Animation for Gaming

Lambertian Model

• Amount of surface projected to camera inversely proportional to ϴV

• = 1/cos(ϴV) Light source

Smallest surface at ϴv = 90°

More surface at smaller ϴV

Page 11: Lighting CSIS 5838: Graphics and Animation for Gaming

Lambertian Model

• Amount of light received by camera =K cos(ϴV) * 1/cos(ϴV)

• Lambertian assumption: Amount of light percieved independent of viewing direction– Simplest to compute– Close to being true for many surfaces (moon)