Lighting and Shading Flashcards
3 major shading techniques
?
interactions between light and materials can be classified into the 3 groups
- Specular surfaces
- Diffuse surfaces
- Translucent surfaces
Specular surfaces
appear shiny because most of the light that is reflected or
scattered is in a narrow range of angles close to the angle of reflection.Mirrors
are perfectly specular surfaces
Diffuse surfaces
characterized by reflected light being scattered in all
directions. Walls painted with matte or flat paint are diffuse reflectors.
Perfectly diffuse surfaces scatter light equally in all directions,
Translucent surfaces
allow some light to penetrate the surface and to emerge
from another location on the object
Polygonal Mesh
A polygonal mesh comprises many flat polygons, each of which has a well-defined normal
3 ways to shade polygons
- Flat shading
- Gouraud Shading
- Phong Shading
Flat shading
(constant shading)
The shading calculation is carried out only once for each polygon, and each point on the polygon is assigned the same shade. Flat shading will show differences in shading among adjacent polygons
Gouraud shading
(smooth shading)
(Vertex shader)
The lighting calculation is done at each vertex using the material properties and the vectors π, π, and π . Thus, each vertex will have its own colour that the rasterizer can use to interpolate a shade for each fragment
Phong shading
(Fragment shader)
Instead of interpolating vertex intensities (colours), we interpolate normals across each polygon. We can thus make an independent lighting calculation for each fragment. We implement Phong shading in the fragment shader.
4 types of light sources
- Ambient Light
- Point Light (source)
- Spotlights
- Distant Light (source)
Ambient Light
Ambient illumination is characterized by an intensity, πΌa, that is identical at every point in the scene. (In many rooms, such as class rooms, the lights have been designed and positioned to provide uniform illumination throughout the room )
Point source
An ideal point source emits light equally in all directions. The intensity of illumination received from a point source is proportional to the inverse square of the distance between the source and surface, called the distance term
Spotlight
Spotlights are characterized by a narrow range of angles (a cone) through which light is emitted. More realistic spotlights are characterized by the distribution of light within the cone β usually with most of the light concentrated in the centre of the cone.
Distant Light Source
All rays are parallel and we replace the location (point) of the light source with the direction (vector) of the light.