8 - Illumination (week 4) Flashcards
Light sources:
- Point lights ( e.g. a candle flame)
- Directed lights ( infinite distance e.g. the sun)
- Spot lights (e.g. torch)
- Distributed light sources (e.g. bar-type light)
What is attenuation of light
Intensity goes down with distance
1/d^2
Directed light has no attenuation
What 4 things can happen when a ray of light hits a surface?
-Absorption (no re-emission)
-Reflection (diffuse, specular)
-Refraction (where the light is refracted, potentially at a different angle, through another medium)
-Fluorescence (RARE)
Reflection types:
- Diffuse: reflections are distributed equally
- Specular :
perfect
where reflection is just in one direction
imperfect
where it is in multiple directions
some light is scattered away from the principal reflected direction
Global Illumination Modelling
Global illumination modelling considers all interactions of light in the scene – both directly from its source and indirect lighting.
Why do we not follow the rays of each light for global illumination modelling?
Way too complicated and computationally expensive. We just follow the ray of light until it hits the first object.
Local Illumination Modelling
considers the interaction of light between the object and the light sources in the scene;
The effect of light from other objects in the scene is ignored.
Diffuse Reflection: Lambert’s Cosine Law
Light intensity observed from an object’s surface that is diffusely reflecting is directly proportional to the cosine of the angle θ between the observer’s line of sight and the surface normal.
FORMULA:
I intensity of incident light
L direction to light
n surface normal
L = normalise(Plight - Ppoint)
I = Ik cos = Ik n . L
kd is the reflective property of the surface (diffuse parameter)
Specular Reflection variables:
I intensity = the specular reflected intensity
r ‘mirror’ direction
v viewing direction
L direction to light
d distance to the light
n surface normal
k is the specular reflection intensity parameter; its value depends on the material
Ω=omega
Note that r is the reflected direction, and can be calculated using n and L
phong model formula
I = Ik (r⋅v)^n = Ik (cosΩ)^n
if n is small it’s a dull surface if its larger it’s shiny
if its infinite its a mirror (perfect reflection)
What happens in the Phong model if the point light is at infinity vs at a given position?
I and L are constant
L = normalise(Plight - Ppoint)
Blinn Phong model
Simplified Phong model
Calculate vector H (halfway) vector between viewer and light source
If H = N, Is is maximum.
Is = Ik(N.H)^n
When is Blinn Phong most efficient:
- Both the viewers and the light source are far from the surface
- V and L are constant (so H is also constant).
Shading 3 types:
Flat,
Gouraud,
Phong
Flat shading:
a single intensity is calculated for each polygon.
The shade is determined by the polygon’s normal and colour at the “centre”.
FAST
How do we calculate the normal of a triangular face?
Cross product of any of the two vectors in the triangle
How are vertex normals calculated?
From the connected faces the normals are calculated and averaged (must be normalized)
Gouraud shading
Calculate vertex normals and shades,
Bilinearly interpolate LIGHT INTENSITY between the vertices
BASIC, GOOD FOR DIFFUSE,
POOR FOR SPECULAR
Interpolate intensities between vertices:
Calculates shades at vertices and interpolates to interior pixels
However, specular reflections get muted in this representation;
Phong
Calculate vertex normals, Bilinearly interpolate
NORMALS between the vertices then calculate shade
SLOW, GOOD
Interpolate normals:
Interpolate normal direction to interior pixels then calculate shade
Best use Flat Phong and gourad
Flat : Basic Applications
Gourad : Diffuse surfaces ks ≈ 0
Phong : Surfaces with specular reflection large ks
Properties use Flat Phong and gourad
- Flat: Fast; avoids interpolation
Gourad :
* Basic shading, good for diffuse reflections
* Poor rendering of highlights and specular reflections
Phong:
* Highest quality without volumetric rendering
* 4-5 slower than Gouraud
When would you use Phong and Gouraud together
Use Phongf for surfaces with specular reflection (large ks)
Use Gouraud for diffuse (ks=0)
Phong explain:
Calculates each pixel individually.
Takes into account the normals at each pixel of the surface allowing to better display curled surfaces and accurately simulate the change of direction of light.
Gourad
Calculates the average colour for each vertex in the polygon and interpolates them across its surface.
Can result in a loss of accuracy with complex curvatures leading to a faceted appearance.
Incapable of accurate highlights.