Computer graphics and virtual reality Flashcards

1
Q

Describe how the Z-buffer algorithm for depth sorting of objets drawn on a computer screen works

A

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!)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe aliasing and anti-aliasing

A
  • Aliasing: Sawtooth edges due to low display resolution
  • Anti-aliasing: Draw nearby points with a mixture of the background color and the line color
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe how perspective projection is calculated

A
  • Projects point on the projection plane with similar triangles
  • (x_p/d) = (x/(z+d))
  • x_p= ((dx)/(z+d))
  • y_p = ((dy)/(z+d))
  • Object further away appears smaller
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe how parallel projection is calculated

A

Simply set z=0
Objects have the same size independent on the distance to the observer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe the illumination model

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why is ambient light needed?

A
  • So that surfaces without direct light will not be completely black -> poor realism.
  • I = I_a * K_a
  • I = light intensity at a certain point
  • I_a = color of light source
  • K_a = reflection coefficient
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe point light + diffuse reflection

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe point light + specular reflection

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the complete reflection expression?

A
  • I = I_ambient + [I_diffuse + I_specular]
  • I = I_a * K_a + [I_i * K_d(Ln) + K_s(RV)^g]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe how rendering over multiple polygon surfaces works

A
  • The illumination models without modification gives the same color over the whole polygon = many pixels gets the same color -> facetted picture - easy to calculate but poor realism. This is called flat shading.
  • More sophisticated rendering algorithms gives methods to set different color on different pixels on a polygon -> smoother transition between colors, for example the Gouraud and Phong methods.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain the Gouraud method

A
  • Interpolate intensities
  • The color of a triangle is calculated at each vertex (corner) with the normal at that corner. The color is then interpolated over the surface of the triangle.
    (1) Calculate normal vector for all polygon surfaces
    (2) Calculate “mean normal vectors” for the vertices of the polygon
    (3) Mean normal + Illumination model -> calculation of intensities (colors) in the vertices
    (4) Intensity values are interpolated line by line over the polygon
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe the Phong method

A
  • Interpolate surface normals
  • The normal at the vertices (corners) are interpolated over the surface of the triangle and the color is calculated for each pixel.
  • Surface normals are interpolated in the same way as intensities for Gouraud
    (1) Calculate normal vector for all polygon surfaces.
    (2) Calculate “mean normal vectors” for the vertices of the polygon
    (3) Surface normals are interpolated line by line over the polygon
    (4) Surface normal + Illumination model -> calculation of intensities (colors) in each pixel
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly