320 likes | 516 Views
Week 5 - Friday. CS361. Last time. What did we talk about last time? Quaternions Vertex blending Morphing Projections. Questions?. Project 2. Student Lecture: Light and Materials. Light. Light.
E N D
Week 5 - Friday CS361
Last time • What did we talk about last time? • Quaternions • Vertex blending • Morphing • Projections
Light • [L]ight …travels so fast that it takes most races thousands of years to realise that it travels at all…. Douglas Adams • Light is one of the most complex phenomena in the universe • There are quantum effects, its dual wave/particle nature • We will constantly be approximating the effect of light, since figuring out its real effect is virtually impossible
Break it down • We will consider three processes in lighting a scene • Emitting light • From the sun or light bulbs or whatever • Interaction of light • Light is absorbed by and scatters off objects in a scene • Detection by a sensor • A human eye (or a robot eye), camera, piece of film will sense the light • We have to give at least cursory attention to each process to get realistic rendering
Light sources • One of the easiest light sources to model are directional lights, such as the sun • With directional lights, all the light travels the same direction, which we can model with a light vectorl • We assume that l is a unit vector • l is defined in the opposite direction the light is traveling
Intensity of illumination • Besides direction, we need to know the amount of light • Radiometry is the science of measuring light, and we'll talk more about it in two weeks • Irradiance is the light's power passing through a unit area surface perpendicular to l • Light can be colored by using RGB components
Surface irradiance • Most light is not perpendicular to your surface • The surface irradiance is the perpendicular irradiance times cosθ, where θ is the angle between l and the surface normal n • This is why l is the opposite of the direction of light flowing (so that we don't have to negate it) • Also, we clamp the cosθ to [0,1] (no negative values)
Additive irradiance • Real light is coming from many different directions • The final effects of irradiance is additive • Just sum up all the individual light effects • Although we use RGB for light, there is not necessarily a maximum value • Light is perceived logarithmically by humans • High dynamic range displays and floating point color models can allow a better expression of light energy
Material • Once we know how much and what direction of light we're dealing with, the material it hits impacts the final effect a great deal • These impacts are of two kinds: • Scattering • Absorption
Scattering • Scattering is caused by an optical discontinuity • Difference in structure • Change in density • Scattering does not change the amount of light, only its direction • There are two types of scattering • Refraction (or transmission) • Reflection
Refraction • With refraction (or transmission) in (partially) transparent objects, the light continues to go through the object and may light other objects • There are light bending effects • Plus the Z-buffer algorithm doesn't work anymore • We won't deal with that now
Specular and diffuse components • Light that is reflected will have a different direction and color than light that was transmitted into the surface, partially absorbed, and scattered back out • We simplify by dividing into two terms • Specular term (the reflected light) • Diffuse term (the re-transmitted light)
Exitance • Illumination reaching a surface is irradiance • Illumination leaving a surface is exitance(M) • Although our perception of light is logarithmic, light-matter interaction is linear: • Double the irradiance and you'll double the exitance • The ratio between exitance and irradiance is essentially the surface color that you see back • Surface color c = specular color + diffuse color
Modeling specular color • We will often assume that diffuse light has no directionality • Specular light, however, bounces off a surface and spreads out less if the surface is smoother • Color, texture, and the smoothness parameter are not absolute • We may change them depending on how far we are from the object
Don’t believe your eyes • We are going to describe mathematical models of sensors • But how did humans investigate the nature of sensors in the first place? • Can you trust your own sensors? • Consider the following slide
Mach banding • That slide is an example of Mach banding • In Mach banding, a lighter color on the edge of a darker color will appear to grow lighter as you get close to the border between them • The darker color will do the reverse • It's part of our brain's edge detection algorithm
Real sensors • In general, sensors are made up of many tiny sensors • Rods and cones in the eye • Photodiodes attached to a CCD in a digital camera • Dye particles in traditional film • Typically, an aperture restricts the directions from which the light can come • Then, a lens focuses the light onto the sensor elements
Radiance • Irradiance sensors can't produce an image because they average over all directions • Lens + aperture = directionally specific • Consequently, the sensors measure radiance (L), the density of light per flow area AND incoming direction
Idealized sensors • In a rendering system, radiance is computed rather than measured • A radiance sample for each imaginary sensor element is made along a ray that goes through the point representing the sensor and point p, the center of projection for the perspective transform • The sample is computed by using a shading equation along the view ray v
Shading equations • After all this hoopla is done, we need a mathematical equation to say what the color (radiance) at a particular pixel is • There are many equations to use and people still do research on how to make them better • Remember, these are all rule of thumb approximations and are only distantly related to physical law
Lambertian shading • Diffuse exitanceMdiff = cdiff ELcosθ • Lambertian (diffuse) shading assumes that outgoing radiance is (linearly) proportional to irradiance • Because diffuse radiance is assumed to be the same in all directions, we divide by π (explained later) • Final Lambertian radiance Ldiff =
Next time… • Review
Reminders • Keep working on Project 2, due Friday, March 1 • Review all material covered so far • Exam 1 is next Wednesday in class