Projekt: Ray Tracing

Semestr letni 2018:
Pracownia/wykład: czw.12:15-14:00, sala 110/139 lub 337
Konsultacje: 337


Aktualności

  1. Terminy: zadanie 2 (struktury) 10 maj, projekt końcowy do 14.VI
  2. Następny wykład: 24.V g. 12:30 metody Monte Carlo
  3. miesiąc maj - czas na prezentacje drugiego zadania
  4. Katalog z przykładami kodu

Schedule

Semestr:
             
     March 2018            April 2018             May 2018            June 2018        
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
             1  2  3   1  2  3  4  5  6  7         1  2  3  4  5                  1  2
 4  5  6  7> 8  9 10   8  9 10 11 12 13 14   6  7  8  9 10 11 12   3  4  5  6  7  8  9  
11 12 13 14 15 16 17  15 16 17 18 19 20 21  13 14 15 16 17 18 19  10 11 12 13 14 15 16
18 19 20 21 22 23 24  22 23 24 25 26 27 28  20 21 22 23 24 25 26  
25 26 27 28 29 30 31  29 30                 27 28 29 30 31        
             ^                     ^                     ^                     ^

Lectures:

  • 1. Introduction, requirements, program, literature
  • 2. What we need to know to write Ray Tracing: Task 1 (below)
    • Classical Whitted style ray tracing. Types of rays: primary, reflected, refracted, shadow
    • Ray-object intersection methods for: implicit surfaces and triangles
    • RJ Segura, FR Feito - "Algorithms to test ray-triangle intersection. Comparative study"
      9th International Conference in Central Europe on Computer... 2001 wscg.zcu.cz. PDF
    • Tomas Moller, Ben Trumbore - "Fast, minimum storage ray/triangle intersection", 1997 Page with PDF and code
  • 3. Acceleration structures (next lecture 5th April)
    Literatura: punkty 4 & 5 poniżej (prace doktorskie I.Walda i V.Havrana)
  

Literature:

  1. P.Shirley - Realistic Ray Tracing, A.K. Peters 2000
  2. M.Pharr, G.Humphreys - Physically Based Rendering, Morgan Kaufmann 2004 (also newer 2nd and 3rd editions, source code, PBRT.ORG)
  3. P.Dutre - Global Illumination Compendium
  4. V.Havran Heuristic Ray Shooting Algorithms, praca doktorska, Praga 2000.
  5. I.Wald Realtime Ray Tracing and Interactive Global Illumination, praca doktorska, Saarbrucken 2004.

Links:



Project schedule

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 1(date: ~22/29.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: pbrt, embree, 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.

    Symbols:

    • 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 compare it as a reference to you later implementation of acceleration structures.

  • Task 2: Acceleration structures (for month of may)
    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: kd-tree or BVH (grids could be negotiated). Final versions will be tested on the same scenes and additional points can be granted for best performance.

    Selection of scenes in Wavefront obj format: McGuire Graphics Data

    Additional comment: See view_test scene for view angle and orientations testing (obj uses righthanded coordinate system). Compare your output if it matches reference view and the lightness level. 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 (final date: 14.VI.2018)
    Based on ray tracing engine from previous task 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 eg. corrected)
    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

Andrzej Łukaszewski (anl(at)ii.uni.wroc.pl)