<div dir="ltr">Some relevant Cycles functions are:<br><div>* Pick a random BSDF with <span style="font-family:monospace,monospace">shader_bsdf_pick() </span>(in case there are multiple)</div><div>* Sample a random direction with <span style="font-family:monospace,monospace">bsdf_sample()</span></div><div>* Estimate the BSDF roughness with <span style="font-family:monospace,monospace">bsdf_get_roughness_squared()</span><br></div><div>* GGX evaluation is in <span style="font-family:monospace,monospace">bsdf_microfacet_ggx_eval_reflect()</span>, can be copied and simplified to remove the pdf output, anisotropy, clearcoat, etc.<br></div><div><br></div><div>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...<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 29, 2018 at 6:04 PM Erik Englesson <<a href="mailto:erikenglesson@gmail.com" target="_blank">erikenglesson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>Here is my report for the week:</div><div><br></div><div><div><b>This week</b> 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). <br></div><div><br></div><div>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). <br></div><div><br></div><div>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.</div><div><br></div><div>The work done this week can be found in this <a href="https://developer.blender.org/rB2cdb08f4ffb3d7d24935d82ba32b1b1100ee2cd6" target="_blank">commit</a>.<br></div><div><br></div><div><b>Next week</b> 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 <a href="https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxja3VsbGF8Z3g6NWM0NmU2YWVlNjE3ODk1Yw" target="_blank">slide on page 20</a>:</div><div><br></div><div>"Approximate solid angle of the cluster times BSDF peak<br>• BSDF peak is computed as follows:<br>1. Sample a random direction from the BSDF<br>2. Compute a conservative maximum cosine with the vector to the<br>cluster’s center<br>3. <b>Evaluate a simple GGX model with the BSDF roughness</b>"</div><div><br></div><div>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!<br></div><div><br></div><div>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).</div><div><br></div><div>Have a great weekend!</div><div><br></div><div>Thanks,</div><div>Erik<br></div></div></div>
-- <br>
Soc-2018-dev mailing list<br>
<a href="mailto:Soc-2018-dev@blender.org" target="_blank">Soc-2018-dev@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/soc-2018-dev" rel="noreferrer" target="_blank">https://lists.blender.org/mailman/listinfo/soc-2018-dev</a><br>
</blockquote></div>