lights and lightinglights and lighting - university of oulujiechen/course/lecture 5-...

19
Lights and Lighting Lights and Lighting Digital Lighting and Rendering CGT 340 CGT 340 Bedrich Benes, [email protected] Lighting is 5% of light setup and 95% of ii d dj revisions and adjustments. Jeremy Birn Bedrich Benes, [email protected] Jeremy Birn Lecture overview Lecture overview 9 What is light? 9 What is light? 9 Spectrum 9 T i l 9 Typical cases 9 Metamers 9 CG lights Bedrich Benes, [email protected] Light Light Light electromagnetic radiation Light electromagnetic radiation between ~ 400 nm and ~ 700 nm Bedrich Benes, [email protected]

Upload: others

Post on 27-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Lights and LightingLights and Lighting

Digital Lighting and RenderingCGT 340CGT 340

Bedrich Benes, [email protected]

Lighting is 5% of light setup and 95% of i i d djrevisions and adjustments.

Jeremy Birn

Bedrich Benes, [email protected]

Jeremy Birn

Lecture overviewLecture overview

What is light?What is light?SpectrumT i lTypical casesMetamersCG lights

Bedrich Benes, [email protected]

LightLight

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

Bedrich Benes, [email protected]

Page 2: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Light SourcesLight Sources

Light sourceLight sourcecan be characterized by its

emission spectrum oremission spectrum or spectral characteristicgraph of intensity of emission at differentgraph of intensity of emission at different wavelengths

Bedrich Benes, [email protected]

Light SourcesLight Sources

the daylight emission spectrumthe daylight emission spectrumit can be measured

intensity [W]

Bedrich Benes, [email protected]

400 500 600 700 wavelength [nm]

Light SourcesLight SourcesLight sourcegimportant special cases of light sources

intensity[W]

intensity [W] [W]

400 500 600 700 wavelength [nm] 400 500 600 700

wavelength [nm]

achromatic light monochromatic lightlat. chroma = color

Bedrich Benes, [email protected]

Light SourcesLight Sources

achromaticachromaticis usually perceived as white or gray

increasing/decreasing the intensity of theg g yachromatic light we get brighter/darker gray

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

the only intensity is the d i t l th d i t fdominant wavelength or dominant frequencyexamples are a laser beam, a sodium bulb

Bedrich Benes, [email protected]

Page 3: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Light Sources and ColorLight Sources and Color

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

Always?

Bedrich Benes, [email protected]

MetamersMetamers

Two lights with different spectra that areTwo lights with different spectra that are perceived as the same color are called metamersmetamers.

Wh ?Why?Convolution of the emission spectra over the eye light sensitivity for short, medium, and long cones gives the same numbers.

Bedrich Benes, [email protected]

Color matching experimentColor matching experiment

change intensity Lchange intensity of the three lightsget the same color

LMSget the same color

as of the sourcel t th th li htlet the three lights be called A, B, and Cthey are called primaries

Bedrich Benes, [email protected]

Light in Computer GraphicsLight in Computer Graphics

the three componentsthe three components

Diff li htDiffuse light

SSpecular light

Ambient light

Bedrich Benes, [email protected]

Page 4: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Light in Computer GraphicsLight in Computer Graphics

Diffuse ~ colorDiffuse colorSpecular ~ reflections, highlightsA bi t i di t ill i tiAmbient ~ indirect illumination,

multiple reflections

This comes from reflections and it characterizes the material more than lights

Bedrich Benes, [email protected]

Types of light sourcesTypes of light sources

Based on the way they shine:Based on the way they shine:Ambient lightPoint lightPoint lightSpot lightDirectional lightgArea lightVolume light

Let’s meet them personally

Bedrich Benes, [email protected]

p y

Ambient LightAmbient Light

Why not to use it?Why not to use it?does not depend on any angleis a flattered fill of a coloris a flattered fill of a colorthe best is – turn it OFFbut we do need the indirect illuminationbut we do need the indirect illumination…use fill lights, but dim them

Bedrich Benes, [email protected]

Ambient Light – one lightAmbient Light one light

Bedrich Benes, [email protected]

Page 5: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Ambient Light - ambientAmbient Light ambient

Bedrich Benes, [email protected]

Ambient Light - directionalAmbient Light directional

Bedrich Benes, [email protected]

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

Bedrich Benes, [email protected]

Ambient LightAmbient Light

MayaMayaAttribute Ambient Shade=0 > behaves as ambientAmbient Shade=0 -> behaves as ambientAmbient Shade=1 -> behaves as point

Bedrich Benes, [email protected]

Page 6: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Point Light SourcePoint Light Source

Also called omni omnidirectionalAlso called omni, omnidirectionalDoes not exist in realityM th ti l b t tiMathematical abstractionLike a light bulb in the middle of a roomThe fastest light source to calculate

Bedrich Benes, [email protected]

Point Light SourcePoint Light Source

