<div dir="ltr"><div>Great to see an initial working implementation already!</div><div><br></div>Regarding how Cycles represents energy for lights, it's defined by shader nodes which make it a bit tricky. To start I suggest using <font face="monospace, monospace">light->shader->is_consta<wbr>nt_emission(&constant_emission<wbr>)</font><font face="arial, helvetica, sans-serif"> to get a constant emission value if it exists.</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">In general lights can have textures, and we can imagine some ways to estimate average emission by averaging a few samples, or analyzing the shader node tree. But I wouldn't worry about that case for now.</font></div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 1, 2018 at 10:41 PM, Erik Englesson <span dir="ltr"><<a href="mailto:erikenglesson@gmail.com" target="_blank">erikenglesson@gmail.com</a>></span> wrote:<br><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>This week I had my final exam so now I can focus on the project full-time the entire summer! Looking forward to it.</div> <br><div>My project consists of two code parts: the light BVH construction and the traversal code to sample a light. Our idea is to do this iteratively by first creating a simple BVH construction and traversal code and then extend this more and more. <br></div><div><br></div><div>This week I have been working on the following:<br><ul><li>A simple implementation of the light BVH that is based on the PBRT book <br></li><ul><li>The splitting method to divide a node into two children is the simplest possible right now. It is not using orientations or SAH.<br></li></ul><li>Method to convert the light BVH data representation on the host to a data structure that can be used in the kernel</li><ul><li>The data structure of the BVH for the kernel is also the simplest possible right now. It is essentially a single array of structures only that the structure is represented as 4xfloat4.<br></li></ul><li>Kernel code to traverse the light BVH to chose a light<br></li><ul><li>This code calculates the probability of going down the left and right child as described in the paper and then randomly picks one and continues the process until a leaf node(think light) is found.<br></li></ul></ul></div><div>That is, I have a bare-bones implementation of the full pipeline now. It is very much work in progress and there are several things that can be improved upon. I pushed all of this to my local branch <a href="https://developer.blender.org/rB2e17c3f3a10bb2f6a62b1e8d5d236c437f7ae4e8" target="_blank">here</a>.<br></div><div><br></div><div><u>Plan for next week</u></div><div><u><br></u></div><div>The main focus of next week will be on implementing the splitting method for the light BVH construction that is described in the paper. If I have the time I also want to have a look at some smaller details:<br></div><div><u><br></u></div><div>1. Traversal code: Figure out a better way to rescale/stretch a random number so I can reuse it</div><div>2. Traversal code: Talk to the authors of the paper about the "uncertainty angle"<br></div><div>3. Each node should have a member that represents the "energy" of all lights inside it. I need to figure out how Cycles represents energy(strength?) for each light and set this member correctly.</div><div>4. Get a better understanding/overview of the kernel code e.g. the kernel_path_surface.h file. </div><div><br></div><div>Unfortunately, I do not have any images to show you guys this week. Maybe next week!</div><div><br></div><div>Have a great weekend!</div><div><br></div><div>Thanks,</div><div>Erik<br></div><div><br></div><div><br></div><div><br></div></div>
<br>-- <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/mail<wbr>man/listinfo/soc-2018-dev</a><br>
<br></blockquote></div><br></div></div>