「利用者:Erikenglesson/GSoC 2018/Reports/Week 4」の版間の差分
(→Weekly Report - Week 4) |
細 (1版 をインポートしました) |
(相違点なし)
|
2018年6月29日 (金) 06:24時点における最新版
Weekly Report - Week 4
This week:
Before this week the light BVH construction code used a simple method to split a node into two child nodes which was only based on the bounding box of the node. This week, I have been implementing a new splitting method that uses the Surface Area Orientation Heuristic(SAOH). This splitting method considers the energy and directions of the lights within the nodes as well as the area of the bounding boxes of the nodes. For more information, see the paper.
To be more precise, this is what I have been working on this week:
- BVH Construction: Implemented the SAOH method
- BVH Construction: Added energy based on emission to each node (only considering point and spotlights)
- Light Sampling: The lights in the scene are not sampled with the same probability when using the light BVH. Therefore, the PDFs have to be changed to use the correct probabilities. This has been changed to work for normal lights but not for mesh lights.
- GUI: Added a checkbox to turn on/off the new light sampling method. It is in the Sampling section of the Render tab for now.
The changes mentioned in the first three bullet points are in this commit. The GUI changes can be found in this commit.
Test:
This is a good point to test the new light sampling method. My brother set up a simple test scene for me with 100 light sources in a closed room with some pillars. Below I have some equal time comparisons between the current light sampling method and the new method I am implementing.
I recommend comparing the full resolution figures to easier see the differences.
Figures 1 and 3 are using the current method and are rendered until they are finished using 128 samples per pixel and figures 2 and 4 uses the new method but they were canceled before they were finished. Figure 1 and 2 use point lights and figures 3 and 4 use spotlights. Figure 1 and 2 took 2m 34s to render and rendering 100 point lights with the new method using 128 samples until it finished took 3m 6s. Figure 3 and 4 took 2m 15s to render and rendering 100 spots with the new method using 128 samples until it finished took 3m 27s.
To summarize, the new method takes longer to finish rendering a picture using a fixed number of samples per pixels compared to the current method. However, the rendered picture with the new method is closer to convergence(less noisy) than the picture rendered with the current method. Even after the same amount of time.
The construction of the light BVH seems to be really quick so most of the difference in time seems to come from the light tree BVH traversal. Which makes sense since it is done so many times.
Plan for next week:
I wanted to quickly implement something that I could test. However, in doing so, I have cut some corners. I would like to spend next week to clean up the code, add support for more lights and to prepare the code for the implementation of the light sampling splitting algorithm. Here are some parts of the code I am currently not happy with:
- intern/cycles/render/light.cpp: There is some code duplication in device_update_tree_distribution() and device_update_distribution()
- intern/cycles/render/light_tree.cpp: Extend get_bbox(), get_bcone() and get_energy() to more light sources
- intern/cycles/render/light_tree.cpp: The get_energy() needs to correctly extract and convert emission to a single float energy
- intern/cycles/kernel/kernel_light.h: The way I changed the PDFs is a bit hacky and I have not updated PDFs for mesh lights. Doing this properly would probably require a larger structural change of the existing code. I will discuss this with Brecht and Lukas next week.
Also, I would like to make sure the code consistently follows the code style guidelines.
The light sampling splitting algorithm essentially just picks several light sources while traversing the light BVH instead of a single one. It seems the current kernel code would require a structural change to be able to handle sampling of several light sources at the same time. This is also something I will discuss with my mentors.