Download presentation
Presentation is loading. Please wait.
Published byDana Morgan Modified over 9 years ago
1
illumination 2013, 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 … Emission at light source Scattering at surface Reception at the camera Desirable feature … Concise Efficient to compute “Accurate”
5
Overview Direct Illumination (=Local 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 ( With wavelength
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 (I 0 ), Position (px, py, pz), Factors (K c, K l, K q ) for attenuation with distance (d)
10
Directional Light Source Models point light source at infinity Intensity (I 0 ), Direction (dx, dy, dz)
11
Spot Light Source (1/2) Models point light source with direction Intensity (I 0 ), Position (px, py, pz), Direction (dx, dy, dz) Attenuation
12
Spot Light Source (2/2) Models point light source with direction intensity (I 0 ), position (px, py, pz), direction (dx, dy, dz) attenuation with distance falloff (sd), and cutoff (sc)
13
Light Falling on a Surface Move surface away from light Inverse square law: Tilt surface away from light Cosine law:
14
Overview Direct Illumination (=Local illumination) Emission at light sources Scattering at surfaces Global illumination Shadows Refractions Inter-object reflections
15
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 람다
16
Empirical Models Ideally measure BRDF for “all” combinations of angles : θ i, φ i, θ o, φ o Difficult in practice Too much storage
17
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.
18
OpenGL Reflectance Model Simple analytic model: Diffuse reflection + Specular reflection + Emission + “Ambient”
19
Diffuse Reflection Assume surface reflects equally in all directions Example: chalk, clay
20
Diffuse Reflection How much light is reflected? Depends on angle of incident light
21
Diffuse Reflection Lambertian model Cosine law (dot product)
22
Specular Reflection Reflection is strongest near mirror angle Examples: mirrors, metals
23
Specular Reflection How much light is seen? Depend on: Angle of incident light Angle to viewer
24
Specular Reflection Phong Model cos ( n : This is a physically-motivated hack!
25
Emission Represent light eminating directly from polygon
26
Ambient Term Represents reflection of all indirect illumination This is a total hack Avoid complexity of global illumination
27
OpenGL Reflectance Model Simple analytic model: Diffuse reflection + Specular reflection + Emission + “Ambient”
28
OpenGL Reflectance Model Sum diffuse, specular, emission, and ambient
29
Surface Illumination Calculation Single light source:
30
Surface Illumination Calculation Multiple light sources:
31
Example
32
Overview Direct Illumination (=Local illumination) Emission at light sources Scattering at surfaces Global illumination Shadows Refractions Inter-object reflections Global Illumination
33
Shadows Shadow term tells if light sources are blocked Cast ray towards each light source L i S i = 0 if ray is blocked, S i = 1 otherwise
34
Ray Casting Trace primary rays from camera Direct illumination from unblocked light only
35
Recursive Ray Tracing Also trace secondary rays from hit surfaces Global illumination from mirror reflection and transparency
36
Mirror reflections Trace secondary rays in mirror direction Evaluate radiance along secondary ray and include it into illumination model
37
Transparency Trace secondary rays in direction of refraction Evaluate radiance along secondary ray and include it into illumination model
38
Transparency Transparency coefficient is fraction transmitted K T = 1 for translucent object, K T = 0 for opaque 0 < K T <1 for object that is semi-translucent
39
Refractive Transparency For thin surfaces, can ignore change in direction Assume light travels straight through surface 에타
40
Refractive Transparency For solid objects, apply Snell’s law:
41
Refractive Index ( 굴절률 ) in Maya ⊙ Vacuum: 1.00 ⊙ Air: 1.00029 ⊙ 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
42
Recursive Ray Tracing Ray Tree represents illumination computation
43
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; }
44
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; }
45
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
46
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 Watts/sr) Ex) energy distribution of a light source (inverse square law) Radiance (L) Radiant intensity per unit projected area (in Watts/m 2 /sr) Ex) light carried by a single ray (no inverse square law) Irradiance (E) Incident flux density on a locally planar area (in Watts/m 2 ) Ex) light hitting a surface at a point Radiosity (B) Exitant flux density on a locally planar area (in Watts/m 2 )
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.