Photorealistic Computer Graphics

Summer semester 2016:
Lecture: monday 14:15-16:00, room 119
Office: 337


  1. Exam: Monday 20th June 2016, 14:15, room 337
  2. Example exam questions: sample.pdf
  3. Updated program: 2016 Lecture program
  4. Older program in Polish year 2010


  • Introduction, requirements, program, literature
  • Classical Whitted style ray tracing. Types of rays: primary, reflected, refracted, shadow
  • Ray-object intersection methods for: implicit surfaces, CSG, triangles, AABB,parametric surface
    • RJ Segura, FR Feito - "Algorithms to test ray-triangle intersection. Comparative study"
      9th International Conference in Central Europe on Computer... 2001 PDF
    • Tomas Moller, Ben Trumbore - "Fast, minimum storage ray/triangle intersection", 1997 PDF
  • Acceleration structures
  • ...

a Literature:

  1. P.Shirley - Realistic Ray Tracing, A.K. Peters 2000
  2. P.Dutre, P.Bekaert, K.Bala - Advanced Global Illumination, A.K. Peters 2003
  3. M.Pharr, G.Humphreys - Physically Based Rendering, Morgan Kaufmann 2004 (also 2nd edition and new comming soon 3rd, source code, PBRT.ORG)

b Literature (more, not updated):

  1. A.Glassner - Principles of Digital Image Synthesis, Morgan Kaufmann Publ., San Francisco 1995.
  2. A.Glassner - Introducton to Ray Tracing, Morgan Kaufmann Publ. 1989
  3. H.W.Jensen - Realistic Image Synthesis Using Photon Mapping, A.K. Peters 2001
  4. F.Sillion, C.Puech - Radiosity and Global Illumination, Morgan Kaufmann Publ. 1994
  5. M.F.Cohen, J.R.Wallace - Radiosity and Realistic Image Synthesis, A.P. 1993
  6. D.S.Ebert, F.K.Musgrave, D.Peacheay, K.Perlin, S.Worley - Texturing and Modelling, A.P.Professional 1994
  7. P.Dutre - Global Illumination Compendium
  8. V.Havran Heuristic Ray Shooting Algorithms, praca doktorska, Praga 2000.
  9. I.Wald Realtime Ray Tracing and Interactive Global Illumination, praca doktorska, Saarbrucken 2004.
  10. M.H.Kalos, P.A.Whitlock - Monte Carlo methods. Volume I: Basics, John John Wiley & Sons 1986
  11. Maciej Falski - "Przegląd modeli oświetlenia w grafice komputerowej" praca magisterska, Wrocław 2004.
  12. K.Devlin, A.Chalmers,... - Tone Reproduction and Physically Based Spectral Rendering, STAR report Eurographics 2002. (operatory mapowania tonów rozd. 4.2)

  13. J.D.Foley, A. van Dam, S.K.Feiner, J.F.Hughes - Computer Graphics - Principles and Practice,  2nd edition, Addison-Wesley, Reading, Massachusetts 1992. (takze  tych samych autorow  ``Interactive Computer Graphics'',  ``Introduction to Computer Graphics'').
  14. Alan Watt - 3D Computer Graphics, 2nd edition, Addison-Wesley, 1993
  15. A.S. Glassner - Graphics Gems, Academic Press, Boston 1990.
  16. J. Arvo - Graphics Gems II, Academic Press, Boston 1991.
  17. D. Kirk - Graphics Gems III, Academic Press, Boston 1992.
  18. P.S. Heckbert - Graphics Gems IV, Academic Press, Boston 1994.


Lab: Monday 16:16-18:00, room 110, Thursday 14:15-16, room 137

