- learn to shade objects to appear 3d
- introduce types of light/material interactions
need to consider
- light sources
- materical properties
- location and direction ofviwers
- surface orientation
Scattering
- light strikes surface A
→ some is scattered, some is absorbed
- some of the scattered light strikes B
→ some is scattered, some is absorbed
- the infinite scattering and absorption of light cannot be solved in general
- this endless scattering and rescattering of light is global phenomena within the scene in the sene that every scene element can affect the shading of evey other element
- generated effects include shadows and reflection of colour from object to object
Global rendering
- requrs a global calculation involving inter-reflection of all light from all light sources. e.g. ray tracing. high quality, has soft shadows
- Local rendering computes the lighting for each object independently, no inter-reflection between obejcts
- global rendering is incompatilbe with the openGL pipeline model
Light-material interaction
- the light that isnt absorbed that defines the colour of a surface
- we usually compute lighting over each colour channel separately.. how much red is absorbed vs reflected vs how much green...
- how much light is reflected also depends on the smoothness
Light sources
- general light sources are difficult to work with because me must integrate light coming from all points on the source
- for local rendering we assume light is basically just a point
- simple light sources
→ point source
⇒ modeled with a position and colour
⇒ emanates in all directions simultaneously
⇒ like a sphere that emanates out
→ spotlight
⇒ has a xyz position and a direction vector
⇒ also have a solid angle that represents the width of the beam
→ parallel light source
⇒ approximation of a light source that is very very far away (infinite distance)
⇒ paralell rays of light
⇒ has no location, just a vector indicating direction
⇒ has a brightness level
⇒ cant calculate distance
→ ambient light
⇒ background light level that will illuminate surfaces not directly hit by a light source
⇒ can approximate the contribution from reflecting surfaces (a hack)
light distance
- the light from a point source that reaches a surface is inversely proportional to the square of the distance between them
- light amount = 1/d^2 = 1/(px-lx)^2 + (py-ly)^2 + (pz-lz)^2
surface types
- the smoother a surface, the more reflected light is concentrated in the direction that a perfect mirror would reflect the light
- a very rough surface scatters light in all directions
Ideal reflector (perfectly smooth)
- normal is determined by cross product of two vectors on the surface
- angle of light incidence is the same as the angle of reflection
- the three vectors are coplanar
- the reflection vector is
- r = 2(l dot n) n - l
l - light source
n - normal
projection of l on n = (l dot n) * n
(l dot n) is the length of the projection
from the base of the two vectors n and n, we go down -l
if we pull up by 2 * (projection of l onto n)
so we get r = 2(ldotn)n - l
can we come up with a model of lighting that is good enough for our purposes? Index