Describe how the Z-buffer algorithm for depth sorting of objets drawn on a computer screen works
It works on pixel level:
- Initiate video memory and a Z-buffer for each pixel on the screen
- depth [x,y]=infinity, refresh[x,y]=I_backround
- Polygons are rendered in an arbitrary sequence
- For each pixel: check if the z-coordinate of the current polygon is less than the stored one:
Ax+By+Cz+D=0, z_x,y=(-(Ax+By+D))/C
- In that case the video memory is updated for the pixel:
z_x,y < depth[x,y] –> depth[x,y]=I_surf
- When all polygons are checked the screen is updated with the color closest to the observer
(se bild!)
Describe aliasing and anti-aliasing
Describe how perspective projection is calculated
Describe how parallel projection is calculated
Simply set z=0
Objects have the same size independent on the distance to the observer
Describe the illumination model
The color in a pixel i affected by:
- The light of the surroundings (ambient light):
—–The same color everywhere
- Point light sources:
—– The color is dependent on distance and orientation to the light source
—– Incoming light can be reflected diffuse or specular
—– The intensity fades with distance
Why is ambient light needed?
Describe point light + diffuse reflection
Light hitting the surface is spred equally in all directions -> placement of the light source influences but not the placement of the observer
- I_d = I_i * K_d * cos(v)
- I_d = I_i * K_d * (L * n)
- I_i = intensity of the light source
- K_d = diffuse reflection coefficient [0,1]
- L = vector for incoming light
- n = surface normal
Describe point light + specular reflection
The appearance of smooth, polished, surfaces is dependent of both the placement of the light source and the position of the observer
- I_s = I_i * K_s * (cos(v))^g
- I_s = I_i * K_s * (R * V)^g
- I_i = intensity of the light source
- K_s = specular reflection coefficient [0,1]
- g = gloss parameter (shininess)
- R = reflection direction, angle = incoming angle
- V = observation direction
What is the complete reflection expression?
Describe how rendering over multiple polygon surfaces works
Explain the Gouraud method
Describe the Phong method