light_gi

Upload: hassaan-ahmed

Post on 07-Jul-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/18/2019 light_gi

    1/27

    Light, Reflectance,and Global Illumination

    TOPICS:

    • Survey of Representations for Light and Visibility

    • Color, Pereption, and Light

    • Refletane

    • Cost of Ray Traing

    • !lobal Illu"ination Overvie#• Radiosity

    • $u%s Inverse Global Illumination paper 

    &'()*+, I"age(ased -odeling and Rendering

    Paul .e/bert, &) Ot0 &+++

  • 8/18/2019 light_gi

    2/27

    Representations for Light and Visibility

    fi1ed vie#point or  planar sene

    2(3 i"age 4r,g,b5

    diffuse surfae 20'(36

    7(3

    te1tured range data 48,r,g,b5

    or pre-lit polygons

    speular surfae in

    lear air, unoluded

    9(3 light field

    speular surfae in fog,

    or oluded0 plenopti funtion I41,y,8,θ,φ5

    '(3 '(3 light field

    or surface/volume model with general reflectance properties

    italics: not image-based technique

  • 8/18/2019 light_gi

    3/27

    Physics of Light and Color

    Light o"es fro" eletro"agneti radiation0The a"plitude of radiation is a funtion of #avelength λ0

    ny ;uantity related to #avelength is alled re;ueny  ν ? 2 π 6 λ

    @- spetru":

    radio, infrared, visible, ultraviolet, 1(ray, ga""a(ray

      long wavelength short wavelength

      low frequency high frequency

    • 3on%t onfuse @- AAspetru"%% #ith AAspetru"%% of signal in signal6i"age proessingBthey%re usually oneptually distint0

    • Li/e#ise, don%t onfuse spetral #avelength fre;ueny of @- spetru" #ith spatial

    #avelength fre;ueny in i"age proessing0

  • 8/18/2019 light_gi

    4/27

    Perception of Light and Color

    Light is electromagnetic radiation visible to the human eye..u"ans have evolved to sense the do"inant #avelengths e"itted by

    the sunB spae aliens have presu"ably evolved differently0

    In lo# light, #e pereive pri"arily #ith rods in the retina, #hih

    have broad spetral sensitivity 4

  • 8/18/2019 light_gi

    5/27

    What is Color

    Color is human perception of light.Our pereption is i"perfetB #e don%t see spetral po#er P4λ5,

    instead #e see three salars:

    at long #avelength 4≈ red5: L ? ∫ P4λ5sL4λ5dλ

    at "iddle #avelength 4≈ yello#5: - ? ∫ P4λ5s-4λ5dλat short #avelength 4≈ blue5: S ? ∫ P4λ5sS4λ5dλ

      #here sL4λ5, s-4λ5, and sS4λ5 are the sensitivity urves of our threesets of ones0

    Color is three di"ensional beause any light #e see isindistinguishable to our eyes fro" so"e "i1ture of three spetral4"onohro"ati, single(#avelength5 primaries0

  • 8/18/2019 light_gi

    6/27

    Color !paces

    Color an be desribed in various olor spaes:

    spectrum ( allo#s non(visible radiation to be desribed, but usuallyi"pratial6unneessary0

    RG" ( CRT(oriented olor spae

    good for o"puter storage0

    #!V ( a "ore intuitive olor spaeB good for user interfaes.?hue (( the olor #heel, the spetral olors

    S?saturation 4purity5 (( ho# grayF

    V?value 4related to brightness, lu"inane5 (( ho# brightF

    a non(linear transfor" of R!, sine . is yli0

    CI$ %&' ( used by olor sientists, a linear transfor" of R!0

    other olor spaes, less o""only used000

    >or e1tre"ely realisti i"age synthesis, use of four or "ore sa"ples of the spetru" "ay beneessary, but for "ost purposes, the three sa"ples used by R! olor spae is Gust fine0

  • 8/18/2019 light_gi

    7/27

    Light is a (unction of )any Variables

    Light is a funtion of •  position 1,y,8

    • diretion   θ,φ• #avelength λ

    • ti"e t•  polari8ation

    •  phase

    In o"puter graphis, #e typially ignore the last three by assu"ingstati senes, unpolari8ed, inoherent light, and assu"e that the speedof light is infinite0

    ut light is still a o"pliated funtion of "any variables0

    .o# do #e "easure light, #hat are the unitsF

  • 8/18/2019 light_gi

    8/27

    *nits of Light

    quantity dimension units

    solid angle   solid angle Hsteradian

    po+er   energy6ti"e H#att?HGoule6se

    radiance L   po#er64areaJsolid angle5 H#att64"2Jsteradian5a0/0a0 intensity I

    In vauu" or as an appro1i"ation for air, radiance is constant along

    a ray0

    piture is an array of ino"ing radiane values at i"aginary proGetion planeB beause of radiane(onstany, these are e;ual tooutgoing radianes at intersetion of ray #ith first surfae hit

    In general, light is absorbed and sattered along a ray0

  • 8/18/2019 light_gi

    9/27

    General Reflection -ransmission

    t a surface, reflectance is the fration of inident 4ino"ing5 light thatis refleted, transmittance is the fration that is trans"itted into the"aterial0 Opa;ue "aterials have 8ero trans"ittane0

    In so"e boo/s, refletane is denoted ρ, and trans"ittane τ0 Other boo/s use / dr  and / sr  for diffuse and speular refletane, and / dt and

    / st for trans"ittane0

    general refletane funtion has the for" of a bidirectionalreflectance distribution function /"R0(1: ρ4θi,φi,θo,φo5, #here thediretion of ino"ing light is 4θi,φi5 and the diretion of outgoing light

    is 4θo,φo5, θ is the polar angle "easured fro" perpendiular, and φ isthe a8i"uth0

    There is a si"ilar funtion for bidiretional trans"ittane, τ4θi,φi,θo,φo50

    Light is absorbed and sattered by so"e "edia 4e0g0 fog50

    Phong%s Illu"ination "odel is an appro1i"ation to general refletane0

  • 8/18/2019 light_gi

    10/27

    Phong Illumination )odel

    point light soure #ith radiane I l, illu"inating an opa;ue surfae,reflets light of the follo#ing radiane:

    If surfae is perfetly diffuse 4La"bertian50 It is independent of vie+ing directionK

    I ? Il / dr  "a1M0L,EN6r 2

    #here / dr  ? oeffiient of diffuse refletion H&6steradian

     M ? unit nor"al vetor 

    L ? unit diretion vetor to light, r is distane to light

    If surfae is perfetly specular0 It is not independent of vie+ing direction0

    I ? Il / sr  "a1M0.,ENe6r 2

    #here / sr  ? oeffiient of speular refletion H&6steradian. ? unit

  • 8/18/2019 light_gi

    11/27

    Cost of "asic Rendering lgorithms

     s ? Qsurfaes 4e0g0 polygons5 t  s ? ti"e per surfae 4transfor"ing, 0005

     p ? Qpi1els t  p ? ti"e per pi1el 4#riting, inre"enting, 0005 ? Qlights t  ? ti"e to light surfae point #0r0t0 one light

    a ? Σ sreen areas of surfs t i ? ti"e for one ray6surfae intersetion test

    Painter%s or (buffer algorith", #ith flat shading

    #assuming no sorting in painter’s algorithm$

    #orst ase ost ? s4t  s  t 5 at  p≈ at  p if polygons big

    Painter%s or (buffer algorith", #ith per pi1el shading 4e0g0 Phong5

    #orst ase ost ? st  s  a4t  t  p5 ≈ at   if polygons big

    Ray asting #ith no shado#s, no spatial data strutures

    #orst ase ost ? p4 st i  t   t  p5 ≈ pst i  if "any surfaesRay traing to "a1 depth d  #ith shado#s, refltran, no spat0 3S, no supersa"pling

    %d − & intersections/pi'el( for each of which there are    shadow rays

    #orst ase ost ? p42d −&5H4 &5 st i  t  ≈ 2d  p st i  if "any surfaes

     )ote: time constants vary( eg t  p is larger for *-buffer than for painter’s

  • 8/18/2019 light_gi

    12/27

    Interreflection

    De typially si"ulate Gust direct illumination: light traveling on astraight, unoluded line fro" light soure to surfae, refletedthere, then traveling in a straight, unoluded line into eye0

    Light travels by a variety of paths:

    light soure → eye #+ bounces: loo,ing at light source$light soure → surfae& → eye #& bounce: direct illumination$light soure → surf& → surf2 → eye #% bounces$light soure → surf& → surf2 → surf7 → eye # bounces$

    000

    Illu"ination via a path of 2 or "ore bounes is alled indirectillumination or  interreflection0 It also happens #ith trans"ission0

  • 8/18/2019 light_gi

    13/27

    Global Illumination

    .bservation: light o"es fro" other surfaes, not Gust designated lightsoures0

    Goal: simulate interreflection of light in -! scenes

     Difficulty2 you can no longer shade surfaces one at a time, since they3reno+ interrelated4

    T#o general lasses of algorith"s:

    5. ray tracing methods: si"ulate "otion of photons one by one, traing photon paths either ba/#ards 4

  • 8/18/2019 light_gi

    14/27

    -he *nit of Radiosity

    Radiance 4a0/0a0 intensity5 is po#er fro"6to an area in a given

    diretion0units: po#er 6 4area × solid angle5

    Radiosity is outgoing po#er per unit area due to e"ission or refletion

    over a he"isphere of diretions0units: po#er 6 area

    radiosity ? radiane × integral of Hos4polar angle5 × d4solid angle5 over ahe"isphere ? π × radiane

    So radiosity and radiane are linearly interrelated0

    Thus,

  • 8/18/2019 light_gi

    15/27

    Radiosity as an Integral $8uation

    This is alled an integral e8uation beause the un/no#n funtion

  • 8/18/2019 light_gi

    16/27

    Classical Radiosity )ethod

    3efinitions:

    surfaes are divided into elements

    radiosity ? integral of e"itted radiane plus refleted radiane over ahe"isphere0 units: Hpo#er6area

    ssu"ptions:

       no partiipating "edia 4no fog5 →  shade surfaces only( not vols   opa;ue surfaes 4no trans"ission5

       reflection and emission are diffuse radiance is direction-indep. (radiance is a function of %-! surface parameters and λ

       refletion and e"ission are independent of λ #ithin eah of several

    #avelength bandsB typially use 7 bands: R,!, →  solve linear systemsof equations   radiosity is onstant aross eah ele"ent → one G0 radiosity per element 

    Typially 4but not e1lusively5:

       surfaes are polygons, ele"ents are ;uadrilaterals or triangles

  • 8/18/2019 light_gi

    17/27

    0eriving Radiosity $8uations, 5 

    Let   Ai   = area of element i  (computable)  ei   = radiant emitted flux density of elementi  (given)   ρ i   = reflectance of element i  (given)  bi   = radiosity of elementi  (unknown)

      F ij   = form factor fromi to  j  = fraction of power leaving i that arrives at j  (computable)

    So the equation above can be rewritten:

       Aibi =  Aiei + ρ i   F  ji j=1

    n

    ∑  A jb j

    outgoing

    powerof elem i

     

     

     

       =

    power

    emittedby elem i

     

     

     

       +

    power

    reflectedby elem i

     

     

     

       

    outgoingpower

    of elem i

     

     

     

       =

    poweremitted

    by elem i

     

     

     

       +

    reflectanceof elem i

        

      ×

    fraction of powerleaving elem  j that

    arrives at elem i

     

     

     

       

    elem  j

    ∑ ×outgoingpower

    of elem  j

     

     

     

       

  • 8/18/2019 light_gi

    18/27

    (orm (actors

    3efine the form factor  1 i2 to be the fration of light leaving ele"ent i that arrives at ele"ent 2

    Dherevi2 is a boolean visibility funtion: E if point on i is oluded #ith respet to

     point on G, & if unoluded0

    This is a double area integral0 3iffiultK De end up appro1i"ating it0

    d3i and d3 2 are infinitesi"al areas on ele"ents i and 2, respetively

    θi and θ 2 are polar angles: the angles bet#een ray and nor"als on ele"ents i and 2, respetively

    ProGeted area of d3i fro" 2 is os θi d3i, hene the osines

    r  is distane fro" point on i to point on 2

    Reiproity la#:  3i 1 i2 ? 3 2 1  2i0

    F ij =1

     Ai

    cosθ i cosθ  j

    π r 2  vijdA jdAi

     A j

    ∫  Ai

    ∫ 

  • 8/18/2019 light_gi

    19/27

    0eriving Radiosity $8uations, 6

      Earlier, we had :  Aibi  =  Aiei + ρ i   F  ji j=1

    n

    ∑   A jb j

    Dividing by Ai : bi  = ei + ρ i   F  ji j=1

    n

    ∑   A j Ai b j

    By the reciprocity law, F  ji ( A j  /  Ai ) =  F ij , so bi  =  ei + ρ i   F ij j=1

    n

    ∑   b j   for all elemsiOr, in matrix/vector notation:  b = e + Kbwhere b is the vector of unknown radiosities, e is the vector of known emissions,and K is a square matrix of reflectance times form factor: K 

    ij

     =  ρ i

    F ijSubtracting Kb from both sides, we get b - Kb = e, or

      (I - K)b = e where I is an identity matrix.This is a linear system ofn equations in n unknowns (the bi ).

    There are three such systems of equations, one for the red channel, one for

    green, and one for blue. The variables ρ i , ei , and bi  are RGB vectors.

  • 8/18/2019 light_gi

    20/27

    Computing Visibility for (orm (actors

    Co"puting visibility in the for" fator integral is li/e solving ahidden surfae proble" fro" the point of vie# of eah surfae inthe sene0

    -+o methods2

    ray tracing: easy to i"ple"ent, but an be slo# #ithout spatial subdivision"ethods 4grids, otrees, hierarhial bounding volu"es5 to speed up ray(surfae intersetion testing

    hemicube: e1ploit speed of 8(buffer algorith", o"pute visibility bet#een oneele"ent and all other ele"ents0 !ood #hen you have 8(buffer hard#are, but

    so"e tri/y issues regarding he"iube resolution

    $ou end up appro1i"ating the double area integral #ith a double su""ation, Gustli/e nu"erial "ethods for appro1i"ating integrals0

    Dhen t#o ele"ents are /no#n to be inter(visible 4no oluders5, you an use

    analyti for" fator for"ulas and s/ip all this0

  • 8/18/2019 light_gi

    21/27

    Radiosity !ystems Issues

    ll algorith"s re;uire the follo#ing operations:

    &0 Input sene 4geo"etry, e"issions, refletanes50

    20 Choose "esh 4i"portantK5, subdividing polygons into ele"ents0

    70 Co"pute for" fators using ray traing or he"iube for visibility 4e1pensive50

    90 Solve syste" of e;uations 4indiretly, if progressive radiosity50

    '0 3isplay piture0

    If "esh is hosen too oarse, appro1i"ation is poor, you get blo/y shado#s0

    If "esh is hosen too fine, algorith" is slo#0 good "esh is ritialK

    In radiosity si"ulations, beause sene is assu"ed diffuse, surfaes% radiane #ill bevie#(independent0

    Changes in vie#point re;uire only visibility o"putations, not shading0 3o #ith 8( buffer hard#are for speed0 This is o""only used for

  • 8/18/2019 light_gi

    22/27

    !ummary of Radiosity lgorithms

    Radiosity algorith"s allo# indiret lighting to be si"ulated0

    Classical radiosity algorithms2

    • !enerality: li"ited to diffuse, polygonal senes0

    • Realis": aeptable for si"ple senesB blo/y shado#s on o"ple1 senes0 Trial

    and error is used to find the right "esh0• Speed: good for si"ple senes0 If all for" fators are o"puted, .#n% $, but if

     progressive radiosity or ne#er

  • 8/18/2019 light_gi

    23/27

    Inverse Global Illumination2

    Recovering Reflectance )odels ofReal !cenes from Photographs

    $i8hou $u, Paul 3ebeve, itendra -ali/, and Ti" .a#/ins

    SI!!RP. U++

    &'()*+, I"age(ased -odeling and Rendering

    Paul .e/bert, 2E Ot0 &+++

  • 8/18/2019 light_gi

    24/27

    &u2 )otivation

    -ost I-R "ethods per"it novel vie#points but not novel lightingBthey assu"e surfaes are diffuse0

    Dant to per"it hanges in lighting0

    Dould li/e to to reover 4non(diffuse5 refletane "aps:speularity and roughness at eah surfae point

  • 8/18/2019 light_gi

    25/27

    &u2 !implifying ssumptions

    • stati sene of opa;ue surfaes• /no#n shape

    • /no#n light soure positions

    • alibrated a"eras, /no#n a"era positions

    • high dyna"i range photographs

    • speular refletion para"eters 4speular refletion oeffiient androughness5 onstant over large surfae regions

    • eah surfae point aptured in at least one i"age

    • eah light soure aptured in at least one i"age

    • i"age of a highlight in eah speular surfae region in at least one photograph

  • 8/18/2019 light_gi

    26/27

    &u lgorithm ;vervie+

    5. !olve for shape 4use >3@ or si"ilar syste"5

    6. !olve for coarse diffuse reflectances

       oarsely "esh the surfaes into triangles

       inverse radiosity proble": /no#n for" fators and radiosities 4fro" i"ageradianes5, solve for diffuse refletanes 4linear syste"5

  • 8/18/2019 light_gi

    27/27

    &u2 c8uisition 0etails

    • spherial, frosted light bulbs• &)E volt 3C po#er to avoid *E.8 light fli/er 

    •  bla/ strips of tape on #alls for digiti8ation

    • shot &'E i"ages #ith digital a"era, "erged to reate 9E high

    dyna"i range i"ages 4represent #ith floating point pi1el values5•  blo/ light soure to a"era in so"e of the i"ages

    • orret for radial distortion and vignetting