Download presentation
Presentation is loading. Please wait.
1
Computer Graphics Lecture 31
2
Mathematics of Lighting and Shading - V Taqdees A. Siddiqi cs602@vu
Mathematics of Lighting and Shading - V Taqdees A. Siddiqi
3
Physically Based Illumination
4
In order to get a more realistic representation of lighting, we need to move away from the simplistic models that are found hard coded in most graphics pipelines.
5
and move to something that is based more in a physical representation of light as a wave with properties of its own that can interact with its environment
6
To do this, we'll need to understand how light passes through a medium and how hitting the boundary layer at the intersection of two media can affect light's properties
7
In Figure 1, there's an incident light hitting a surface
In Figure 1, there's an incident light hitting a surface. At the boundary of the two media (in this case, air and glass), there are two resulting rays of light.
8
The reflected ray is the one that we've already discussed to some extent, and the other ray is the refracted or transmitted ray.
9
Figure 1: Light being reflected and refracted through a boundary.
10
Until now, we've been treating our surfaces as perfectly smooth and uniform this prevents us from getting some interesting effects
11
In addition to examining the interaction of light with the surface boundary, we need a better description of real surface geometries
12
let's look at the physics of light interacting at a material boundary.
13
Reflection
14
Reflection of a light wave is the change in direction of the light ray when it bounces off the boundary between two media
15
light wave reflecting off a perfectly smooth surface
16
Using a lighting model based upon the Blinn—Phong model means that we'll always get a uniform specular highlight based upon the color of the reflecting light and material
17
In order to get a more interesting and realistic lighting model, we need to add in some nonlinear elements to our calculations
18
Refraction
19
Refraction happens when a light wave goes from one medium into another.
20
Because of the difference in the speed of light of the media, light bends when it crosses the boundary. Snell's law gives the change in angles.
22
where the n's are the material's index of refraction
23
Snell's law states that when light refracts through a surface, the refracted angle is shifted by a function of the ratio of the two material's indices of refraction
24
The index of refraction of vacuum is 1, and all other material's indices of refraction are greater than 1
25
Figure 2: The refracted ray's angle is less than the incoming ray's.
26
The angle of incidence is the angle between the incoming vector and the surface. Rearranging Snell's law, we can solve for the refracted angle.
27
Inserting the values give us
28
If we use Snell's law for light going from water to air, and plug in 90° for the refracted angle, we get 41.8° for the incident angle. This is called the critical angle at which we observe the phenomenon of total internal reflection
29
At any angle greater than this, light will not pass though a boundary but will be reflected internally
30
One place that we get interesting visual properties is in the diamond—air interface.
31
The refractive index of a diamond is fairly high, 2
The refractive index of a diamond is fairly high, 2.24, which means that it's got a very low critical angle, just 24.4°.
32
This means that a good portion of the light entering a diamond will bounce around the inside of the diamond hitting a number of air—diamond boundaries, and as long as the angle is 24.4° or greater, it will keep reflecting internally
33
This is why diamonds are cut to be relatively flatish on the top but with many faceted sides, so that light entering in one spot will bounce around and exit at another, giving rise to the sparkle normally associated with diamonds.
34
Another place where a small change in the indices of refraction occurs is on a road heated by the sun when viewed from far away
35
The hot air at the road's surface has a slightly smaller index of refraction than the denser, cooler air above it.
36
This is why we get the effect of a road looking as though it were covered with water and reflecting the image above it—the light waves are actually reflected off the warm air—cold air interface.
37
Figure 3: The critical angle.
38
What makes this really challenging to model is that the index of refraction for most materials is a function of the wavelength of the light
39
This means that not only is there a shift in the angle of refraction, but that the shift is different for differing wavelengths of light
40
Figure 4 and 5 show the index of refraction for fused quartz and sapphire plotted against the wavelength.
41
We can see the general trend that shorter wavelength light (bluish) tends to bend more than the longer (reddish) wavelengths.
42
Figure 4: Index of refraction as a function of wavelength for quartz.
43
Figure 5: Index of refraction as a function of wavelength for sapphire.
44
This is the phenomenon that's responsible for the spectrum that can be seen when white light is passed through a prism (Figure 6)
45
Figure 6: The wavelength dependence of the index of refraction in action.
46
It's refraction that will break apart a light source into its component colors, not reflection.
47
This is one area where our simplistic model of light breaks down since we're not computing an entire spectrum of light waves, but we're limited to three primary colors.
48
For reference, the rgb values can be assigned to a range of wavelengths as follows:
50
While the spectrum spreading effect of refraction is interesting in itself, the rgb nature of computer color representation precludes performing this spreading directly—we can't break up a color value into multiple color values.
51
However, with some work, we can compute the shade of the color for a particular angle of refraction and then use that as the material color to influence the refracted color.
52
Computer Graphics Lecture 31
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.