Lab will involve writing one large project in stages. There are deadlines for each task/stage and delays decrease maximal number of points possible to get by 20%. The Lab project must be finished before the end of semester.
  • Task 0 (no points)
    Have you seen or cgi-quiz? If not look and go throug the quiz.

    An introductory task is to experiment with existing ray tracers try first the ones from the list below. Compile, render some example images, and browse the source code, look at the API.

    1. PBRT
    2. Embree (Intel)
    3. OptiX (Nvidia) requires CUDA capabilities
    4. ... e.g. Radiance, POV Ray, ...
  • Task 1(date: 14/17.III)
    Write a simple ray tracer (or ray caster with only primary rays) which reads Wavefront OBJ files and renders images. With source code there should be also provided example scenes and rendered images. Find not only scenes containing single object but some interiors which can be later used as an examples of indirect light bouncing off the walls. It is good to have OpenGL interface to test loading and to interactively change view parameters.

    For reading scenes assimp library (packaged in most of linux distributions) can be used otherwise writing simple parser of OBJ files is also possible. Use the existing code from examples for vector operations as well as intersections with triangles (examples from task 0 or links below). Take care to place comments in the code documenting origin of the parts not written by yourself.

    We execute program with a rendering task configuration file: RT plik.rtc

    Text file contains in following lines: comment, file.obj, file.png, k, xres yres, VPx VPy VPz, LAx LAy LAz, UPx UPy Upz, yview, ... First 7 lines are obligatory. We defined meaning of first 9 lines but the configuration file can be extended by adding more lines (e.g. rendering method and its parameters). With OpenGL interface you can change view parameters and write new configuration file.


    • k - recursion level (k=0 only primary rays: 1 ray per pixel, k=1 primary rays plus shadow rays from first intersection, ...)
    • xres x yres - image resolution
    • VP - View Point
    • LA - Look At
    • UP - Vector Up, default [0.0 1.0 0.0]
    • yview - vertical view angle defined by proportion of image height to focal distance.
      Default value yview=1.0 gives an angle like in classic camera with image sensor of height y=24mm and focal length f=24mm.
      For yview=0.5 we have normal lens (not wide angle not tele) with f=48 y=24.
      Angles in x direction are defined by yangle and image aspect ratio (inferred from image dimensions).
    Since obj files do not contain light sources we can add point lights in .rtc configuration file adding after line 9 one or more lines starting with letter 'L' followed by 3 floats describing position of light, 3 bytes (0-255) describing RGB color and float describing intensity. E.g.:
    L    5.0 8.0 20.0    255 255 200    100.0
    If there are no lights or the recursion level is 0 the objects should be renderd in their own diffuse color.
  • Task 1a: option
    For task 1 there is an option that you can add an ray casting engine Embree (API is described in doc/ directory of Embree) to your OpenGL viewer so you will not need to write your intersection functions. Instead of focusing on implementing acceleration structures you will have more time to implement more advanced global illumination algorithm (required).
  • Task 2: Acceleration structures (date: 11/14.IV.2016)
    Make your ray tracer fast with many objects, for the tests you can expect 50k, 200k triangles or more. To do it implement one of the acceleration structures: grid, kd-tree or BVH. Final versions will be tested on the same scenes and additional points can be granted for winners and for good performance.

    Selection of scenes in Wavefront obj format: McGuire Graphics Data

    Additional comments:
    See view_test scene for view angle and orientations testing (obj uses righthanded coordinate system). Compare your output if it matches reference view before submitting solution to kno/moodle. The image should not be completely black or white. Light intensity in .rtc file takes into account standard diffuse reflection with physical attenuation by inverse squared distance.

  • Task 3: Physically correct path tracer (date: 23.V.2016)
    Based on ray tracing engine from previous task (or Intel Embree) implement basic Monte Carlo renderer: path tracer. Is should render images in high dynamic range EXR format (OpenEXR library) in physical units. Requirements:
    1. Physically correct BRDF reflection model (not standard Phong)
    2. Area light sources with emission defined in material properties in physically sound photometric (or radiometric) units. In .mtl material file we have Ke tag. If Ke>0 we assume it describes irradiance/illuminance of the light source (in units W/m2 or lm/m2).
    3. We can assume that all coordinates are given in meters.
    4. Path termination by russian roulette
    5. Importance sampling eg. diffuse term by cosine function
    6. Set of example rendered scenes should be also included
    Task 4: Physically correct hybrid renderer (date: end of semester)
    Extend your physically correct renderer to generate efficiently caustics. The recommended choice is to implement photon mapping but bidirectional path tracing is also good choice. It is good to add transparent materials like glass and correctly calculate refraction using indices of refraction. Provide some scenes and images with caustic examples together with the code.

Andrzej Łukaszewski (anl(at)