Lighting and Shading
- The next section discusses how to add light to the scene.
- This is not perfect
- Nor will our discussion be complete.
- How does light work in the real world?
- Light sources emit light rays
- These rays either reflected (bounce off) or are absorbed by surfaces.
- In the model, we assume that different frequencies are either reflected or absorbed differently by the individual surfaces.
- The material they are constructed from determines this
- And the angle might change based on the type of surface
- Smooth surfaces reflect well
- Not smooth surfaces (rough) reflect less well.
- This also contributes to the color of the surface.
- Finally, the angle with the viewer makes a difference as well.
- Think of how light reflects off a curved "shiny" surface.
- Ideally we would trace rays of light from each light source, bouncing off each surface, until they either
- Hit window in the viewplane
- Exit the scene.
- Unfortunately, this is not possible
- Infinite rays from a single source.
- Radiosity is one attempt to duplicate this
- But it is computationally intensive.
- And beyond the scope of this class.
- Ray Tracing is another attempt
- It is also computationally intensive.
- But the idea is simpler
- From each pixel in the scene
- Shoot a ray out into the scene
- Have it interact with objects until
- It reaches a light source.
- Or it exits the scene
- Shadows, reflections are all good.
- Another attempt is the illumination model that we will discuss next.
- Attempt to model the physics of the scene at each pixel to be rendered.
- Shadows and reflections are awful (not part of the model)
- But it is fast
- And it is mostly good.
- Surfaces generally have different properties/attributes
- A specular property defines a direct reflection of light.
- Highly specular surfaces reflect light almost perfectly
- A diffuse property defines how much the surface absorbs or scatters light.
- A perfectly diffuse surface will scatter light equally in all directions.
- A transparent/translucent property defines how much light passes through a surface.
- Finally, an ambient property defines how much the light comes from the surface.
- This is a fudge factor in the model.
- But we may need to control it.
- Lights also have properties
- They have a position
- The have a r,g and b component. describing the light emitted.
- They may have an attenuation or fall off property.
- They may also have a direction
- Or other properties.