Download presentation
Presentation is loading. Please wait.
1
illumination 2016, Fall
2
Ray Casting Image RayCast(Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i; i< width; i++) for (int j=0; j<height; j++) { Ray ray=ConstructRayThroughPixel(camera, i, j); Intersection hit = FIndIntersection(ray, scene); Image[i][j]=GetColor(scene, ray, hit); } return image;
3
Illumination How do we compute radiance for a sample ray?
image[i][j]=GetColor(scene, ray, hit);
4
Goal Must derive computer models for … Desirable feature …
Emission at light source Scattering at surface Reception at the camera Desirable feature … Concise Efficient to compute “Accurate”
5
Overview Direct Illumination (=Local illumination) Global illumination
Emission at light sources Scattering at surfaces Global illumination Shadows Refractions Inter-object reflections
6
Modeling Light Sources
… Describes the intensity of energy, Leaving a light source, Arriving at location (x, y, z), From direction (q, f), With wavelength l
7
Empirical Models Ideally measure Irradiant energy for “all” situations
Too much storage Difficult in practice
8
OpenGL Light Source Models
Simple mathematical models: Point light Directional light Spot light
9
Point Light Source Models omni-directional point source
Intensity (I0), Position (px, py, pz), Factors (ca, la, qa) for attenuation with distance (d)
10
Directional Light Source
Models point light source at infinity Intensity (I0), Direction (dx, dy, dz)
11
Spot Light Source (2/2) Models point light source with direction
intensity (I0), position (px, py, pz), direction (dx, dy, dz) Factors (ca, la, qa) for attenuation with distance falloff (sd), and cutoff (sc)
12
Light Falling on a Surface
Move surface away from light Inverse square law: Tilt surface away from light Cosine law:
13
Overview Direct Illumination (=Local illumination) Global illumination
Emission at light sources Scattering at surfaces Global illumination Shadows Refractions Inter-object reflections
14
Modeling Surface Reflectance
BRDF (θi, φi, θo, φo, λ)… Bidirectional Reflectance Distribution Function describes the amount of incident energy, arriving from direction (θi, φi), ... (쎄타, 파이) leaving in direction (θo, φo), ... with wavelength l (람다)
15
Empirical Models Ideally measure BRDF for “all” combinations of angles : θi, φi, θo, φo Difficult in practice Too much storage
16
Parametric Models Approximate BRDF with simple parametric function that is fast to compute. Phong [75] Blinn-Phong [77] Cook-Torrance [81] He et al. [91] Ward [92] Lafortune et al. [97] Ashikhmin et al. [00] etc.
17
OpenGL Reflectance Model
Simple analytic model: Diffuse reflection + Specular reflection + Emission + “Ambient”
18
Diffuse Reflection Assume surface reflects equally in all directions
Example: chalk, clay
19
Diffuse Reflection How much light is reflected?
Depends on angle of incident light
20
Diffuse Reflection Lambertian model Cosine law (dot product)
21
Specular Reflection Reflection is strongest near mirror angle
Examples: mirrors, metals
22
Specular Reflection How much light is seen? Depend on:
Angle of incident light Angle to viewer
23
Specular Reflection Phong Model
cos (a)n : This is a physically-motivated hack!
24
Emission Represent light eminating directly from polygon
25
Ambient Term Represents reflection of all indirect illumination
This is a total hack Avoid complexity of global illumination
26
OpenGL Reflectance Model
Simple analytic model: Diffuse reflection + Specular reflection + Emission + “Ambient”
27
OpenGL Reflectance Model
Sum diffuse, specular, emission, and ambient
28
Surface Illumination Calculation
Single light source:
29
Surface Illumination Calculation
Multiple light sources:
30
Example
31
Overview Direct Illumination (=Local illumination) Global illumination
Emission at light sources Scattering at surfaces Global illumination Shadows Refractions Inter-object reflections Global Illumination
32
Shadows Shadow term tells if light sources are blocked
Cast ray towards each light source Li Si = 0 if ray is blocked, Si = 1 otherwise
33
Ray Casting Trace primary rays from camera
Direct illumination from unblocked light only
34
Recursive Ray Tracing Also trace secondary rays from hit surfaces
Global illumination from mirror reflection and transparency
35
Mirror reflections Trace secondary rays in mirror direction
Evaluate radiance along secondary ray and include it into illumination model
36
Transparency Trace secondary rays in direction of refraction
Evaluate radiance along secondary ray and include it into illumination model
37
Transparency Transparency coefficient is fraction transmitted
KT = 1 for translucent object, KT = 0 for opaque 0 < KT <1 for object that is semi-translucent
38
Refractive Transparency
For thin surfaces, can ignore change in direction Assume light travels straight through surface 에타
39
Refractive Transparency
For solid objects, apply Snell’s law:
40
Refractive Index (굴절률) in Maya
⊙ Vacuum: 1.00 ⊙ Air: ⊙ Acetone: 1.36 ⊙ Alcohol: 1.329 ⊙ Amorphous Selenium: 2.92 ⊙ Calspar 1: 1.16 ⊙ Calspar 2: 1.486 ⊙ Carbon Disulfide(탄소 황화물): 1.63 ⊙ Chromium Oxide(크롬 산화물): 2.705 ⊙ Copper Oxide(구리 산화물): 2.705 ⊙ Crown Glass(크라운 창 유리): 1.52 ⊙ Crystal: 2.00 ⊙ Diamond: 2.471 ⊙ Emerald: 1.57 ⊙ Ethyl Alcohol(에틸 알콜): 1.36 ⊙ Flourite: 1.434 ⊙ Fused Quartz(석영, 수정): 1.46 ⊙ Heaviest Flint Glass(렌즈, 프리즘 등 광학용 고급유리): 1.89 ⊙ Heavy Flint Glass: 1.65 ⊙ Glass: 1.5 ⊙ Ice: 1.309 ⊙ lodine Crystal: 3.34 ⊙ Lapis Lazuli(청금석): 1.61 ⊙ Light Flint Glass: 1.575 ⊙ Liquid Carbon Dioxide: 1.2 ⊙ Polystyrene(폴리스티렌): 1.55 ⊙ Quartz 1(석영): 1.644 ⊙ Quartz 2: 1.535 ⊙ Ruby: 1.77 ⊙ Sapphire: 1.77 ⊙ Sodium Chloride1(소금): 1.544 ⊙ Sodium Chloride2(소금): 1.644 ⊙ Sugar Solution 30%(30% 설탕물): 1.38 ⊙ Sugar Solution 80%(80% 설탕물): 1.49 ⊙ Topaz(황옥): 1.61 ⊙ Water_섭씨 20도에서의 물: 1.333 ⊙ Zinc Crown Glass: 1.517
41
Recursive Ray Tracing Ray Tree represents illumination computation
42
Recursive Ray Tracing GetColor call RayTrace recursively
Image RayTrace(Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i; i< width; i++) for (int j=0; j<height; j++) { Ray ray=ConstructRayThroughPixel(camera, i, j); Intersection hit = FIndIntersection(ray, scene); Image[i][j]=GetColor(scene, ray, hit); } return image;
43
Recursive Ray Tracing GetColor is called recursively
Color GetColor(Scene scene, Ray ray) { Intersection hit = FindIntersection(ray, scene); Ray specular_ray = SpecularRay(ray, hit); Ray refractive_ray = RefractiveRay(ray, hit); Color color = Phong(scene, ray, hit) + Ks * GetColor(scene, specular_ray, hit) + Kt * GetColor(scene, refractive_ray, hit); return color; }
44
Summary Ray casting (direct illumination)
Usually use simple analytic approximations for light source emission and surface reflectance Recursive ray tracing (global illumination) Incorporate shadows, mirror reflections, and pure refractions All of this is an approximation So that it is practical to compute
45
Illumination Terminology
Radiant power [flux] (F) Rate at which light energy is transmitted (in Watts) Radiant Intensity (I) Power radiated onto a unit solid angle in direction (in Watts/sr) Ex) energy distribution of a light source (inverse square law) Radiance (L) Radiant intensity per unit projected area (in Watts/m2/sr) Ex) light carried by a single ray (no inverse square law) Irradiance (E) Incident flux density on a locally planar area (in Watts/m2) Ex) light hitting a surface at a point Radiosity (B) Exitant flux density on a locally planar area (in Watts/m2)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.