CS184 Final Project Milestone Report

Pathtracing Lenses & Autofocus

Joey Li, Bryce Casaje, Derwin Wu, Morgan Lyu

Slides and Video

Slides Video

Project Summary

In this project, we want to upgrade our pathtracer by implementing support for custom realistic lenses. This will let us simulate features from using real camera lenses like aperture and depth of focus, helping to add more realism to our renders. We will do this by following the old Lens Simulator project specification from the Spring 2016 offering of this class. In addition, we intend to improve and add new features to the project, for example trying different autofocus algorithms to speed up the runtime, as well as make the tool easier to use through custom additions to the GUI.

Preliminary Results

Currently, we have upgraded the provided code from the old Lens Simulator project to work on our modern computers. This required upgrading the version of CGL, as well as many other fixes to get it to compile cross-platform. We also successfully integrated our Project 3-1 & 3-2 code, giving us working lighting (both direct and global) and material effects.

In addition, we have also finished going through the required tasks (Tasks 1 & 2) of the Lens Simulator project spec. This means that we have a working pathtracer that can simulate the refraction of different lenses and has contrast-based autofocus to automatically change the sensor focus depth to a specified target.

Finally, we have also made progress toward speeding up the processing time of contrast-based autofocus. We were able to get adaptive sampling working with the lens simulator, and ran some experiments to see how it affected the autofocus speed.

In the adaptive sampling default state (maxTolerance = 0.05, samplesPerBatch = 64), it did not affect the time that autofocus took to run. This makes sense because in the settings used by the autofocus (PathTracer::bump_settings), we use 16 samples, so most of the adaptive sampling code never runs. However, we tried numerous different settings for adaptive sampling. One setting that worked very well was maxTolerance = 0.25, samplesPerBatch = 8, as it finished 2 seconds faster (10% speedup) than the autofocus without adaptive sampling, and resulted in the same focus depth (so the focus is the exact same).

Screenshots

Lens refraction (Lenstester)

Rendering with and without autofocus (Pathtracer)

Default Focus
Auto-focus

Depth of field focus demo (Pathtracer)

Future Work

With these preliminary results, we are currently on schedule based on the timeline in our project proposal.

Next steps will be to focus on implementing multiple different speedup methods, such as different metrics and algorithms for determining the optimal sensor depth. We will also experiment more with different adaptive sampling settings to find optimal settings for autofocus. Additionally, we are looking to add non-speedup related features such as automatic patch selection via edge extraction using a convolution, texture mapping, and the GUI to make the live demo process easier. We currently plan to have the GUI display the pathtracer and lens camera’s parameters (such as sample rate, light rays per sample, current sensor depth) and allow changing of some of them on the fly.

Links

Index Proposal