You are on page 1of 19

Lights and Lighting

Digital Lighting and Rendering CGT 340


Lighting is 5% of light setup and 95% of revisions i i and d adjustments. dj Jeremy Birn
Bedrich Benes, bbenes@purdue.edu Bedrich Benes, bbenes@purdue.edu

Lecture overview
9 9 9 9 9 What is light? Spectrum T i l cases Typical Metamers CG lights

Light
Light electromagnetic radiation between ~ 400 nm and ~ 700 nm

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Light Sources
Light source can be characterized by its emission spectrum or spectral characteristic graph of intensity of emission at different wavelengths

Light Sources
9 the daylight emission spectrum 9 it can be measured
intensity [W]

400
Bedrich Benes, bbenes@purdue.edu Bedrich Benes, bbenes@purdue.edu

500

600

700

wavelength [nm]

Light Sources
9 Light g source 9 important special cases of light sources
intensity [W]

Light Sources
9 achromatic is usually perceived as white or gray
9 increasing/decreasing g g the intensity y of the achromatic light we get brighter/darker gray

intensity [W]

9 monochromatic (includes one chroma) is usually perceived as a pure color


400 500 600 700 wavelength [nm]

400

500

600

700

wavelength [nm]

9 achromatic light 9 lat. chroma = color


Bedrich Benes, bbenes@purdue.edu

monochromatic light

9 the only intensity is the d i dominant t wavelength l th or dominant d i tf frequency 9 examples are a laser beam, a sodium bulb

Bedrich Benes, bbenes@purdue.edu

Light Sources and Color


Will two different spectra be perceived as two different colors? Always?

Metamers
9 Two lights with different spectra that are perceived as the same color are called metamers. metamers 9 Why? Wh ? 9 Convolution of the emission spectra over the eye light sensitivity for short, medium, and long cones gives the same numbers.

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Color matching experiment


9 change intensity of the three lights 9 get the same color as of the source 9 let l t th the th three li lights ht be called A, B, and C 9 they are called primaries
Bedrich Benes, bbenes@purdue.edu

Light in Computer Graphics


L M S

9 the three components


Diff Diffuse light li ht Specular light Ambient light

Bedrich Benes, bbenes@purdue.edu

Light in Computer Graphics


9 Diffuse ~ color 9 Specular ~ reflections, highlights 9 Ambient A bi t ~ i indirect di t ill illumination, i ti multiple reflections 9 This comes from reflections and it characterizes the material more than lights

Types of light sources


9 Based on the way they shine:
9 Ambient light 9 Point light 9 Spot light 9 Directional light g 9 Area light 9 Volume light

9 Lets meet them p personally y


Bedrich Benes, bbenes@purdue.edu Bedrich Benes, bbenes@purdue.edu

Ambient Light
9 Why not to use it?
9 does not depend on any angle 9 is a flattered fill of a color 9 the best is turn it OFF 9 but we do need the indirect illumination illumination 9 use fill lights, but dim them

Ambient Light one light

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Ambient Light - ambient

Ambient Light - directional

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Ambient [0 [0, 0 0.25, 25 0 0.5, 5 1 1.0] 0]

Ambient Light
9 Maya 9 Attribute Ambient Shade=0 -> > behaves as ambient Ambient Shade=1 -> behaves as point

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Point Light Source


9 Also called omni, omni omnidirectional 9 Does not exist in reality 9 Mathematical M th ti l abstraction b t ti 9 Like a light bulb in the middle of a room 9 The fastest light source to calculate

Point Light Source

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Point Light Source


9 Trick in Maya
9 set negative intensity 9 behaves like a negative negative light light

Spot Light
9 The most commonly used 9 Probably the most powerful light source 9 The Th b best t controlled t ll d li light ht 9 It is a point light that is aimed somewhere 9 It has its: g , cone, , penumbra p angle, g , etc. target,

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Spot Light
9 Reflector 9 Point light with more parameters 9 Positioning
9 press object pick (T) to put and situate

Spot Light - positioning


9 Select light 9 Panel-> Look through selected

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Spot Light - positioning


9 Aiming to an object 9 Panel -> View -> Look at Selection

Spot Light Light- cone angle 40o

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Spot Light Light- cone angle 70o

Spot Light Light- penumbra angle 20o

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Spot Light Light- drop drop-off off 140

Spot Light color as a file

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Spot Light color as a file

Throw
9 Cookies and gobos 9 cookie cucoloris 9 gobo b go-between b t objects between lights and the occluder 9 Venetian blinds, fan on ceiling etc. y a model 9 Can be done by 9 Easier by a light map
Wikipedia

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Throw

Spot light mapping intensity


9 I=f(d) I f(d) 9 Can be mapped manually 9 The Graph Editor 9 Window -> Animation Editors -> Graph editor 9 Select the spotlight 9 In the Light Effect option select Intensity Curves 9 Use the middle key to move the points

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Spot light mapping intensity

Spot light mapping intensity

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Spot Light making a soft shadow


