Computer Laboratory

Introduction to Graphics (3 supervisions) (Michaelmas 2017)

Click here to check the course website.

This set of supervision exercises is heavily based on the previous IB Computer Graphics and Image Processing course.

Please hand in your work by 17:00 on the day before the supervision!

Supervision 1

Warmup questions

  1. Suppose you are designing a user interface for someone who is colour blind. Describe how some user interface of your choice should be suitably modified.
  2. Why is it better to look at faint stars and comets slightly off-centre rather than looking directly at them?
  3. In a CAD system using blue lines on a black background would be a poor choice for the interface colours for designing an object. Why is this?
  4. In New Zealand, warning road signs are black on yellow, it being alleged that this is easier to see than black on white. Why might this be true?
  5. What are the ray parameters of the intersection points between ray (1,1,1) + t(−1,−1,−1) and the sphere centered at the origin with radius 1? [FCG p89]

Longer questions

  1. Calculate the ultimate monitor resolution (i.e. colour pixels/inch) beyond which better resolution will be unnecessary. State what kind of monitor you are considering.
  2. Explain the Phong shading reflection model. How does it relate to Phong shading?
  3. What information would you need to define a ray-tracing viewing volume
  4. Explain how Ray tracing can achieve the following effects:
    • reflections
    • refraction
    • shadows
  5. Provide an example for distributed ray tracing and explain how the selected technique works

Supervision 2

Warmup questions

  1. Explain why we use homogeneous co-ordinates.
  2. We use a lot of triangles to approximate stuff in computer graphics. Why are they good? Why are they bad? Can you think of any alternatives?
  3. Put the the following stages of the OpenGL rendering pipeline in the correct order. Very briefly explain what each stage does.
    • Rasterization
    • Vertex shader
    • Fragment shader
    • Primitive setup
    • Clipping
  4. What is OpenGL? Why is it an API?
  5. Explain the following OpenGL concepts:
    • Vertex Buffer
    • Index buffer
    • Vertex Array Object
    How many vertices would you need to model a cube with and without an index buffer?
  6. What are the glsl in, out and uniform variables?

Longer questions

  1. Describe the Model, View, and Projection transformations.
  2. 2010 Paper 4 Question 4
  3. 2017 Paper 4 Question 3
  4. When transforming objects into world co-ordinates using matrix M, position vectors are pre-multiplied with M. Discuss what matrix you would need to use to transform the objects' normals.
  5. Describe the z buffering algorithm. Compare the projection matrix on slide 91 with the projection matrix in the 2010P4Q4 past paper, and discuss which one you need to use for Z buffering

Supervision 3

Written questions

  1. How could you use the following texture types to texture a sphere in OpenGL?
    • 2D
    • 3D
    • CUBE_MAP
    How do these techniques compare in terms of visual quality and storage?
  2. For downsampling an image, explain how each of the following sampling techniques work (feel free to use when unsure). Discuss performance, storage and visual quality.
  3. Search for "normal map" images on the internet. Why do they tend have an overall blue shade?
  4. How could you implement a reflective water surface in OpenGL using Frame Buffer Objects? What if you wanted to add reflection onto a spherical surface? (Ray tracing is tempting, but you are to think about the OpenGL way here :) ).
  5. Describe the use of each of the following colour spaces
    • RGB, sRGB
    • HLS
    • XYZ
    • LUV, L*a*b*

Practical exercises

Please email me your solution as an executable jar file -- make sure to include the source code as well

  1. Find you implementation of Tick 2 for the practical exercises (terrain)
  2. Add a big blue horizontal rectangle to the scene to imitate a water surface. You will need to
    • set up a new vertex buffer
    • set up an index buffer (unless rendering unindexed)
    • create a new pair of vertex and fragment shaders.
  3. Change your water to be semi-transparent.
    • Modify the fragment shader to output a non-1 alpha value
    • enable alpha blending in Java before rendering: glEnable (GL_BLEND); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    • Check the rendering order. Do you render the terrain or the water first?
  4. Add a tiled water texture onto your surface
    • Create or find a suitable tileable water image/texture online
    • Map the water texture onto the surface, make it repeat multiple times
    • Based on the global time, shift the water texture (you will need to pass the time to the shader as a uniform
  5. If you want to make your water even prettier, add normal (bump) mapping