From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

Proposal (GSoC 2018 - Many Light Sampling)

Name

Erik Englesson

Email / Web

Email
mailto:erikenglesson@gmail.com
Web
http://erikenglesson.com

Synopsis

This project will implement a paper[1] that reduces the time for Cycles to render scenes that have a large number of light sources in them, e.g., scenes with mesh lights(each triangle is a light). More specifically, it reduces the time to shade points that depend on many light sources. The idea of the paper is to avoid looping over all the possible light sources linearly for each shading point and instead only stochastically sample some of the most important ones. This is done by constructing a Bounding Volume Hierarchy(BVH) of all the light sources in the scene and efficiently using this data structure to choose which light sources each shading point should use.

Benefits

This project would make Cycles handle complex lighting environments more efficiently. It would even be possible to render scenes with millions of lights within a reasonable time limit, which is not currently possible. This gives more freedom for the artists to create the scenes they imagine without having to worry about performance penalties for using a large number of lights.

Deliverables

If this method works as intended, then the result of this project would be that Cycles renders scenes with many lights faster. This result would come to artists for free without having to do anything else than having to turn on this feature. Ideally, this method will work without having to fine-tune user-facing parameters, but at least the following ones should be exposed to the user during development:

  • On/Off Checkbox: for artists to choose if they want to use this method or not
  • Splitting threshold: a slider between 0-1 where 0 means only sample one light source and 1 means to sample all light sources.

Documentation for the intended user will be provided with a high-level overview of how the method works.

Project Details

The project can be split up into two major parts: the construction and the traversal algorithm of the BVH. These parts are outlined below:

  • BVH Construction
    • Setup the new node data structure with setter and getter methods.
    • Modify existing SAH implementation to use orientation of the bounds.
    • Build BVH of lamps(orientation, bbox, energy, area, #lights etc)
  • Light sampling - Traversal of BVH
    • Implement recursive traversal algorithm that works in a top-down manner which, at each node, chooses to either “split” or “sample”:
      • Split: Chooses several lamps below the current node
        • Implement a split heuristic function
        • If the split heuristic for a node is larger than a threshold then the traversal algorithm will go down both child nodes. Otherwise, it will sample.
      • Sample: Chooses a single lamp below the current node
        • Create an importance measure function that depends on a shading point and a BVH node(light cluster).
        • More probable to go down the child with the highest importance


Project Schedule

I do not think there will be time for a complete implementation of all the features mentioned in the paper. Therefore, I think it would be good to create a minimal implementation first, which is then extended over time. I have not explicitly allocated time for documentation, testing, etc., but that will be done continuously during the project. Below is a preliminary project plan:

Time period Plan
until 30/05 Get a better understanding of the codebase and read up on details of the paper.
31/05 - 13/06 Implement BVH construction algorithm(single type of light)
14/06 - 28/06 Implement BVH traversal algorithm(no splitting)
29/06 - 12/07 Add support for more types of lights
13/07 - 27/07 Implement splitting
30/07 - 13/08 Volume support or complete any unfinished task above

Bio

My name is Erik Englesson, and I have a bachelor’s degree in media technology and a master’s degree in computer science from Linkoping University. I am currently studying mathematics at Stockholm University in Stockholm, Sweden, to further increase my skills in mathematics. I have done several 3D code projects in school, e.g., a fluid simulator, sound simulator, rigid body simulator, etc. Please have a look at http://erikenglesson.com to see some of my projects. During my studies, I have been fortunate enough to work in the field of computer graphics. I have done two software engineering internships at Pixar Animation Studios and a research internship at Weta Digital.

References

  1. Alejandro Conty, Christopher Kulla, Importance Sampling of Many Lights With Adaptive Tree Splitting, https://sites.google.com/site/ckulla/home/many-lights