Bedrich Benes, [email protected]

Point Light SourcePoint Light Source

Trick in MayaTrick in Mayaset negative intensityintensitybehaves like a “negative light”negative light

Bedrich Benes, [email protected]

Spot LightSpot Light

The most commonly usedThe most commonly usedProbably the most powerful light sourceTh b t t ll d li htThe best controlled lightIt is a point light that is aimed somewhereIt has its:target, cone, penumbra angle, etc.g , , p g ,

Bedrich Benes, [email protected]

Page 7: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Spot LightSpot Light

ReflectorReflectorPoint light with more parametersmore parametersPositioning

press object pick (“T”) to put and situate

Bedrich Benes, [email protected]

Spot Light - positioningSpot Light positioning

Select lightSelect lightPanel-> Look through selected

Bedrich Benes, [email protected]

Spot Light - positioningSpot Light positioning

Aiming to an objectAiming to an objectPanel -> View -> Look at Selection

Bedrich Benes, [email protected]

Spot Light- cone angle 40oSpot Light cone angle 40

Bedrich Benes, [email protected]

Page 8: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Spot Light- cone angle 70oSpot Light cone angle 70

Bedrich Benes, [email protected]

Spot Light- penumbra angle 20oSpot Light penumbra angle 20

Bedrich Benes, [email protected]

Spot Light- drop-off 140Spot Light drop off 140

Bedrich Benes, [email protected]

Spot Light – color as a fileSpot Light color as a file

Bedrich Benes, [email protected]

Page 9: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Spot Light – color as a fileSpot Light color as a file

Bedrich Benes, [email protected]

ThrowThrow

Cookies and gobosCookies and gobos“cookie” – cucoloris“ b ” b t“gobo” – go-betweenobjects between lights and the occluderVenetian blinds, fan on ceiling etc.Can be done by a modelyEasier by a light map

Bedrich Benes, [email protected] © Wikipedia

ThrowThrow

Bedrich Benes, [email protected]

Spot – light mapping intensitySpot light mapping intensity

I=f(d)I f(d)Can be mapped manuallyThe Graph EditorThe Graph EditorWindow -> Animation Editors -> Graph editorAnimation Editors Graph editorSelect the spotlightIn the Light Effect option select Intensity CurvesIn the Light Effect option select Intensity CurvesUse the middle key to move the points

Bedrich Benes, [email protected]

Page 10: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Spot – light mapping intensitySpot light mapping intensity

Bedrich Benes, [email protected]

Spot – light mapping intensitySpot light mapping intensity

Bedrich Benes, [email protected]

Spot Light – making a soft shadowSpot Light making a soft shadow

DLR 2nd edition page 22DLR 2 edition page 22Aim multiple lights so they overlapD th b lDecrease the penumbra angle It is not a shadow! But it looks cool…

Bedrich Benes, [email protected]© Digital Lighting and rendering 2nd edition J.Birn

Directional LightDirectional Light

Depends only on an angleDepends only on an angle Translation does not make any senseRepresents distantRepresents distant light sourcesPoint in infinity (vector)Point in infinity (vector)All rays are parallelF t t l l tFast to calculateCan project images

Bedrich Benes, [email protected]

Page 11: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Directional LightDirectional Light

Bedrich Benes, [email protected]

Area LightArea Light

spherical lightspherical lightgood when close to an objectfor large distance ~ pointg pflat areadisc, rectanglegfaster to calculategood for lamps, etclinear lightfluorescent tube

Bedrich Benes, [email protected]

Area LightArea Light

Rectangular (in Maya)Rectangular (in Maya)The slowest to calculateTh l th t d ft h dThe only that produces soft shadowsObject pick (“T”) to put and situate

Bedrich Benes, [email protected]

Area LightArea Light

The size does matter!The size does matter!

Th bi th li htThe bigger the light source, the more illuminated the scene

Bedrich Benes, [email protected]

Page 12: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Area LightArea Light

Bedrich Benes, [email protected]

Volume LightVolume Light

In MayaIn Maya3D shape and the light direction (in out etc )the light direction (in, out, etc.)Everything inside the volume i ill i t dis illuminated

Bedrich Benes, [email protected]

Volume LightVolume Light

Bedrich Benes, [email protected]

Light LinkingLight Linking

Also called selective lightingAlso called selective lightingMaya – Relationship EditorLi ht/Sh di Li ht li kiLight/Shading -> Light linkingDefines which light shines on which objectCan significantly increase

speed of renderingp g

Bedrich Benes, [email protected]

Page 13: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Light Linking – two lightsLight Linking two lights

Bedrich Benes, [email protected]

Light LinkingLight Linking

Bedrich Benes, [email protected]

Light LinkingLight Linking

Bedrich Benes, [email protected]

ShadowsShadows

one of the most important visual cluesone of the most important visual clueshelp to establish spatial relationship

Bedrich Benes, [email protected]

Page 14: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