9 9 9 9 DLR 2nd edition page 22 Aim multiple lights so they overlap D Decrease th the penumbra b angle l It is not a shadow! But it looks cool

Directional Light
9 Depends only on an angle 9 Translation does not make any sense 9 Represents distant light sources 9 Point in infinity (vector) 9 All rays are parallel 9 Fast F t to t calculate l l t 9 Can project images
Bedrich Benes, bbenes@purdue.edu

Digital Lighting and rendering 2nd edition J.Birn


Bedrich Benes, bbenes@purdue.edu

Directional Light

Area Light
9 spherical light good when close to an object g distance ~ p point for large 9 flat area disc, rectangle g faster to calculate good for lamps, etc 9 linear light fluorescent tube

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Area Light
9 Rectangular (in Maya) 9 The slowest to calculate 9 The Th only l that th t produces d soft ft shadows h d 9 Object pick (T) to put and situate

Area Light
9 The size does matter! 9 Th The bi bigger th the li light ht source, the more illuminated the scene

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Area Light

Volume Light
9 In Maya 9 3D shape and the light direction (in (in, out out, etc etc.) ) 9 Everything inside the volume i illuminated is ill i t d

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Volume Light
9 9 9 9 9

Light Linking
Also called selective lighting Maya Relationship Editor Li ht/Sh di -> Light Light/Shading Li ht linking li ki Defines which light shines on which object Can significantly increase p of rendering g speed

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Light Linking two lights

Light Linking

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Light Linking

Shadows
9 one of the most important visual clues 9 help to establish spatial relationship

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Shadows
9 can help to see alternate angles

Shadows
9 increase contrast of a scene 9 shadow color is important! intense color can be used to see what is actually lit 9 can help to divide the space

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Shadows
9 Black shadow is not natural (always?)

Shadows

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Shadows
9 Use fill light to brighten shadows

Shadows - algorithms
9 Shadow map
9 fast and usually ugly 9 problems with transparency

9 Raytraced shadows
9 excellent choice 9 slow 9 critical shadow rays higher ~ slower, better
Bedrich Benes, bbenes@purdue.edu Bedrich Benes, bbenes@purdue.edu

Shadow Geometry
Light source

Shadows - raytraced
9 Penumbra quality = f(shadow rays)

Occluder

Receiver

Penumbra Umbra

Penumbra

Can a point light produce soft shadows?


Bedrich Benes, bbenes@purdue.edu Bedrich Benes, bbenes@purdue.edu

Shadows shadow mapped


9 Shadow quality = f(size of the map)

Ambient Occlusion
9 important and neat effect that darkens wrinkled parts 9 done by hemicube or hemispherical sampling

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Ambient Occlusion
9 Can be achieved by Global Illumination

Ambient Occlusion
9 is calculated without a light source 9 very soft shadows 9 very nice i 9 details later in Global Illumination

www.RadonLabs.de
Bedrich Benes, bbenes@purdue.edu Bedrich Benes, bbenes@purdue.edu

Lens Flares and Halos


9 Nice and cheap effect 9 Caused by multiple reflections in cameras camera s lenses 9 In Maya associated with a light source 9 Can be active/inactive

Lens Flares and Haloes


9 Select light source 9 Go to Light effects and select Light Glow 9 Select Lens Flares 9 Glow spread controls the distance the glow goes 9 Ignore light will display just the effect
Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Lens Flares and Haloes


9 9 9 9 9

Qualities of light
Soft/Hard Intensity C l Color Throw Animation

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Soft/Hard Light
9 Means in fact fact, soft/hard shadow 9 Soft shadows can be simulated by more light sources
9 fasters, easier 9 each h li light ht will ill h have 1/ 1/n-th th i intensity t it

Soft/Hard Light
9 Hard light sunlight, close light bulb space scenes scenes, inhospitable environments 9S Soft ft li lights ht warm environments di t distance li lights ht

9 Hard light sunlight, close light bulb

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Rules of thumb
9 9 9 9 9 9 Isolate one light to see its influence Start with small intensities Li hti i Lighting is li linear! ! (th (thanx G G-d!) d!) Use flipbook to see the influences Area lights at the end Area lights may not be necessary in animations 9 9 9 9 9 9 9

To take home home


Light is is Metamers T Types of f li light ht sources ( (point, i t spot) t ) Why not to use ambient light Why a spot is the best light source Shadows and tricks with them Rules of thumb

Bedrich Benes, bbenes@purdue.edu

Bedrich Benes, bbenes@purdue.edu

Readings
- Andrew Glassner, Principles p of Digital g Image g Synthesis y - Donald Hearn, M.Pauline Baker. Computer Graphics, 2nd edition, Prentice Hall 1994 - F.S.Hill, F S Hill Computer Graphics, Prentice Hall 1990, pages 564-> - Watt, Watt, 2nd edition, Ad Advanced dA Animation i ti and dR Rendering d i T Techniques h i - Cohen, Wallace, Radiosity y and Realistic Image Synthesis y

Bedrich Benes, bbenes@purdue.edu

You might also like