Exam Questions Flashcards
Question 1. (a) Describe the specular and diffuse types of reflection.
Diffuse
- Light reflected from a diffuse surface is scattered in all directions.
- Diffuse surface looks the same from all directions.
- Lambert’s cosine law: diffuse surface has the same perceived luminance from any angle.
Specular:
- direct reflection of light by a surface
- most light is reflected in a very narrow range of angles
- for a perfect mirror the angle of reflection = the angle of incidence
Question 1 (b) Explain why display devices can reproduce the impression of a full rainbow sectrum using only red, green and blue light.
- Colour of a pixel is usually recorded as 3 values. R,G,B.
- Mixing these three primary lights is sufficient to give a percieved full rainbow spectrum.
- This is additive colour mixing.
- Each component is 8bits from 0 being black to 255 white making the full colour spectrum 24bit.
- 256 possible levels to display the colours.
Question 1 (c) Describe the difference between local and global illumination.
Local illumination:
- Light that goes directly from the light source is reflected from the surface.
- The shading of any surface is independent of the shading of any other surface.
- It is simply the light that goes from the light source to the surface.
Global illumination:
- Adds to the local modal the light that is reflected from other surfaces around it.
- More realistic than local, modes how light reacts in the real world.
- An illumination model in which all objects are considered as potential sources of illumination for all other objects in the scene.
Question 1 (c) Explain advantages and disadvantages of local verses global illumination
Local Illumination:
- Most real time graphics rendering sustems will use local illumination as it is quicker at rendering than global.
- Local is not physically accurate.
- Relies on a constant ambient value to represent the interreflection of a scene.
Global Illuminaton:
- Take into account direct and indirect light illumination.
- No need for an ambient value.
- We get realistic physical effects like colour bleeding caustics
- Computationaly expensive.
Question 1 (d) In scanline fill the algorithm moves across a scanline and performs a check to determine if each pixel is inside or outside the polygon.
Explain the procedure with reference to the diagram below.
- The polygon is filled by scanning accross each row and colouring any pixels if they lie within it.
- Remove any horizontal edges from the polygon.
- Find max and min y values of all polygon edges.
- Create a list of the scan lines that intersect the polygon.
- List the pixels where the intersection is in asending order along x. p0, p1, p2, p3
- Fill by point pairs eg. (p0,p1) (p2, p3)
Question 1 (d) ii In scanline fill the algorithm moves across a scanline and performs a check to determine if each pixel is inside or outside the polygon.
- How does the alogrithm handle a case such as that illustrated in the diagram below where the intersection is an edge endpoint?
- We can still fill this pair wise. (p0, p1) and (p1, p2)
- e1 and e2 share p1 which works fine for the algorithm.
- Computing the intersection of the scan line with e1 and e2 seperately we get p1 twice.
- If the intersection is the y.min edges end point it is counted otherwise it is not.
- In this case edge e1 and e2 are used as their y.min is on the intersection.
Question 2 (a)
Explain the following computer graphics term:
i. pixel
- A pixel or pel (picture element) it is the smallest controllable element of a picture represented on the screen.
- Each pixel has a specific x, y position in a rastor image.
- Each pixel has an intesity level of colour.
- Each pixel can be associated with other information such as z depth.
Question 2 (a) Explain the following computer graphics term:
ii. graphics pipeline
- The graphics pipeline refers to the sequence of steps used to create a 2D raster representation of a 3D scene.
- A scene is created out of geometric primitives. Triangles are the norm.
- There are important stages the graphics pipeline goes through, vertex processing, clipping and primitive assembly, rasterization and fragment processing.
Question 2 (a) Explain the following computer graphics term:
iii. wireframe
- A wireframe is a visual representation of a 3D or physical object showing only the edges of polygons or other primitves.
- Interior area is not displayed.
- Objects are projected onto the computer screen by drawing lines at the location of each edge.
- Simple and fast to calculate.
- Using a wire frame model allows visualization of the underlying design structure of a 3D model
Question 2 (a) Explain the following computer graphics term:
iv. Rasterisation
- The technique of mapping scene geometry to pixels.
- A 3D scene described as polygons is rendered as discrete 2D primitives.
- Rasterisation is currently the most popular technique for producing real-time 3D computer graphics and is used on all graphics cards.
- Rasterization does not prescribe a particular way to compute the color of pixels.
Question 2 (b) Describe, using a diagram where appropriate, an algorithm that draws a straight line between screen co-ordinates (x0, y0) and (x1, y1) using only integer arithmetic. assume that the line is in the first octant.
The Bresenham line algorithm!
- Draw the pixel at (x, y) making sure it’s the closest pixel to the point that belongs on the line.
- (Pixels are not points so we have to find the one that is closest to the point.)
- Move across the x-axis and decide at each step what will be the next point on the y-axis to draw.
- Decision: do we draw (x+1, y) or do we draw (x+1, y+1)?
- d1 is smaller than d2 so the next point after (x, y) that should be drawn is (x+1, y+1).
Question 2 (c) The Cohen-Sutherland line clipping algorithm uses 4-bit codes to determine whether endpoints lie inside or outside the window. For the line shown in the diagram below, explain how the algorithm evaluates where clipping should occur.
- Need to work out the intersection points. Only need to consider the end points of each bit. If both endpoints lie inside the clipped rectangle then entire line is inside and is kept with no clipping required. If one lies inside and one outside the window we need to compute intersection point. The sequence for reading the codes’ bits is LRBT (Left, Right, Bottom, Top). There are two intersection points.
- Once the bit codes are found need to do a logical AND to determine if the line is completely outside the window. If the point is not 0 it can be trivially rejected. A logical OR will determine if a line is completly inside the window if 0 it is trivailly accepted.
- This is a divide and conqier algorithm. Line (A,D) is rejected as though AND is 0000 the OR is 1001 meaning it has to be trivially rejected. The algorithm now recalulates at the intersection giving line (A,C) also rejected as OR is 0001. Next intersection is line (A,B) which is accepted as AND is 0000 and OR is 0000.
Question 3 (a) Why is Phong shading more computationally expensive than Gouraud shading?
- Goroud shading computes the colours at each vertex of a polygon and interpolates those colours across the polygon.
- Phong shading liniarly interpolates a normal vector accross the surface of a polygon from the polygons vertex normals.
- The surface normal is interpolated and normalised at each pixel and is used to attain the final pixel colour.
- Phong shading computes reflections at each pixel rather than at each vertex like Gouraud shading does making it musch more computatonally expensive.
Question 3 (b) Describe the technique of bump mapping.
- Bump mapping is like texture mapping. It adds what appears to have surface variations.
- Bump mapping evaluates the current light intensity and adds fake depth by modifying the surface normals. NOT THE GEOMETRY.
- The surface of a 2D texture is flat and teh surface normals go straight up.
- Bump mapping changes the brightness of the pixels on the surface in respose to the hight map that is specified for the surface.
Question 3 (c) i Explain the concept of raytracing.
- A ray of light is traced for every pixel starting from what the eye or camera sees working backwards through the scene.
- The ray is tested for intersection with every object in the scene calculating either reflection, refraction or obsorbtion.
- If an object is hit a ray is projected from the interseaction point towards the light source.
- If object is reflected a secondary ray is projected from the intersection point.
- If an object is trasparant a ray is projected along the angle of refraction.
- If any of the scondary rays hit objects then tertiary rays are generated.