ShadowsShadows

can help to see alternate anglescan help to see alternate angles

Bedrich Benes, [email protected]

ShadowsShadows

increase contrast of a sceneincrease contrast of a sceneshadow color is important!intense color can be usedintense color can be used to see what is actually lit

can help to divide the space

Bedrich Benes, [email protected]

ShadowsShadows

Black shadow is not natural (always?)Black shadow is not natural (always?)

Bedrich Benes, [email protected]

ShadowsShadows

Bedrich Benes, [email protected]

Page 15: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

ShadowsShadows

Use fill light to brighten shadowsUse fill light to brighten shadows

Bedrich Benes, [email protected]

Shadows - algorithmsShadows algorithms

Shadow mapShadow mapfast and usually uglyproblems with transparencyproblems with transparency

Raytraced shadowsexcellent choiceslowcritical – shadow rayshigher ~ slower, better

Bedrich Benes, [email protected]

Shadow GeometryShadow GeometryLight source

Occluder

UmbraReceiver Penumbra Penumbra

Bedrich Benes, [email protected]

Can a point light produce soft shadows?

Shadows - raytracedShadows raytraced

Penumbra quality = f(shadow rays)Penumbra quality = f(shadow rays)

Bedrich Benes, [email protected]

Page 16: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Shadows – shadow mappedShadows shadow mapped

Shadow quality = f(size of the map)Shadow quality = f(size of the map)

Bedrich Benes, [email protected]

Ambient OcclusionAmbient Occlusion

important and neat effect that darkensimportant and neat effect that darkens wrinkled partsdone by hemicube or hemisphericaldone by hemicube or hemispherical sampling

Bedrich Benes, [email protected]

Ambient OcclusionAmbient Occlusion

Can be achieved by Global IlluminationCan be achieved by Global Illumination

Bedrich Benes, [email protected]

© www.RadonLabs.de

Ambient OcclusionAmbient Occlusion

is calculated without a light sourceis calculated without a light sourcevery soft shadows

ivery nice

details – laterin Global Illumination

Bedrich Benes, [email protected]

Page 17: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Lens Flares and HalosLens Flares and Halos

Nice and cheap effectNice and cheap effectCaused by multiple reflectionsin camera’s lensesin camera s lensesIn Maya associated with a light sourceCan be active/inactive

Bedrich Benes, [email protected]

Lens Flares and HaloesLens Flares and Haloes

Select light sourceSelect light sourceGo to Light effects and select Light Glowand select Light GlowSelect Lens FlaresGlow spread controlsGlow spread controlsthe distance the glowgoesgoesIgnore light will display just the effect

Bedrich Benes, [email protected]

just the effect

Lens Flares and HaloesLens Flares and Haloes

Bedrich Benes, [email protected]

Qualities of lightQualities of light

Soft/HardSoft/HardIntensityC lColorThrowAnimation

Bedrich Benes, [email protected]

Page 18: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

Soft/Hard LightSoft/Hard Light

Means in fact soft/hard shadowMeans in fact, soft/hard shadowSoft shadows can be simulated by more light sourcescan be simulated by more light sources

fasters, easierh li ht ill h 1/ th i t iteach light will have 1/n-th intensity

Hard light – sunlight, close light bulb

Bedrich Benes, [email protected]

Soft/Hard LightSoft/Hard Light

Hard lightHard light sunlight, close light bulbspace scenes inhospitable environmentsspace scenes, inhospitable environments

S ft li htSoft lightswarm environmentsdi t li htdistance lights

Bedrich Benes, [email protected]

Rules of thumbRules of thumb

Isolate one light to see its influenceIsolate one light to see its influenceStart with small intensitiesLi hti i li ! (th G d!)Lighting is linear! (thanx G-d!)Use flipbook to see the influencesArea lights at the endArea lights may notArea lights may not be necessary in animations

Bedrich Benes, [email protected]

To take homeTo take home…

Light isLight is…MetamersT f li ht ( i t t )Types of light sources (point, spot…)Why not to use ambient lightWhy a spot is the best light sourceShadows and tricks with themShadows and tricks with themRules of thumb

Bedrich Benes, [email protected]

Page 19: Lights and LightingLights and Lighting - University of Oulujiechen/Course/Lecture 5- OpenGL-2/ref/03... · 2010-02-28 · Rules of thumbRules of thumb 9Isolate one light to see its

ReadingsReadings- Andrew Glassner, Principles of Digital Image Synthesisp g g y- Donald Hearn, M.Pauline Baker.

Computer Graphics, 2nd edition, Prentice Hall 1994F S Hill- F.S.Hill,

Computer Graphics, Prentice Hall 1990, pages 564->- Watt, Watt, 2nd edition,

Ad d A i ti d R d i T h iAdvanced Animation and Rendering Techniques- Cohen, Wallace,

Radiosity and Realistic Image Synthesisy y

Bedrich Benes, [email protected]