Homework 5 - Additional Light Sources, Tonemapping, HDR Output

In the fifth assignment of CENG795, we are expected to introduce many new features to the ray tracer, such as:

  • Directional Light Sources
  • Spot Light Sources
  • Photographic Tonemapping
  • HDR Output
In this assignment, I removed lodepng library and added OpenCV library to be able to generate both png and exr outputs.

Directional and Spot Light Sources

To introduce new light sources, I implemented an virtual base named "Light" for all the light sources. After converting old light types(which are point and area), I implemented Directional and Spot Light sources. My outputs are:
cube_directional.png(800x800) is saved in: 72 milliseconds 499 microseconds
dragon_spot_light_msaa.png(800x800) is saved in: 20 seconds 363 milliseconds 401 microseconds

 Photographic Tonemapping
For photographic tonemapping, I followed Reinhard's Photographic Reproduction Technique (http://www.cmap.polytechnique.fr/~peyre/cours/x2005signal/hdr_photographic.pdf). Note that in section 3.1, 1/N should be inside the exp operation.
cube_point.png(800x800) is saved in: 77 milliseconds 595 microseconds

cube_point_tonemapped.png(800x800) is saved in: 78 milliseconds 525 microseconds

HDR Output:
I used OpenCV for writing hdr input. Then, I uploaded my output to openhdr viewer: https://viewer.openhdr.org/i/5aef3ef13ece7308976122df/linear/exposure=20.9
Note:
  • I fixed a bug related to ply parsing
  • I fixed a bug which causes diffuse color becomes negative very rarely. It was no problem earlier, since I was clamping all the values. But it caused a lot of problem while tonemapping.
  • I needed to change shadow ray epsilon of scenes to 0.001. Original value 0.000001 caused some problems which I will look into.
  • My tonemapped cube output is very similar to reference image. But my exr output is not rendered same by viewer at the same exposures. There may be little differences about writing the output. In my opinion, both are satisfying results.
  • All scenes rendered on 8 threads, on Windows machine I mentioned on previous posts.

Yorumlar

Yorum Gönder

Bu blogdaki popüler yayınlar

Homework 3 - Transformations, Instancing, Distribution Ray Tracing

Homework 7 - Object Lights, Spherical Environment Mapping, Path Tracing

Homework 4 - All About Textures (Textures, Perlin Texture, Bump Mapping)