Graphics
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실
Graphics Lab @ Korea University
Illumination
CGVR
How do We Compute Radiance for a Sample Ray?
Must derive computer models for ...
Emission at light sources Scattering at surfaces Reception at the camera
Wireframe
Without Illumination
Direct Illumination Graphics Lab @ Korea University
Overview
Direct Illumination
CGVR
Emission at light sources Scattering at surfaces
Global Illumination
Shadows Refractions Inter-object reflections Direct Illumination
Graphics Lab @ Korea University
Overview
Direct Illumination
CGVR
Emission at light sources Scattering at surfaces
Global Illumination
Shadows Refractions Inter-object reflections Direct Illumination
Graphics Lab @ Korea University
Modeling Light Source
CGVR
IL(x,y,z,θ,φ,λ)
Describes the intensity of energy, Leaving a light source Arriving at location(x,y,z) From direction (θ,φ) With wavelength λ
Graphics Lab @ Korea University
Empirical Model
CGVR
Ideally Measure Irradiant Energy for “All” Situations
Too much storage Difficult in practice
Graphics Lab @ Korea University
Light Source Model
CGVR
Simple Mathematical Models:
Point light Directional light Spot light
Graphics Lab @ Korea University
Point Light Source
CGVR
Models Omni-Directional Point Source (E.g., Bulb)
Intensity (I0)
Position (px, py, pz) Factors (kc, kl, kq) for attenuation with distance (d)
I0 IL = k c + k 1d + k q d 2
Graphics Lab @ Korea University
Directional Light Source
CGVR
Models Point Light Source at Infinity (E.g., Sun)
Intensity (I0)
Direction (dx,dy,dz)
No attenuation with distance
I L = I0
Graphics Lab @ Korea University
Spot Light Source
CGVR
Models Point Light Source with Direction (E.g., Luxo)
Intensity (I0),
Position (px, py, pz) Direction (dx, dy, dz) Attenuation
I0 ( D ⋅ L) IL = k c + k 1d + k q d 2 Graphics Lab @ Korea University
Overview
Direct Illumination
CGVR
Emission at light sources Scattering at surfaces
Global Illumination
Shadows Refractions Inter-object reflections Direct Illumination
Graphics Lab @ Korea University
Modeling Surface Reflection
CGVR
Rs(θ,φ,γ,ψ,λ)
Describes the amount of incident energy Arriving from direction (θ,φ) Leaving in direction (γ,ψ) With wavelength λ
Graphics Lab @ Korea University
Empirical Model
CGVR
Ideally Measure Radiant Energy for “All” Combinations of Incident Angles
Too much storage Difficult in practice
Graphics Lab @ Korea University
Reflectance Model
CGVR
Simple Analytic Model:
Diffuse reflection + Specular reflection + Emission + “Ambient”
Based Basedon on model model proposed proposedby by Phong Phong
Graphics Lab @ Korea University
Reflectance Model
CGVR
Simple Analytic Model:
Diffuse reflection + Specular reflection + Emission + “Ambient”
Based Basedon on model model proposed proposedby by Phong Phong
Graphics Lab @ Korea University
Diffuse Reflection
CGVR
Assume Surface Reflects Equally in All Directions
Examples: chalk, clay
Graphics Lab @ Korea University
Diffuse Reflection
CGVR
How Much Light is Reflected?
Depends on angle of incident light dL = dA cos Θ
Graphics Lab @ Korea University
Diffuse Reflection
CGVR
Lambertian Model
Cosine law (dot product)
I D = K D ( N ⋅ L) I L Graphics Lab @ Korea University
Reflectance Model
CGVR
Simple Analytic Model:
Diffuse reflection + Specular reflection + Emission + “Ambient”
Based Basedon on model model proposed proposedby by Phong Phong
Graphics Lab @ Korea University
Specular Reflection
CGVR
Reflection is Strongest Near Mirror Angle
Examples: mirrors, metals
Graphics Lab @ Korea University
Specular Reflection
CGVR
How Much Light is Seen?
Depends on angle of incident light and angle to viewer
Graphics Lab @ Korea University
Specular Reflection
CGVR
Phong Model
{cos(α)}n
IS = KS ( V ⋅ R ) IL n
Graphics Lab @ Korea University
Reflectance Model
CGVR
Simple Analytic Model:
Diffuse reflection + Specular reflection + Emission + “Ambient”
Based Basedon on model model proposed proposedby by Phong Phong
Graphics Lab @ Korea University
Emission
CGVR
Represents Light Emitting Directly From Polygon Emission ≠ 0 Emission ≠ 0
Graphics Lab @ Korea University
Reflectance Model
CGVR
Simple Analytic Model:
Diffuse reflection + Specular reflection + Emission + “Ambient”
Based Basedon on model model proposed proposedby by Phong Phong
Graphics Lab @ Korea University
Ambient Term ď Ž
CGVR
Represents Reflection of All Indirect Illumination
This is a total hack (avoids complexity of global illumination)! Graphics Lab @ Korea University
Reflectance Model
CGVR
Simple Analytic Model:
Diffuse reflection + Specular reflection + Emission + “Ambient”
Graphics Lab @ Korea University
Reflectance Model
CGVR
Simple Analytic Model:
Diffuse reflection + Specular reflection + Emission + “Ambient”
Graphics Lab @ Korea University
Reflectance Model ď Ž
CGVR
Sum Diffuse, Specular, Emission, and Ambient
Graphics Lab @ Korea University
Surface Illumination Calculation
CGVR
Single Light Source:
I = I E + K A I AL + K D ( N ⋅ L ) I L + K S ( V ⋅ R ) I L n
Graphics Lab @ Korea University
Surface Illumination Calculation
CGVR
Multiple Light Sources:
I = I E + K A I AL + ∑i ( K D ( N ⋅ Li ) I i + K S ( V ⋅ R i ) I i ) n
Graphics Lab @ Korea University
Overview
Direct Illumination
CGVR
Emission at light sources Scattering at surfaces
Global Illumination
Shadows Refractions Inter-object reflections Global Illumination
Graphics Lab @ Korea University
Global Illumination
CGVR
Graphics Lab @ Korea University
Shadows
CGVR
Shadow Terms Tell Which Light Sources are Blocked
Cast ray towards each light source Li
Si = 0 if ray is blocked, Si = 1 otherwise
Shadow Term
I = I E + K A I A + ∑L ( K D ( N ⋅ L ) + K S ( V ⋅ R ) ) S L I L n
Graphics Lab @ Korea University
Ray Casting
CGVR
Trace Primary Rays from Camera
Direct illumination from unblocked lights only
I = I E + K A I A + ∑L ( K D ( N ⋅ L ) + K S ( V ⋅ R ) ) S L I L n
Graphics Lab @ Korea University
Recursive Ray Tracing
CGVR
Also Trace Secondary Rays from Hit Surfaces
Global illumination from mirror reflection and transparency
I = I E + K A I A + ∑L ( K D ( N ⋅ L ) + K S ( V ⋅ R ) ) S L I L + K S I R + KT IT n
Graphics Lab @ Korea University
Mirror Reflection
CGVR
Trace Secondary Ray in Direction of Mirror Reflection
Evaluate radiance along secondary ray and include it into illumination model
Radiance for mirror reflection ray
I = I E + K A I A + ∑L ( K D ( N ⋅ L ) + K S ( V ⋅ R ) ) S L I L + K S I R + KT IT n
Graphics Lab @ Korea University
Transparency
CGVR
Trace Secondary Ray in Direction of Refraction
Evaluate radiance along secondary ray and include it into illumination model
Radiance for refraction ray
I = I E + K A I A + ∑L ( K D ( N ⋅ L ) + K S ( V ⋅ R ) ) S L I L + K S I R + KT IT n
Graphics Lab @ Korea University
Transparency
CGVR
Transparency coefficient is fraction transmitted
KT = 1 if object is translucent, KT = 0 if object is opaque
0 < KT < 1 if object is semi-translucent
Transparency Coefficient
I = I E + K A I A + ∑L ( K D ( N ⋅ L ) + K S ( V ⋅ R ) ) S L I L + K S I R + KT IT n
Graphics Lab @ Korea University
Refractive Transparency
CGVR
For Thin Surfaces, Can Ignore Change in Direction
Assume light travels straight through surface
T ≅ −L Graphics Lab @ Korea University
Refractive Transparency
CGVR
For Solid Objects, Apply Snell’s Law:
ηr sin Θr = ηi sin Θi
ηi ηi T = ( cos Θ i − cos Θ r ) N − L ηr ηr Graphics Lab @ Korea University
Summary
Direct Illumination
CGVR
Ray casting Usually use simple analytic approximations for light source emission and surface reflectance
Global illumination
Recursive ray tracing Incorporate shadows, mirror reflections, and pure refractions
Graphics Lab @ Korea University
Illumination Terminology
Radiant power [flux] (Φ)
Rate at which light energy is transmitted (in Watts).
Radiant Intensity (I)
Power radiated onto a unit solid angle in direction( in Watt/sr)
Radiant intensity per unit projected surface area( in Watts/m 2sr)
e.g.: light carried by a single ray (no inverse square law)
Irradianc (E)
e.g.: energy distribution of a light source (inverse square law)
Radiance (L)
CGVR
Incident flux density on a locally planar area (in Watts/m2 )
Radiosity (B)
Exitant flux density from a locally planar area ( in Watts/m2 ) Graphics Lab @ Korea University