<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Note that there will not be a way of reliably estimating the emission for all light sources. With procedural shaders, users can create light sources with infinite energy, singularities and other tricks that make calculating the total emission hard if not impossible. <div class=""><br class=""></div><div class="">-Stefan</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 2. Jun 2018, at 14:07, Brecht Van Lommel <<a href="mailto:brechtvanlommel@gmail.com" class="">brechtvanlommel@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Great to see an initial working implementation already!</div><div class=""><br class=""></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" class="">light->shader->is_consta<wbr class="">nt_emission(&constant_emission<wbr class="">)</font><font face="arial, helvetica, sans-serif" class=""> to get a constant emission value if it exists.</font><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">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 class=""><br class=""></div><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 1, 2018 at 10:41 PM, Erik Englesson <span dir="ltr" class=""><<a href="mailto:erikenglesson@gmail.com" target="_blank" class="">erikenglesson@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="">Hi all,</div><div class=""><br class=""></div><div class="">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 class=""><div class="">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 class=""></div><div class=""><br class=""></div><div class="">This week I have been working on the following:<br class=""><ul class=""><li class="">A simple implementation of the light BVH that is based on the PBRT book <br class=""></li><ul class=""><li class="">The splitting method to divide a node into two children is the simplest possible right now. It is not using orientations or SAH.<br class=""></li></ul><li class="">Method to convert the light BVH data representation on the host to a data structure that can be used in the kernel</li><ul class=""><li class="">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 class=""></li></ul><li class="">Kernel code to traverse the light BVH to chose a light<br class=""></li><ul class=""><li class="">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 class=""></li></ul></ul></div><div class="">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" class="">here</a>.<br class=""></div><div class=""><br class=""></div><div class=""><u class="">Plan for next week</u></div><div class=""><u class=""><br class=""></u></div><div class="">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 class=""></div><div class=""><u class=""><br class=""></u></div><div class="">1. Traversal code: Figure out a better way to rescale/stretch a random number so I can reuse it</div><div class="">2. Traversal code: Talk to the authors of the paper about the "uncertainty angle"<br class=""></div><div class="">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 class="">4. Get a better understanding/overview of the kernel code e.g. the kernel_path_surface.h file. </div><div class=""><br class=""></div><div class="">Unfortunately, I do not have any images to show you guys this week. Maybe next week!</div><div class=""><br class=""></div><div class="">Have a great weekend!</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Erik<br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div>
<br class="">-- <br class="">
Soc-2018-dev mailing list<br class="">
<a href="mailto:Soc-2018-dev@blender.org" target="_blank" class="">Soc-2018-dev@blender.org</a><br class="">
<a href="https://lists.blender.org/mailman/listinfo/soc-2018-dev" rel="noreferrer" target="_blank" class="">https://lists.blender.org/mail<wbr class="">man/listinfo/soc-2018-dev</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
-- <br class="">Soc-2018-dev mailing list<br class=""><a href="mailto:Soc-2018-dev@blender.org" class="">Soc-2018-dev@blender.org</a><br class="">https://lists.blender.org/mailman/listinfo/soc-2018-dev<br class=""></div></blockquote></div><br class=""></div></body></html>