[Soc-2018-dev] Weekly Report #07 - Many Light Sampling

Brecht Van Lommel brechtvanlommel at gmail.com
Fri Jun 29 21:07:52 CEST 2018


Some relevant Cycles functions are:
* Pick a random BSDF with shader_bsdf_pick() (in case there are multiple)
* Sample a random direction with bsdf_sample()
* Estimate the BSDF roughness with bsdf_get_roughness_squared()
* GGX evaluation is in bsdf_microfacet_ggx_eval_reflect(), can be copied
and simplified to remove the pdf output, anisotropy, clearcoat, etc.

It's not immediately clear to me how the GGX evaluation fits in. Normally
BSDF evaluation would take a direction vector towards the light (and a view
direction I and normal N which are constant for a shading point). But here
we have this random BSDF direction, vector to the cluster center and
maximum cosine...


On Fri, Jun 29, 2018 at 6:04 PM Erik Englesson <erikenglesson at gmail.com>
wrote:

> Hi all,
>
> Here is my report for the week:
>
> *This week* I have been working on adding support for background lights
> when using the light tree. Before this week, we had a certain fixed
> probability of choosing either to sample the distant lights or the light
> tree(background lights not supported).
>
> Now, a decision is made either to sample one of the three light groups:
> the light tree, the distant lights or the background. After a group has
> been chosen, the corresponding group sampling method is used. Deciding
> which light group to sample is done by sampling a CDF that is based on the
> energy of all the lights within each group. The tree is using the energy of
> the root node, which is the aggregate energy of all the lights in the tree.
> The distant and background lights uses an energy based on an approximation
> of how much of their emitted energy hits the scene(as PBRT does).
>
> I also found and fixed some bugs. One bug was an indexing bug between
> indices to the scene->lights array and the dscene->lights array. These
> started to differ as soon as lights were disabled since only enabled lights
> are sent to the device.
>
> The work done this week can be found in this commit
> <https://developer.blender.org/rB2cdb08f4ffb3d7d24935d82ba32b1b1100ee2cd6>
> .
>
> *Next week* I want to start on the first iteration of the traversal
> splitting method. One of the things I find unclear right now is the
> following in bold from the slide on page 20
> <https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxja3VsbGF8Z3g6NWM0NmU2YWVlNjE3ODk1Yw>
> :
>
> "Approximate solid angle of the cluster times BSDF peak
> • BSDF peak is computed as follows:
> 1. Sample a random direction from the BSDF
> 2. Compute a conservative maximum cosine with the vector to the
> cluster’s center
> 3. *Evaluate a simple GGX model with the BSDF roughness*"
>
> I have a limited understanding of microfacet theory and I have not read
> about the GGX model. I will have to look into this. Learning new things all
> the time!
>
> If there is time, after having implemented a first pass of the splitting
> method, I would like to see if I could do another iteration on the distant
> light sampling. It would be nice for the choice between different distant
> lights to depend on energy and maybe direction(the light_distant_sample()
> function in kernel_light.h).
>
> Have a great weekend!
>
> Thanks,
> Erik
> --
> Soc-2018-dev mailing list
> Soc-2018-dev at blender.org
> https://lists.blender.org/mailman/listinfo/soc-2018-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/soc-2018-dev/attachments/20180629/2350b845/attachment.html>


More information about the Soc-2018-dev mailing list